Skip to content

Commit ba52626

Browse files
authored
Merge pull request #32 from blecorre/feat/enum-order-status
feat: create enum for OrderStatus and simplify create order structure
2 parents 248df49 + d91a4b7 commit ba52626

File tree

1 file changed

+40
-30
lines changed

1 file changed

+40
-30
lines changed

src/shared-definitions.yaml

Lines changed: 40 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ components:
296296
'firstnames': ['Bob'],
297297
'gender': 'Male',
298298
'birthdate': '1980-03-21',
299-
'contactInformation': ['+32123456789', '[email protected]']
299+
'contactInformation': ['+32123456789', '[email protected]'],
300300
}
301301

302302
LocationSearch:
@@ -326,7 +326,7 @@ components:
326326
'south': 50.0929802,
327327
'west': 14.4012451,
328328
'north': 50.0812615,
329-
'east': 14.4394467
329+
'east': 14.4394467,
330330
}
331331

332332
LocationCircle:
@@ -425,7 +425,7 @@ components:
425425
{
426426
'type': 'refundable_with_deadline',
427427
'deadline': '2022-10-12T23:59:59.59Z',
428-
'penaltyAmount': '100.00'
428+
'penaltyAmount': '100.00',
429429
}
430430

431431
AccommodationType:
@@ -462,7 +462,7 @@ components:
462462
'checkinoutPolicy',
463463
'otherPolicies',
464464
'media',
465-
'roomTypes'
465+
'roomTypes',
466466
]
467467
properties:
468468
hotelId:
@@ -517,7 +517,7 @@ components:
517517
'media',
518518
'roomTypes',
519519
'id',
520-
'providerHotelId'
520+
'providerHotelId',
521521
]
522522
properties:
523523
hotelId:
@@ -578,7 +578,7 @@ components:
578578
'size',
579579
'maximumOccupancy',
580580
'media',
581-
'policies'
581+
'policies',
582582
]
583583
properties:
584584
name:
@@ -760,7 +760,7 @@ components:
760760
example:
761761
{
762762
'7b7b18e2-7357-4e98-9be6-aa182e0b090a':
763-
{ 'accommodation': 'prov.1234', 'roomType': 'ND' }
763+
{ 'accommodation': 'prov.1234', 'roomType': 'ND' },
764764
}
765765

766766
AdditionalPricePlanProperties:
@@ -791,7 +791,7 @@ components:
791791
example: { 'mealPlan': 'BB', 'ratePlan': 'BAR', 'roomTypeId': 'FM4' }
792792

793793
Order:
794-
description: An Order object
794+
description: Representation of the order
795795
type: object
796796
required: ['supplierReservationId', 'status']
797797
properties:
@@ -801,8 +801,7 @@ components:
801801
restrictions:
802802
$ref: '#/components/schemas/ServiceRestrictions'
803803
status:
804-
description: Status of an order
805-
type: string
804+
$ref: '#/components/schemas/OrderStatus'
806805

807806
SearchCriteria:
808807
description: An object to provide search criteria
@@ -910,28 +909,24 @@ components:
910909
required: ['orderId', 'order']
911910
properties:
912911
orderId:
913-
description: The ID of the order Created
914-
anyOf:
915-
- $ref: '#/components/schemas/UUID'
912+
$ref: '#/components/schemas/UUID'
916913
order:
917-
description: The created order
918-
anyOf:
919-
- $ref: '#/components/schemas/Order'
914+
$ref: '#/components/schemas/Order'
920915

921916
OrderCancellationResponse:
922917
description: Confirmation of an order cancellation
923918
type: object
924919
required: ['orderId', 'status']
925920
properties:
926921
orderId:
927-
description: Order ID
928-
allOf:
929-
- $ref: '#/components/schemas/UUID'
922+
$ref: '#/components/schemas/UUID'
930923
status:
931-
description: Result of cancellation
932-
type: string
924+
$ref: '#/components/schemas/OrderStatus'
933925
example:
934-
{ 'orderId': '11111111-2222-3333-4444-000000000001', 'status': 'CANCELLED' }
926+
{
927+
'orderId': '11111111-2222-3333-4444-000000000001',
928+
'status': 'CANCELLED',
929+
}
935930

936931
Iban:
937932
description: The International Bank Account Number
@@ -1016,7 +1011,7 @@ components:
10161011
'sourceAmount',
10171012
'targetCurrency',
10181013
'targetAmount',
1019-
'rate'
1014+
'rate',
10201015
]
10211016
type: object
10221017
properties:
@@ -1638,8 +1633,13 @@ components:
16381633
$ref: '#/components/schemas/Amount'
16391634
example:
16401635
{
1641-
'EUR': { 'total': '12500.00', 'reserved': '4500.00', 'available': '8000.00' },
1642-
'CLP': { 'total': '45000', 'reserved': '0', 'available': '45000' }
1636+
'EUR':
1637+
{
1638+
'total': '12500.00',
1639+
'reserved': '4500.00',
1640+
'available': '8000.00',
1641+
},
1642+
'CLP': { 'total': '45000', 'reserved': '0', 'available': '45000' },
16431643
}
16441644

16451645
BankAddress:
@@ -1692,9 +1692,9 @@ components:
16921692
'postCode': '80687',
16931693
'city': 'München',
16941694
'country': 'Germany',
1695-
'stateCode': null
1696-
}
1697-
}
1695+
'stateCode': null,
1696+
},
1697+
},
16981698
}
16991699

17001700
MongoLocation:
@@ -1838,7 +1838,7 @@ components:
18381838
'paymentValidationError',
18391839
'networkError',
18401840
'creationFailed',
1841-
'cancelled'
1841+
'cancelled',
18421842
]
18431843
message:
18441844
type: string
@@ -2087,7 +2087,7 @@ components:
20872087
'firstnames': ['Bob'],
20882088
'gender': 'Male',
20892089
'birthdate': '1980-03-21',
2090-
'contactInformation': ['+32123456789', '[email protected]']
2090+
'contactInformation': ['+32123456789', '[email protected]'],
20912091
}
20922092

20932093
AdultGuest:
@@ -2278,3 +2278,13 @@ components:
22782278
decimals:
22792279
description: The number of decimals for this currency
22802280
type: integer
2281+
2282+
OrderStatus:
2283+
description: Status of the order
2284+
type: string
2285+
enum:
2286+
- IN_PROGRESS
2287+
- CONFIRMED
2288+
- WAITLIST
2289+
- CANCELLED
2290+
- CREATION_FAILED

0 commit comments

Comments
 (0)