Skip to content

Commit

Permalink
Merge pull request ONDC-Official#7 from abhinavv245/main
Browse files Browse the repository at this point in the history
Minor enhancements
  • Loading branch information
tanyamadaan authored Feb 7, 2024
2 parents 95d81ac + aacf4b9 commit c795fd8
Show file tree
Hide file tree
Showing 19 changed files with 312 additions and 122 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -649,12 +649,24 @@ module.exports = {
},
"@ondc/org/settlement_basis": {
type: "string",
const: {
$data:
"/on_init/0/message/order/payments/0/@ondc~1org~1settlement_basis",
},
},
"@ondc/org/settlement_window": {
type: "string",
const: {
$data:
"/on_init/0/message/order/payments/0/@ondc~1org~1settlement_window",
},
},
"@ondc/org/withholding_amount": {
type: "string",
const: {
$data:
"/on_init/0/message/order/payments/0/@ondc~1org~1withholding_amount",
},
},

"@ondc/org/settlement_details": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ module.exports = {
},
"@ondc/org/provider_name": {
type: "string",
const: { $data: "/on_select/0/message/order/fulfillments/0/@ondc~1org~1provider_name" },
},
state: {
type: "object",
Expand Down Expand Up @@ -583,6 +584,7 @@ module.exports = {
required: ["currency", "value"],
},
},
additionalProperties: false,
required: ["price"],
},
},
Expand Down Expand Up @@ -676,6 +678,27 @@ module.exports = {
type: "string",
const: { $data: "/confirm/0/message/order/payments/0/@ondc~1org~1buyer_app_finder_fee_amount" },
},
"@ondc/org/settlement_basis": {
type: "string",
const: {
$data:
"/confirm/0/message/order/payments/0/@ondc~1org~1settlement_basis",
},
},
"@ondc/org/settlement_window": {
type: "string",
const: {
$data:
"/confirm/0/message/order/payments/0/@ondc~1org~1settlement_window",
},
},
"@ondc/org/withholding_amount": {
type: "string",
const: {
$data:
"/confirm/0/message/order/payments/0/@ondc~1org~1withholding_amount",
},
},
"@ondc/org/settlement_details": {
type: "array",
items: {
Expand All @@ -684,31 +707,63 @@ module.exports = {
settlement_counterparty: {
type: "string",
enum: ["seller-app", "buyer-app"],
const: {
$data:
"/confirm/0/message/order/payments/0/@ondc~1org~1settlement_details/0/settlement_counterparty",
},
},
settlement_phase: {
type: "string",
},
settlement_type: {
type: "string",
enum: ["upi", "neft", "rtgs"],
const: {
$data:
"/confirm/0/message/order/payments/0/@ondc~1org~1settlement_details/0/settlement_type",
},
},
beneficiary_name: {
type: "string",
const: {
$data:
"/confirm/0/message/order/payments/0/@ondc~1org~1settlement_details/0/beneficiary_name",
},
},
upi_address: {
type: "string",
const: {
$data:
"/confirm/0/message/order/payments/0/@ondc~1org~1settlement_details/0/upi_address",
},
},
settlement_bank_account_no: {
type: "string",
const: {
$data:
"/confirm/0/message/order/payments/0/@ondc~1org~1settlement_details/0/settlement_bank_account_no",
},
},
settlement_ifsc_code: {
type: "string",
const: {
$data:
"/confirm/0/message/order/payments/0/@ondc~1org~1settlement_details/0/settlement_ifsc_code",
},
},
bank_name: {
type: "string",
const: {
$data:
"/confirm/0/message/order/payments/0/@ondc~1org~1settlement_details/0/bank_name",
},
},
branch_name: {
type: "string",
const: {
$data:
"/confirm/0/message/order/payments/0/@ondc~1org~1settlement_details/0/branch_name",
},
},
},
allOf: [
Expand Down Expand Up @@ -759,6 +814,9 @@ module.exports = {
"collected_by",
"@ondc/org/buyer_app_finder_fee_type",
"@ondc/org/buyer_app_finder_fee_amount",
"@ondc/org/settlement_basis",
"@ondc/org/settlement_window",
"@ondc/org/withholding_amount",
],
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,7 @@ module.exports = {
required: ["currency", "value"],
},
},
additionalProperties: false,
required: ["price"],
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,8 @@ module.exports = {
type: "string",
pattern:
"^(-?[0-9]{1,3}(?:.[0-9]{6,15})?),( )*?(-?[0-9]{1,3}(?:.[0-9]{6,15})?)$",
errorMessage: "Incorrect gps value (minimum of six decimal places are required)",
errorMessage:
"Incorrect gps value (minimum of six decimal places are required)",
},
address: {
type: "string",
Expand Down Expand Up @@ -700,68 +701,93 @@ module.exports = {
},
required: ["descriptor"],
},
refund_eligible: {
type: "string",
reason_required: {
type: "boolean",
},
return_policy: {
cancellation_fee: {
type: "object",
properties: {
return_eligible: {
type: "string",
},
return_within: {
type: "string",
},
fulfillment_managed_by: {
percentage: {
type: "string",
},
return_location: {
amount: {
type: "object",
properties: {
address: {
currency: {
type: "string",
},
gps: {
value: {
type: "string",
},
},
required: ["address", "gps"],
required: ["currency", "value"],
},
},
required: [
"return_eligible",
"return_within",
"fulfillment_managed_by",
"return_location",
],
required: [],
},
},
if: {
required: [
"fulfillment_state",
"reason_required",
"cancellation_fee",
],
},
},
return_terms: {
type: "object",
properties: {
fulfillment_state: {
type: "object",
properties: {
fulfillment_state: {
descriptor: {
type: "object",
properties: {
descriptor: {
properties: {
code: {
const: "Order-delivered",
},
},
code: {
type: "string",
},
},
required: ["code"],
},
},
required: ["descriptor"],
},
then: {
required: ["fulfillment_state", "return_policy"],
return_eligible: {
type: "boolean",
},
else: {
required: [
"fulfillment_state",
"refund_eligible",
],
return_time: {
type: "object",
properties: {
duration: {
type: "string",
},
},
required: ["duration"],
},
return_location: {
type: "object",
properties: {
address: {
type: "string",
},
gps: {
type: "string",
},
},
required: ["address", "gps"],
},
fulfillment_managed_by: {
type: "string",
},
},
required: [
"fulfillment_state",
"return_eligible",
"return_time",
"return_location",
"fulfillment_managed_by",
],
},

replacement_terms: {
type: "array",
items: {
Expand Down Expand Up @@ -838,9 +864,9 @@ module.exports = {
},
},
},
additionalProperties:false,
required: [
"id",

"descriptor",
"creator",
"price",
Expand All @@ -850,8 +876,8 @@ module.exports = {
"location_ids",
"payment_ids",
"cancellation_terms",
"return_terms",
"replacement_terms",

"matched",
"recommended",
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const constants = require("../../../utils/constants");
module.exports = {
$id: "http://example.com/schema/onSelectSchema",
type: "object",
Expand Down Expand Up @@ -236,6 +237,7 @@ module.exports = {
},
"@ondc/org/category": {
type: "string",
enum: constants.CATEGORY_ID
},
"@ondc/org/TAT": {
type: "string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,27 @@ module.exports = {
"/confirm/0/message/order/payments/0/@ondc~1org~1buyer_app_finder_fee_amount",
},
},
"@ondc/org/settlement_basis": {
type: "string",
const: {
$data:
"/on_confirm/0/message/order/payments/0/@ondc~1org~1settlement_basis",
},
},
"@ondc/org/settlement_window": {
type: "string",
const: {
$data:
"/on_confirm/0/message/order/payments/0/@ondc~1org~1settlement_window",
},
},
"@ondc/org/withholding_amount": {
type: "string",
const: {
$data:
"/on_confirm/0/message/order/payments/0/@ondc~1org~1withholding_amount",
},
},
"@ondc/org/settlement_details": {
type: "array",
items: {
Expand Down Expand Up @@ -722,6 +743,9 @@ module.exports = {
"collected_by",
"@ondc/org/buyer_app_finder_fee_type",
"@ondc/org/buyer_app_finder_fee_amount",
"@ondc/org/settlement_basis",
"@ondc/org/settlement_window",
"@ondc/org/withholding_amount",
],
},
},
Expand Down Expand Up @@ -763,7 +787,6 @@ module.exports = {
"fulfillments",
"quote",
"payments",
"documents",
"created_at",
"updated_at",
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ module.exports = {
properties: {
type: {
type: "string",
enum:["end"]
},
location: {
type: "object",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ module.exports = {
},
},
required: ["id", "locations", "ttl"],
errorMessage: "id, locations are mandatory attributes and ttl is required for RFQ Flow"
},
items: {
type: "array",
Expand Down
Loading

0 comments on commit c795fd8

Please sign in to comment.