Skip to content

Commit ee22f37

Browse files
authored
🐛 web-server: fixes invitation data used in approval endpoint (#7831)
1 parent 0e41132 commit ee22f37

File tree

5 files changed

+51
-8
lines changed

5 files changed

+51
-8
lines changed

packages/models-library/src/models_library/api_schemas_webserver/products.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,23 @@ class ProductUIGet(OutputSchema):
135135
ExtraCreditsUsdRangeInt: TypeAlias = Annotated[int, Field(ge=0, lt=500)]
136136

137137

138+
TrialAccountAnnotated: TypeAlias = Annotated[
139+
PositiveInt | None,
140+
Field(
141+
description="Expiration time in days for trial accounts; `null` means not a trial account"
142+
),
143+
]
144+
145+
WelcomeCreditsAnnotated: TypeAlias = Annotated[
146+
ExtraCreditsUsdRangeInt | None,
147+
Field(description="Welcome credits in USD; `null` means no welcome credits"),
148+
]
149+
150+
138151
class InvitationGenerate(InputSchema):
139152
guest: LowerCaseEmailStr
140-
trial_account_days: PositiveInt | None = None
141-
extra_credits_in_usd: ExtraCreditsUsdRangeInt | None = None
153+
trial_account_days: TrialAccountAnnotated = None
154+
extra_credits_in_usd: WelcomeCreditsAnnotated = None
142155

143156

144157
class InvitationGenerated(OutputSchema):

packages/models-library/src/models_library/api_schemas_webserver/users.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
OutputSchemaWithoutCamelCase,
4242
)
4343
from .groups import MyGroupsGet
44-
from .products import InvitationGenerate
44+
from .products import TrialAccountAnnotated, WelcomeCreditsAnnotated
4545
from .users_preferences import AggregatedPreferences
4646

4747
#
@@ -255,9 +255,14 @@ class UsersForAdminListFilter(Filters):
255255
class UsersAccountListQueryParams(UsersForAdminListFilter, PageQueryParameters): ...
256256

257257

258+
class _InvitationDetails(InputSchema):
259+
trial_account_days: TrialAccountAnnotated = None
260+
extra_credits_in_usd: WelcomeCreditsAnnotated = None
261+
262+
258263
class UserAccountApprove(InputSchema):
259264
email: EmailStr
260-
invitation: InvitationGenerate | None = None
265+
invitation: _InvitationDetails | None = None
261266

262267

263268
class UserAccountReject(InputSchema):

services/web/server/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.68.0
1+
0.68.1

services/web/server/setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 0.68.0
2+
current_version = 0.68.1
33
commit = True
44
message = services/webserver api version: {current_version} → {new_version}
55
tag = False

services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ openapi: 3.1.0
22
info:
33
title: simcore-service-webserver
44
description: Main service with an interface (http-API & websockets) to the web front-end
5-
version: 0.68.0
5+
version: 0.68.1
66
servers:
77
- url: ''
88
description: webserver
@@ -12211,6 +12211,8 @@ components:
1221112211
minimum: 0
1221212212
- type: 'null'
1221312213
title: Trialaccountdays
12214+
description: Expiration time in days for trial accounts; `null` means not
12215+
a trial account
1221412216
extraCreditsInUsd:
1221512217
anyOf:
1221612218
- type: integer
@@ -12219,6 +12221,7 @@ components:
1221912221
maximum: 500
1222012222
- type: 'null'
1222112223
title: Extracreditsinusd
12224+
description: Welcome credits in USD; `null` means no welcome credits
1222212225
type: object
1222312226
required:
1222412227
- guest
@@ -17009,7 +17012,7 @@ components:
1700917012
title: Email
1701017013
invitation:
1701117014
anyOf:
17012-
- $ref: '#/components/schemas/InvitationGenerate'
17015+
- $ref: '#/components/schemas/_InvitationDetails'
1701317016
- type: 'null'
1701417017
type: object
1701517018
required:
@@ -17702,6 +17705,28 @@ components:
1770217705
- write
1770317706
- delete
1770417707
title: WorkspacesGroupsBodyParams
17708+
_InvitationDetails:
17709+
properties:
17710+
trialAccountDays:
17711+
anyOf:
17712+
- type: integer
17713+
exclusiveMinimum: true
17714+
minimum: 0
17715+
- type: 'null'
17716+
title: Trialaccountdays
17717+
description: Expiration time in days for trial accounts; `null` means not
17718+
a trial account
17719+
extraCreditsInUsd:
17720+
anyOf:
17721+
- type: integer
17722+
exclusiveMaximum: true
17723+
minimum: 0
17724+
maximum: 500
17725+
- type: 'null'
17726+
title: Extracreditsinusd
17727+
description: Welcome credits in USD; `null` means no welcome credits
17728+
type: object
17729+
title: _InvitationDetails
1770517730
_ItisVipResourceRestData:
1770617731
properties:
1770717732
source:

0 commit comments

Comments
 (0)