Skip to content

Commit

Permalink
Merge pull request #23 from windingtree/feat/currencies
Browse files Browse the repository at this point in the history
feat: add currencies api
  • Loading branch information
Galeaf11 authored Oct 21, 2022
2 parents ebd264b + db257c5 commit 523ba47
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 25 deletions.
73 changes: 49 additions & 24 deletions src/shared-definitions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ components:
'firstnames': ['Bob'],
'gender': 'Male',
'birthdate': '1980-03-21',
'contactInformation': ['+32123456789', 'contact@org.co.uk'],
'contactInformation': ['+32123456789', 'contact@org.co.uk']
}

LocationSearch:
Expand Down Expand Up @@ -330,7 +330,7 @@ components:
'south': 50.0929802,
'west': 14.4012451,
'north': 50.0812615,
'east': 14.4394467,
'east': 14.4394467
}

LocationCircle:
Expand Down Expand Up @@ -429,7 +429,7 @@ components:
{
'type': 'refundable_with_deadline',
'deadline': '2022-10-12T23:59:59.59Z',
'penaltyAmount': '100.00',
'penaltyAmount': '100.00'
}

AccommodationType:
Expand Down Expand Up @@ -466,7 +466,7 @@ components:
'checkinoutPolicy',
'otherPolicies',
'media',
'roomTypes',
'roomTypes'
]
properties:
hotelId:
Expand Down Expand Up @@ -521,7 +521,7 @@ components:
'media',
'roomTypes',
'id',
'providerHotelId',
'providerHotelId'
]
properties:
hotelId:
Expand Down Expand Up @@ -582,7 +582,7 @@ components:
'size',
'maximumOccupancy',
'media',
'policies',
'policies'
]
properties:
name:
Expand Down Expand Up @@ -764,7 +764,7 @@ components:
example:
{
'7b7b18e2-7357-4e98-9be6-aa182e0b090a':
{ 'accommodation': 'prov.1234', 'roomType': 'ND' },
{ 'accommodation': 'prov.1234', 'roomType': 'ND' }
}

AdditionalPricePlanProperties:
Expand Down Expand Up @@ -928,10 +928,7 @@ components:
description: Result of cancellation
type: string
example:
{
'orderId': '11111111-2222-3333-4444-000000000001',
'status': 'CANCELLED',
}
{ 'orderId': '11111111-2222-3333-4444-000000000001', 'status': 'CANCELLED' }

Iban:
description: The International Bank Account Number
Expand Down Expand Up @@ -1016,7 +1013,7 @@ components:
'sourceAmount',
'targetCurrency',
'targetAmount',
'rate',
'rate'
]
type: object
properties:
Expand Down Expand Up @@ -1638,13 +1635,8 @@ components:
$ref: '#/components/schemas/Amount'
example:
{
'EUR':
{
'total': '12500.00',
'reserved': '4500.00',
'available': '8000.00',
},
'CLP': { 'total': '45000', 'reserved': '0', 'available': '45000' },
'EUR': { 'total': '12500.00', 'reserved': '4500.00', 'available': '8000.00' },
'CLP': { 'total': '45000', 'reserved': '0', 'available': '45000' }
}

BankAddress:
Expand Down Expand Up @@ -1697,9 +1689,9 @@ components:
'postCode': '80687',
'city': 'München',
'country': 'Germany',
'stateCode': null,
},
},
'stateCode': null
}
}
}

MongoLocation:
Expand Down Expand Up @@ -1833,7 +1825,18 @@ components:
format: date-time
status:
type: string
enum: ['paid', 'pending', 'booked', 'serverError', 'paymentError', 'paymentValidationError', 'networkError', 'creationFailed', 'cancelled']
enum:
[
'paid',
'pending',
'booked',
'serverError',
'paymentError',
'paymentValidationError',
'networkError',
'creationFailed',
'cancelled'
]
message:
type: string
orderId:
Expand Down Expand Up @@ -2081,7 +2084,7 @@ components:
'firstnames': ['Bob'],
'gender': 'Male',
'birthdate': '1980-03-21',
'contactInformation': ['+32123456789', 'contact@org.co.uk'],
'contactInformation': ['+32123456789', 'contact@org.co.uk']
}

AdultGuest:
Expand Down Expand Up @@ -2242,3 +2245,25 @@ components:
type: string
depositOptions:
$ref: '#/components/schemas/GroupBookingDeposits'

CurrencyResponse:
description: List of currency meta with rates
type: object
additionalProperties:
$ref: '#/components/schemas/CurrencyMetaWin'

CurrencyMetaWin:
type: object
required: ['name', 'symbol', 'rateFromBaseCurrency', 'decimals']
properties:
name:
description: currency symbol
type: string
symbol:
description: currency symbol
type: string
rateFromBaseCurrency:
description: сгккутсн rate to USD
type: integer
decimals:
type: integer
43 changes: 42 additions & 1 deletion src/win.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ paths:

/hotels/{providerHotelId}:
get:
tags: [ offers ]
tags: [offers]
parameters:
- in: path
name: providerHotelId
Expand Down Expand Up @@ -1290,3 +1290,44 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Error'

/currencies:
get:
tags: [currencies]
responses:
200:
description: It's ok
content:
application/json:
schema:
$ref: '#/components/schemas/CurrencyResponse'
400:
description: Handled Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
401:
description: Handled Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
403:
description: Handled Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
404:
description: Handled Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
500:
description: Some server error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'

0 comments on commit 523ba47

Please sign in to comment.