From 138527456bb3ccbe33e277ced6a7c74ba808e79a Mon Sep 17 00:00:00 2001 From: CircleCI Date: Fri, 19 Jan 2024 07:50:55 +0000 Subject: [PATCH] JSON Schema Update --- config/v3/p2p_advert_create/receive.json | 19 +++++++++ config/v3/p2p_advert_create/send.json | 28 +++++++++++++ config/v3/p2p_advert_info/receive.json | 41 +++++++++++++++++++ config/v3/p2p_advert_list/receive.json | 41 +++++++++++++++++++ config/v3/p2p_advert_list/send.json | 9 ++++ config/v3/p2p_advert_update/receive.json | 19 +++++++++ config/v3/p2p_advert_update/send.json | 40 ++++++++++++++++++ config/v3/p2p_advertiser_adverts/receive.json | 19 +++++++++ config/v3/p2p_settings/receive.json | 33 +++++++++++++++ 9 files changed, 249 insertions(+) diff --git a/config/v3/p2p_advert_create/receive.json b/config/v3/p2p_advert_create/receive.json index 92924d50..3d3e41f4 100644 --- a/config/v3/p2p_advert_create/receive.json +++ b/config/v3/p2p_advert_create/receive.json @@ -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" @@ -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" @@ -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", diff --git a/config/v3/p2p_advert_create/send.json b/config/v3/p2p_advert_create/send.json index ed1a51d9..b156ecd8 100644 --- a/config/v3/p2p_advert_create/send.json +++ b/config/v3/p2p_advert_create/send.json @@ -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", @@ -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", diff --git a/config/v3/p2p_advert_info/receive.json b/config/v3/p2p_advert_info/receive.json index d86036e3..3ebd7c33 100644 --- a/config/v3/p2p_advert_info/receive.json +++ b/config/v3/p2p_advert_info/receive.json @@ -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" @@ -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", @@ -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" @@ -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", diff --git a/config/v3/p2p_advert_list/receive.json b/config/v3/p2p_advert_list/receive.json index 291b08ce..056c1d72 100644 --- a/config/v3/p2p_advert_list/receive.json +++ b/config/v3/p2p_advert_list/receive.json @@ -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" @@ -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", @@ -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" @@ -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", diff --git a/config/v3/p2p_advert_list/send.json b/config/v3/p2p_advert_list/send.json index 04048846..4f9c6f15 100644 --- a/config/v3/p2p_advert_list/send.json +++ b/config/v3/p2p_advert_list/send.json @@ -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", diff --git a/config/v3/p2p_advert_update/receive.json b/config/v3/p2p_advert_update/receive.json index 51400c24..314d9713 100644 --- a/config/v3/p2p_advert_update/receive.json +++ b/config/v3/p2p_advert_update/receive.json @@ -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" @@ -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" @@ -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", diff --git a/config/v3/p2p_advert_update/send.json b/config/v3/p2p_advert_update/send.json index 188c9262..4d046ffe 100644 --- a/config/v3/p2p_advert_update/send.json +++ b/config/v3/p2p_advert_update/send.json @@ -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", @@ -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", diff --git a/config/v3/p2p_advertiser_adverts/receive.json b/config/v3/p2p_advertiser_adverts/receive.json index 05dd2b8e..58f34c25 100644 --- a/config/v3/p2p_advertiser_adverts/receive.json +++ b/config/v3/p2p_advertiser_adverts/receive.json @@ -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" @@ -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" @@ -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", diff --git a/config/v3/p2p_settings/receive.json b/config/v3/p2p_settings/receive.json index c6428e09..5ee3dfe8 100644 --- a/config/v3/p2p_settings/receive.json +++ b/config/v3/p2p_settings/receive.json @@ -79,6 +79,39 @@ "description": "A buyer will be temporarily barred after marking this number of cancellations within cancellation_period.", "type": "integer" }, + "counterparty_term_steps": { + "description": "Recommended step values for choosing advert counterparty terms.", + "type": "object", + "additionalProperties": false, + "required": [ + "completion_rate", + "join_days", + "rating" + ], + "properties": { + "completion_rate": { + "description": "Values for minimum 30 day completion rate.", + "type": "array", + "items": { + "type": "number" + } + }, + "join_days": { + "description": "Values for minimum joined days.", + "type": "array", + "items": { + "type": "integer" + } + }, + "rating": { + "description": "Values for minimum average rating.", + "type": "array", + "items": { + "type": "number" + } + } + } + }, "cross_border_ads_enabled": { "description": "When 0, only exchanges in local currency are allowed for P2P advertiser.", "type": "integer",