Skip to content

Commit

Permalink
JSON Schema Update
Browse files Browse the repository at this point in the history
  • Loading branch information
binarysysadmin committed Jan 19, 2024
1 parent e9a0910 commit 1385274
Show file tree
Hide file tree
Showing 9 changed files with 249 additions and 0 deletions.
19 changes: 19 additions & 0 deletions config/v3/p2p_advert_create/receive.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,13 @@
"string"
]
},
"eligible_countries": {
"description": "2 letter country codes. Counterparties who do not live in these countries are not allowed to place orders against this advert.",
"type": "array",
"items": {
"type": "string"
}
},
"id": {
"description": "The unique identifier for this advert.",
"type": "string"
Expand Down Expand Up @@ -256,6 +263,14 @@
"description": "Maximum order amount at this time, in `account_currency`, formatted to appropriate decimal places.",
"type": "string"
},
"min_completion_rate": {
"description": "Counterparties who have a 30 day completion rate less than this value are not allowed to place orders against this advert.",
"type": "number"
},
"min_join_days": {
"description": "Counterparties who joined less than this number of days ago are not allowed to place orders against this advert.",
"type": "integer"
},
"min_order_amount": {
"description": "Minimum order amount specified in advert, in `account_currency`.",
"type": "number"
Expand All @@ -272,6 +287,10 @@
"description": "Minimum order amount at this time, in `account_currency`, formatted to appropriate decimal places.",
"type": "string"
},
"min_rating": {
"description": "Counterparties who have an average rating less than this value are not allowed to place orders against this advert.",
"type": "number"
},
"order_expiry_period": {
"description": "Expiry period (seconds) for order created against this ad.",
"type": "integer",
Expand Down
28 changes: 28 additions & 0 deletions config/v3/p2p_advert_create/send.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@
"pattern": "^[\\p{L}\\p{Nd}\\s'.,:;()@#/+-]{1,300}$",
"sensitive": 1
},
"eligible_countries": {
"description": "[Optional] 2 letter country codes. Counterparties who do not live in these countries will not be allowed to place orders against the advert.",
"type": "array",
"items": {
"type": "string",
"pattern": "^[a-z]{2}$"
},
"maxItems": 250,
"uniqueItems": true
},
"local_currency": {
"description": "[Optional] Local currency for this advert. If not provided, will use the currency of client's residence by default.",
"type": "string",
Expand All @@ -65,12 +75,30 @@
"exclusiveMinimum": true,
"minimum": 0
},
"min_completion_rate": {
"description": "[Optional] Counterparties who have a 30 day completion rate less than this value will not be allowed to place orders against the advert.",
"type": "number",
"maximum": 100,
"minimum": 0
},
"min_join_days": {
"description": "[Optional] Counterparties who joined less than this number of days ago will not be allowed to place orders against the advert.",
"type": "integer",
"maximum": 999,
"minimum": 0
},
"min_order_amount": {
"description": "Minimum allowed amount for the orders of this advert, in advertiser's `account_currency`. Should be less than or equal to `max_order_amount`.",
"type": "number",
"exclusiveMinimum": true,
"minimum": 0
},
"min_rating": {
"description": "[Optional] Counterparties who have an average rating less than this value will not be allowed to place orders against the advert.",
"type": "number",
"maximum": 5,
"minimum": 1
},
"order_expiry_period": {
"description": "[Optional] Expiry period (seconds) for order created against this ad.",
"type": "integer",
Expand Down
41 changes: 41 additions & 0 deletions config/v3/p2p_advert_info/receive.json
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,26 @@
"string"
]
},
"eligibility_status": {
"description": "Reasons why the counterparty terms do not allow the current user to place orders against this advert. Possible values: \n- `completion_rate`: current user's 30 day completion rate is less than `min_completion_rate`. \n- `country`: current user's residence is not in `eligible_countries`. \n- `join_date`: current user registered on P2P less than `min_join_days` in the past. \n- `rating`: current user's average review rating is less than `min_rating`.",
"type": "array",
"items": {
"type": "string",
"enum": [
"completion_rate",
"country",
"join_date",
"rating_average"
]
}
},
"eligible_countries": {
"description": "2 letter country codes. Counterparties who do not live in these countries are not allowed to place orders against this advert.",
"type": "array",
"items": {
"type": "string"
}
},
"id": {
"description": "The unique identifier for this advert.",
"type": "string"
Expand All @@ -226,6 +246,15 @@
1
]
},
"is_eligible": {
"description": "Indicates that the current user meets the counterparty terms for placing orders against this advert.",
"type": "integer",
"default": 0,
"enum": [
0,
1
]
},
"is_visible": {
"description": "Indicates that this advert will appear on the main advert list. It is only visible to the advert owner.",
"type": "integer",
Expand Down Expand Up @@ -259,6 +288,14 @@
"description": "Maximum order amount at this time, in `account_currency`, formatted to appropriate decimal places.",
"type": "string"
},
"min_completion_rate": {
"description": "Counterparties who have a 30 day completion rate less than this value are not allowed to place orders against this advert.",
"type": "number"
},
"min_join_days": {
"description": "Counterparties who joined less than this number of days ago are not allowed to place orders against this advert.",
"type": "integer"
},
"min_order_amount": {
"description": "Minimum order amount specified in advert, in `account_currency`. It is only visible for advertisers.",
"type": "number"
Expand All @@ -275,6 +312,10 @@
"description": "Minimum order amount at this time, in `account_currency`, formatted to appropriate decimal places.",
"type": "string"
},
"min_rating": {
"description": "Counterparties who have an average rating less than this value are not allowed to place orders against this advert.",
"type": "number"
},
"order_expiry_period": {
"description": "Expiry period (seconds) for order created against this ad.",
"type": "integer",
Expand Down
41 changes: 41 additions & 0 deletions config/v3/p2p_advert_list/receive.json
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,26 @@
"string"
]
},
"eligibility_status": {
"description": "Reasons why the counterparty terms do not allow the current user to place orders against this advert. Possible values: \n- `completion_rate`: current user's 30 day completion rate is less than `min_completion_rate`. \n- `country`: current user's residence is not in `eligible_countries`. \n- `join_date`: current user registered on P2P less than `min_join_days` in the past. \n- `rating`: current user's average review rating is less than `min_rating`.",
"type": "array",
"items": {
"type": "string",
"enum": [
"completion_rate",
"country",
"join_date",
"rating_average"
]
}
},
"eligible_countries": {
"description": "2 letter country codes. Counterparties who do not live in these countries are not allowed to place orders against this advert.",
"type": "array",
"items": {
"type": "string"
}
},
"id": {
"description": "The unique identifier for this advert.",
"type": "string"
Expand All @@ -255,6 +275,15 @@
1
]
},
"is_eligible": {
"description": "Indicates that the current user meets the counterparty terms for placing an order.",
"type": "integer",
"default": 0,
"enum": [
0,
1
]
},
"is_visible": {
"description": "Indicates that this advert will appear on the main advert list.",
"type": "integer",
Expand Down Expand Up @@ -288,6 +317,14 @@
"description": "Maximum order amount at this time, in `account_currency`, formatted to appropriate decimal places.",
"type": "string"
},
"min_completion_rate": {
"description": "Counterparties who have a 30 day completion rate less than this value are not allowed to place orders against this advert.",
"type": "number"
},
"min_join_days": {
"description": "Counterparties who joined less than this number of days ago are not allowed to place orders against this advert.",
"type": "integer"
},
"min_order_amount": {
"description": "Minimum order amount specified in advert, in `account_currency`. It is only visible for advertisers.",
"type": "number"
Expand All @@ -304,6 +341,10 @@
"description": "Minimum order amount at this time, in `account_currency`, formatted to appropriate decimal places.",
"type": "string"
},
"min_rating": {
"description": "Counterparties who have an average rating less than this value are not allowed to place orders against this advert.",
"type": "number"
},
"order_expiry_period": {
"description": "Expiry period (seconds) for order created against this ad.",
"type": "integer",
Expand Down
9 changes: 9 additions & 0 deletions config/v3/p2p_advert_list/send.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@
1
]
},
"hide_ineligible": {
"description": "[Optional] If set to 1, adverts for which the current user does not meet counteryparty terms are not returned.",
"type": "integer",
"default": 0,
"enum": [
0,
1
]
},
"limit": {
"description": "[Optional] Used for paging.",
"type": "integer",
Expand Down
19 changes: 19 additions & 0 deletions config/v3/p2p_advert_update/receive.json
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,13 @@
"string"
]
},
"eligible_countries": {
"description": "2 letter country codes. Counterparties who do not live in these countries are not allowed to place orders against this advert",
"type": "array",
"items": {
"type": "string"
}
},
"id": {
"description": "The unique identifier for this advert.",
"type": "string"
Expand Down Expand Up @@ -234,6 +241,14 @@
"description": "Maximum order amount at this time, in `account_currency`, formatted to appropriate decimal places.",
"type": "string"
},
"min_completion_rate": {
"description": "Counterparties who have a 30 day completion rate less than this value are not allowed to place orders against this advert.",
"type": "number"
},
"min_join_days": {
"description": "Counterparties who joined less than this number of days ago are not allowed to place orders against this advert.",
"type": "integer"
},
"min_order_amount": {
"description": "Minimum order amount specified in advert, in `account_currency`. It is only visible to the advert owner.",
"type": "number"
Expand All @@ -250,6 +265,10 @@
"description": "Minimum order amount at this time, in `account_currency`, formatted to appropriate decimal places.",
"type": "string"
},
"min_rating": {
"description": "Counterparties who have an average rating less than this value are not allowed to place orders against this advert.",
"type": "number"
},
"order_expiry_period": {
"description": "Expiry period (seconds) for order created against this ad.",
"type": "integer",
Expand Down
40 changes: 40 additions & 0 deletions config/v3/p2p_advert_update/send.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@
"pattern": "^[\\p{L}\\p{Nd}\\s'.,:;()@#/+-]{0,300}$",
"sensitive": 1
},
"eligible_countries": {
"description": "[Optional] 2 letter country codes. Counterparties who do not live in these countries will not be allowed to place orders against this advert. An empty array or null value will clear the condition.",
"type": [
"array",
"null"
],
"items": {
"type": "string",
"pattern": "^[a-z]{2}$"
},
"maxItems": 250,
"uniqueItems": true
},
"id": {
"description": "The unique identifier for this advert.",
"type": "string",
Expand Down Expand Up @@ -67,12 +80,39 @@
"exclusiveMinimum": true,
"minimum": 0
},
"min_completion_rate": {
"description": "[Optional] Counterparties who have a 30 day completion rate less than this value will not be allowed to place orders against this advert. A an empty array or null value will clear the condition.",
"type": [
"null",
"number"
],
"maximum": 100,
"minimum": 0
},
"min_join_days": {
"description": "[Optional] Counterparties who joined less than this number of days ago will not be allowed to place orders against this advert. A null value will clear the condition.",
"type": [
"integer",
"null"
],
"maximum": 999,
"minimum": 0
},
"min_order_amount": {
"description": "[Optional] Minimum allowed amount for the orders of this advert, in advertiser's `account_currency`. Should be less than or equal to `max_order_amount`.",
"type": "number",
"exclusiveMinimum": true,
"minimum": 0
},
"min_rating": {
"description": "[Optional] Counterparties who have an average rating less than this value will not be allowed to place orders against this advert. A null value will clear the condition.",
"type": [
"null",
"number"
],
"maximum": 5,
"minimum": 1
},
"order_expiry_period": {
"description": "[Optional] Expiry period (seconds) for order created against this ad.",
"type": "integer",
Expand Down
19 changes: 19 additions & 0 deletions config/v3/p2p_advertiser_adverts/receive.json
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,13 @@
"string"
]
},
"eligible_countries": {
"description": "2 letter country codes. Counterparties who do not live in these countries are not allowed to place orders.",
"type": "array",
"items": {
"type": "string"
}
},
"id": {
"description": "The unique identifier for this advert.",
"type": "string"
Expand Down Expand Up @@ -272,6 +279,14 @@
"description": "Maximum order amount at this time, in `account_currency`, formatted to appropriate decimal places.",
"type": "string"
},
"min_completion_rate": {
"description": "Counterparties who have a 30 day completion rate less than this value are not allowed to place orders.",
"type": "number"
},
"min_join_days": {
"description": "Counterparties who joined less than this number of days ago are not allowed to place orders.",
"type": "integer"
},
"min_order_amount": {
"description": "Minimum order amount, in `account_currency`.",
"type": "number"
Expand All @@ -288,6 +303,10 @@
"description": "Minimum order amount at this time, in `account_currency`, formatted to appropriate decimal places.",
"type": "string"
},
"min_rating": {
"description": "Counterparties who have an average rating less than this value are not allowed to place orders.",
"type": "number"
},
"order_expiry_period": {
"description": "Expiry period (seconds) for order created against this ad.",
"type": "integer",
Expand Down
Loading

0 comments on commit 1385274

Please sign in to comment.