Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
0fd9345
docs(OAS): fix UserId and Date examples
pgmarc Aug 21, 2025
4834150
docs(OAS): extract RenewalDays
pgmarc Aug 21, 2025
c15138b
docs(OAS): change date to date-time format
pgmarc Aug 21, 2025
32e9207
docs(OAS): add id + restrict Subscription schema
pgmarc Aug 21, 2025
e976b25
docs(OAS): fix resetTimestamp format
pgmarc Aug 22, 2025
38706d6
docs(OAS): fix usage level example
pgmarc Aug 22, 2025
6deadbe
docs(OAS): fix typo in usage level example
pgmarc Aug 22, 2025
f8df3bc
fix: correct type of usage levels
pgmarc Aug 26, 2025
354e63a
DOCS: IMPROVED OAS
Alex-GF Sep 19, 2025
6a0fe9c
feat: allow url pricing imports to auto update their Pricing2Yaml ver…
Alex-GF Sep 20, 2025
07b582a
feat: frontend api to create pricings and services from link
Alex-GF Sep 20, 2025
bb1600f
feat: frontend display to create pricings from link
Alex-GF Sep 20, 2025
d580d5c
fix: import pricing from URL input color in dark mode
Alex-GF Sep 21, 2025
93e70a6
feat: optimized services and pricings retrieval (when containing URL …
Alex-GF Sep 21, 2025
d57176e
refactor: set timeout to SPACE frontend requests
Alex-GF Sep 23, 2025
bfd62b6
fix: colors of adding pricing by link from UI
Alex-GF Sep 24, 2025
3d4e73d
fix: creation of pricing versions from URL
Alex-GF Sep 24, 2025
506f414
fix: rescue of services once disabled
Alex-GF Sep 24, 2025
227a158
feat: favicon & logo
Alex-GF Sep 24, 2025
a03ff31
fix: random test pricing generation
Alex-GF Sep 24, 2025
f0c7c87
test: service disability
Alex-GF Sep 24, 2025
e7d69be
feat: link pricings to services from repositories
Alex-GF Sep 24, 2025
7ec6f62
fix: on-premises deployment configuration
Alex-GF Sep 24, 2025
0c44800
fix: send 400 error when creating a contract with duplicated userId
Alex-GF Sep 24, 2025
f211bc2
feat: configured endpoint validators to return one error at a time
Alex-GF Sep 24, 2025
caaa63c
fix: handling of empty userId when creating contract
Alex-GF Sep 24, 2025
336cd11
fix: 500 when created duplicated pricing
Alex-GF Sep 24, 2025
31a2d46
fix: handling when providing invalid plan or add-on in subscription
Alex-GF Sep 24, 2025
f6cdd60
fix: subscriptionContraints docs
Alex-GF Sep 24, 2025
e0c7f1d
feat: licensed SPACE OAS
Alex-GF Sep 24, 2025
de05d77
fix: addition of pricing to service
Alex-GF Sep 24, 2025
cdb0e92
fix: small bugs
Alex-GF Sep 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
231 changes: 108 additions & 123 deletions api/docs/space-api-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ info:
contact:
email: [email protected]
version: 1.0.0
license:
name: MIT License
url: https://opensource.org/license/mit
externalDocs:
description: Find out more about Pricing-driven Solutions
url: https://sphere.score.us.es/
Expand Down Expand Up @@ -370,8 +373,7 @@ paths:
type: string
format: binary
description: >
The pricing configuration file in YAML format (.yaml or
.yml)
Either a pricing configuration file in YAML format (.yaml or .yml), or a URL pointing to the pricing in a repository such as [SPHERE](https://sphere.score.us.es)
required: true
responses:
'200':
Expand Down Expand Up @@ -596,8 +598,7 @@ paths:
type: string
format: binary
description: >-
The pricing configuration file in YAML format (.yaml or
.yml)
Either a pricing configuration file in YAML format (.yaml or .yml), or a URL pointing to the pricing in a repository such as [SPHERE](https://sphere.score.us.es)
required: true
responses:
'200':
Expand Down Expand Up @@ -2245,7 +2246,7 @@ components:
extends it by 10, then evaluations will consider 20 as the value
of the usage limit'
example: 1000
subscriptionContraint:
subscriptionConstraints:
type: object
description: >-
Defines some restrictions that must be taken into consideration
Expand Down Expand Up @@ -2303,68 +2304,19 @@ components:
actual state and history of a subscription contracted by an user.
required:
- billingPeriod
- usageLevel
- usageLevels
- contractedServices
- subscriptionPlans
- hystory
properties:
id:
$ref: '#/components/schemas/ObjectId'
userContact:
$ref: '#/components/schemas/UserContact'
billingPeriod:
$ref: '#/components/schemas/BillingPeriod'
usageLevel:
type: object
description: >-
Map that contains information about the current usage levels of the trackable usage limits of the contracted services. These usage limits are:


- All **RENEWABLE** usage limits.

- **NON_RENEWABLE** usage limits with `trackable` == true


Keys are service names and values are Maps containing the usage levels of each service.
additionalProperties:
type: object
description: >-
Map that contains information about the current usage levels of the usage limits that must be tracked.

Keys are usage limit names and values contain the current state ofeach usage level and their expected resetTimestamp (if usage limit type is RENEWABLE)
additionalProperties:
type: object
required:
- consumed
properties:
resetTimestamp:
type: string
format: date
description: >-
The date on which the current consumption of the usage limit
is expected to be reset, i.e. set to 0.


If the usage limit is **NON_RENEWABLE**, this field must not
be set.


It must be specified as a string in the ISO 8601 format
(yyyy-mm-dd).
consumed:
type: number
description: >-
Indicates how much quota has been consumed for this usage
limit
example: 5
example:
zoom:
maxSeats:
consumed: 10
petclinic:
maxPets:
consumed: 2
maxVisits:
consumed: 5
resetTimeStamp: "2025-07-31"
usageLevels:
$ref: '#/components/schemas/UsageLevels'
contractedServices:
$ref: '#/components/schemas/ContractedService'
subscriptionPlans:
Expand All @@ -2382,20 +2334,16 @@ components:
- endDate
properties:
startDate:
type: string
format: date
description: >-
The date on which the current billing period started. It must be
specified as a string in the ISO 8601 format (yyyy-mm-dd)
example: '2025-04-18'
The date on which the current billing period started
$ref: '#/components/schemas/Date'
example: '2025-04-18T00:00:00Z'
endDate:
type: string
format: date
description: >-
The date on which the current billing period is expected to end or
to be renewed. It must be specified as a string in the ISO 8601
format (yyyy-mm-dd)
example: '2025-12-31'
to be renewed
example: '2025-12-31T00:00:00Z'
$ref: '#/components/schemas/Date'
autoRenew:
type: boolean
description: >-
Expand All @@ -2405,18 +2353,7 @@ components:
example: true
default: true
renewalDays:
type: integer
description: >-
If `autoRenew` == true, this field is **required**.



It represents the number of days by which the current billing period
will be extended once it reaches its `endDate`. When this extension
operation is performed, the endDate is replaced by `endDate` +
`renewalDays`.
example: 365
default: 30
$ref: '#/components/schemas/RenewalDays'
ContractedService:
type: object
description: >-
Expand All @@ -2435,14 +2372,22 @@ components:
example:
zoom: "2025"
petclinic: "2024"
UserId:
type: string
description: The id of the contract of the user
example: 01c36d29-0d6a-4b41-83e9-8c6d9310c508
UserContact:
type: object
required:
- userId
- username
properties:
userId:
$ref: '#/components/schemas/ObjectId'
type: string
description: The id of the contract of the user
example: 01c36d29-0d6a-4b41-83e9-8c6d9310c508
username:
$ref: '#/components/schemas/Username'
fistName:
type: string
description: The first name of the user
Expand All @@ -2455,8 +2400,6 @@ components:
type: string
description: The email of the user
example: [email protected]
username:
$ref: '#/components/schemas/Username'
phone:
type: string
description: The phone number of the user, with international code
Expand All @@ -2471,6 +2414,7 @@ components:
description: >-
The plan selected to be included within the subscription from the
pricing of the service indicated in `contractedService`
minLength: 1
example:
zoom: ENTERPRISE
petclinic: GOLD
Expand All @@ -2493,8 +2437,9 @@ components:
description: >-
Indicates how many times has the add-on been contracted within the
subscription. This number must be within the range defined by the
`subscriptionContraint` of the add-on
`subscriptionConstraints` of the add-on
example: 1
minimum: 0
example:
zoom:
extraSeats: 2
Expand All @@ -2505,15 +2450,11 @@ components:
type: object
properties:
startDate:
type: string
format: date
description: >-
The date on which the user started using the subscription snapshot.
It must be specified as a string in the ISO 8601 format (yyyy-mm-dd)
example: '2024-04-18'
The date on which the user started using the subscription snapshot
example: '2024-04-18T00:00:00Z'
$ref: '#/components/schemas/Date'
endDate:
type: string
format: date
description: >-
The date on which the user finished using the subscription snapshot,
either because the contract suffered a novation, i.e. the
Expand All @@ -2523,7 +2464,8 @@ components:

It must be specified as a string in the ISO 8601 format
(yyyy-mm-dd).
example: '2024-04-17'
$ref: '#/components/schemas/Date'
example: '2024-04-17T00:00:00Z'
contractedServices:
$ref: '#/components/schemas/ContractedService'
subscriptionPlans:
Expand Down Expand Up @@ -2726,6 +2668,72 @@ components:
example: 68050bd09890322c57842f6f
pattern: '^[a-f0-9]{24}$'
readOnly: true
Date:
type: string
format: date-time
description: Date in UTC
example: '2025-12-31T00:00:00Z'
RenewalDays:
type: integer
description: >-
If `autoRenew` == true, this field is **required**.

It represents the number of days by which the current billing period
will be extended once it reaches its `endDate`. When this extension
operation is performed, the endDate is replaced by `endDate` +
`renewalDays`.
example: 365
default: 30
minimum: 1
UsageLevels:
type: object
description: >-
Map that contains information about the current usage levels of the
trackable usage limits of the contracted services. These usage limits are:

- All **RENEWABLE** usage limits.
- **NON_RENEWABLE** usage limits with `trackable` == true

Keys are service names and values are Maps containing the usage levels
of each service.
additionalProperties:
type: object
description: >-
Map that contains information about the current usage levels of the
usage limits that must be tracked.

Keys are usage limit names and values contain the current state of each
usage level and their expected resetTimestamp (if usage limit type is RENEWABLE)
additionalProperties:
type: object
required:
- consumed
properties:
resetTimestamp:
description: >-
The date on which the current consumption of the usage limit
is expected to be reset, i.e. set to 0.

If the usage limit is **NON_RENEWABLE**, this field must not
be set.

It must be specified as a string in UTC
$ref: '#/components/schemas/Date'
consumed:
type: number
description: >-
Indicates how much quota has been consumed for this usage limit
example: 5
example:
zoom:
maxSeats:
consumed: 10
petclinic:
maxPets:
consumed: 2
maxVisits:
consumed: 5
resetTimestamp: "2025-07-31T00:00:00Z"
requestBodies:
SubscriptionCompositionNovation:
description: >-
Expand Down Expand Up @@ -2753,6 +2761,7 @@ components:
type: object
required:
- userContact
- contractedServices
- subscriptionPlans
- subscriptionAddOns
properties:
Expand All @@ -2770,18 +2779,7 @@ components:
example: true
default: true
renewalDays:
type: integer
description: >-
If `autoRenew` == true, this field is **required**.



It represents the number of days by which the current
billing period will be extended once it reaches its
`endDate`. When this extension operation is performed, the
endDate is replaced by `endDate` + `renewalDays`.
example: 365
default: 30
$ref: '#/components/schemas/RenewalDays'
contractedServices:
$ref: '#/components/schemas/ContractedService'
subscriptionPlans:
Expand Down Expand Up @@ -2831,13 +2829,11 @@ components:
type: object
properties:
endDate:
type: string
format: date
description: >-
The date on which the current billing period is expected to end or
to be renewed. It must be specified as a string in the ISO 8601
format (yyyy-mm-dd)
example: '2025-12-31'
to be renewed
example: '2025-12-31T00:00:00Z'
$ref: '#/components/schemas/Date'
autoRenew:
type: boolean
description: >-
Expand All @@ -2847,18 +2843,7 @@ components:
example: true
default: true
renewalDays:
type: integer
description: >-
If `autoRenew` == true, this field is **required**.



It represents the number of days by which the current billing period
will be extended once it reaches its `endDate`. When this extension
operation is performed, the endDate is replaced by `endDate` +
`renewalDays`.
example: 365
default: 30
$ref: '#/components/schemas/RenewalDays'
required: true
responses:
UnprocessableEntity:
Expand Down Expand Up @@ -2906,7 +2891,7 @@ components:
description: The id of the user for locating the contract
required: true
schema:
$ref: '#/components/schemas/ObjectId'
$ref: '#/components/schemas/UserId'
Offset:
name: offset
in: query
Expand Down
2 changes: 1 addition & 1 deletion api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"mongoose": "^8.14.0",
"multer": "1.4.5-lts.2",
"node-fetch": "^3.3.2",
"pricing4ts": "^0.10.0",
"pricing4ts": "^0.10.3",
"redis": "^4.7.0",
"socket.io": "^4.8.1",
"uuid": "^11.1.0"
Expand Down
Loading
Loading