diff --git a/schema/FIS/Gift_Card/confirm.ts b/schema/FIS/Gift_Card/confirm.ts new file mode 100644 index 00000000..219d18db --- /dev/null +++ b/schema/FIS/Gift_Card/confirm.ts @@ -0,0 +1,148 @@ +export const confirmSchemaFIS10 = { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "context": { + "type": "object", + "properties": { + "domain": { "type": "string" }, + "location": { + "type": "object", + "properties": { + "city": { + "type": "object", + "properties": { + "code": { "type": "string" } + }, + "required": ["code"] + }, + "country": { + "type": "object", + "properties": { + "code": { "type": "string" } + }, + "required": ["code"] + } + }, + "required": ["city", "country"] + }, + "action": { "type": "string", "enum": ["confirm"] }, + "version": { "type": "string" }, + "bap_id": { "type": "string" }, + "bap_uri": { "type": "string", "format": "uri" }, + "bpp_id": { "type": "string" }, + "bpp_uri": { "type": "string", "format": "uri" }, + "transaction_id": { "type": "string" }, + "message_id": { "type": "string" }, + "timestamp": { "type": "string", "format": "date-time" }, + "ttl": { "type": "string" } + }, + "required": [ + "domain", + "location", + "action", + "version", + "bap_id", + "bap_uri", + "bpp_id", + "bpp_uri", + "transaction_id", + "message_id", + "timestamp", + "ttl" + ] + }, + "message": { + "type": "object", + "properties": { + "order": { + "type": "object", + "properties": { + "id": { "type": "string" }, + "status": { "type": "string" }, + "provider": { + "type": "object", + "properties": { + "id": { "type": "string" } + }, + "required": ["id"] + }, + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { "type": "string" }, + "price": { + "type": "object", + "properties": { + "currency": { "type": "string" }, + "value": { "type": "string" }, + "offered_value": { "type": "string" } + }, + "required": ["currency", "value", "offered_value"] + }, + "quantity": { + "type": "object", + "properties": { + "selected": { + "type": "object", + "properties": { + "count": { "type": "integer" } + }, + "required": ["count"] + } + }, + "required": ["selected"] + }, + "fulfillment_ids": { + "type": "array", + "items": { "type": "string" } + }, + "tags": { + "type": "array", + "items": { + "type": "object", + "properties": { + "descriptor": { + "type": "object", + "properties": { + "code": { "type": "string" } + }, + "required": ["code"] + }, + "list": { + "type": "array", + "items": { + "type": "object", + "properties": { + "descriptor": { + "type": "object", + "properties": { + "code": { "type": "string" } + }, + "required": ["code"] + }, + "value": { "type": "string" } + }, + "required": ["descriptor", "value"] + } + } + }, + "required": ["descriptor", "list"] + } + } + }, + "required": ["id", "price", "quantity", "fulfillment_ids", "tags"] + } + } + }, + "required": ["id", "status", "provider", "items"] + } + }, + "required": ["order"] + } + }, + "required": ["context", "message"] + } + \ No newline at end of file diff --git a/schema/FIS/Gift_Card/init.ts b/schema/FIS/Gift_Card/init.ts new file mode 100644 index 00000000..494ac715 --- /dev/null +++ b/schema/FIS/Gift_Card/init.ts @@ -0,0 +1,156 @@ +export const InitSchemaFIS10 = { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "context": { + "type": "object", + "properties": { + "domain": { "type": "string", "pattern": "^ONDC:FIS10$" }, + "location": { + "type": "object", + "properties": { + "city": { + "type": "object", + "properties": { "code": { "type": "string" } }, + "required": ["code"] + }, + "country": { + "type": "object", + "properties": { "code": { "type": "string" } }, + "required": ["code"] + } + }, + "required": ["city", "country"] + }, + "action": { "type": "string", "pattern": "^init$" }, + "version": { "type": "string" }, + "bap_id": { "type": "string" }, + "bap_uri": { "type": "string", "format": "uri" }, + "bpp_id": { "type": "string" }, + "bpp_uri": { "type": "string", "format": "uri" }, + "transaction_id": { "type": "string", "format": "uuid" }, + "message_id": { "type": "string", "format": "uuid" }, + "timestamp": { "type": "string", "format": "date-time" }, + "ttl": { "type": "string" } + }, + "required": ["domain", "location", "action", "version", "bap_id", "bap_uri", "bpp_id", "bpp_uri", "transaction_id", "message_id", "timestamp", "ttl"] + }, + "message": { + "type": "object", + "properties": { + "order": { + "type": "object", + "properties": { + "provider": { + "type": "object", + "properties": { "id": { "type": "string" } }, + "required": ["id"] + }, + "fulfillments": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { "type": "string" }, + "type": { "type": "string" }, + "stops": { + "type": "array", + "items": { + "type": "object", + "properties": { + "contact": { + "type": "object", + "properties": { + "phone": { "type": "string", "pattern": "^[0-9]{10}$" }, + "email": { "type": "string", "format": "email" } + }, + "required": ["phone", "email"] + }, + "person": { + "type": "object", + "properties": { "name": { "type": "string" } }, + "required": ["name"] + } + }, + "required": ["contact", "person"] + } + } + }, + "required": ["id", "type", "stops"] + } + }, + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { "type": "string" }, + "quantity": { + "type": "object", + "properties": { + "selected": { + "type": "object", + "properties": { "count": { "type": "integer", "minimum": 1 } }, + "required": ["count"] + } + }, + "required": ["selected"] + }, + "fulfillment_ids": { + "type": "array", + "items": { "type": "string" } + }, + "tags": { + "type": "array", + "items": { + "type": "object", + "properties": { + "descriptor": { "type": "object", "properties": { "code": { "type": "string" } }, "required": ["code"] }, + "list": { + "type": "array", + "items": { + "type": "object", + "properties": { + "descriptor": { "type": "object", "properties": { "code": { "type": "string" } }, "required": ["code"] }, + "value": { "type": "string" } + }, + "required": ["descriptor", "value"] + } + } + }, + "required": ["descriptor", "list"] + } + } + }, + "required": ["id", "quantity", "fulfillment_ids", "tags"] + } + }, + "billing": { + "type": "object", + "properties": { + "name": { "type": "string" }, + "address": { "type": "string" }, + "city": { + "type": "object", + "properties": { "name": { "type": "string" }, "code": { "type": "string" } }, + "required": ["name", "code"] + }, + "state": { + "type": "object", + "properties": { "name": { "type": "string" }, "code": { "type": "string" } }, + "required": ["name", "code"] + }, + "email": { "type": "string", "format": "email" }, + "phone": { "type": "string", "pattern": "^[0-9]{10}$" } + }, + "required": ["name", "address", "city", "state", "email", "phone"] + } + }, + "required": ["provider", "fulfillments", "items", "billing"] + } + }, + "required": ["order"] + } + }, + "required": ["context", "message"] + } \ No newline at end of file diff --git a/schema/FIS/Gift_Card/on_cancel.ts b/schema/FIS/Gift_Card/on_cancel.ts new file mode 100644 index 00000000..c2c15615 --- /dev/null +++ b/schema/FIS/Gift_Card/on_cancel.ts @@ -0,0 +1,179 @@ +export const onCancelSchemaFIS10 = { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "context": { + "type": "object", + "properties": { + "domain": { "type": "string" }, + "location": { + "type": "object", + "properties": { + "city": { "type": "object", "properties": { "code": { "type": "string" } }, "required": ["code"] }, + "country": { "type": "object", "properties": { "code": { "type": "string" } }, "required": ["code"] } + }, + "required": ["city", "country"] + }, + "action": { "type": "string", "enum": ["on_cancel"] }, + "version": { "type": "string" }, + "bap_id": { "type": "string" }, + "bap_uri": { "type": "string", "format": "uri" }, + "bpp_id": { "type": "string" }, + "bpp_uri": { "type": "string", "format": "uri" }, + "transaction_id": { "type": "string" }, + "message_id": { "type": "string" }, + "timestamp": { "type": "string", "format": "date-time" } + }, + "required": ["domain", "location", "action", "version", "bap_id", "bap_uri", "bpp_id", "bpp_uri", "transaction_id", "message_id", "timestamp"] + }, + "message": { + "type": "object", + "properties": { + "order": { + "type": "object", + "properties": { + "id": { "type": "string" }, + "status": { "type": "string", "enum": ["CANCELLED"] }, + "cancellation": { + "type": "object", + "properties": { + "cancelled_by": { "type": "string" }, + "reason": { "type": "object", "properties": { "id": { "type": "string" } }, "required": ["id"] } + }, + "required": ["cancelled_by", "reason"] + }, + "provider": { "type": "object", "properties": { "id": { "type": "string" } }, "required": ["id"] }, + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { "type": "string" }, + "price": { + "type": "object", + "properties": { + "currency": { "type": "string" }, + "value": { "type": "string" }, + "offered_value": { "type": "string" } + }, + "required": ["currency", "value", "offered_value"] + }, + "quantity": { + "type": "object", + "properties": { + "selected": { "type": "object", "properties": { "count": { "type": "integer" } }, "required": ["count"] } + }, + "required": ["selected"] + }, + "fulfillment_ids": { "type": "array", "items": { "type": "string" } }, + "tags": { + "type": "array", + "items": { + "type": "object", + "properties": { + "descriptor": { "type": "object", "properties": { "code": { "type": "string" } }, "required": ["code"] }, + "list": { + "type": "array", + "items": { + "type": "object", + "properties": { + "descriptor": { "type": "object", "properties": { "code": { "type": "string" } }, "required": ["code"] }, + "value": { "type": "string" } + }, + "required": ["descriptor", "value"] + } + } + }, + "required": ["descriptor", "list"] + } + } + }, + "required": ["id", "price", "quantity", "fulfillment_ids"] + } + }, + "fulfillments": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { "type": "string" }, + "state": { + "type": "object", + "properties": { + "descriptor": { "type": "object", "properties": { "code": { "type": "string", "enum": ["CANCELLED"] } }, "required": ["code"] } + }, + "required": ["descriptor"] + }, + "type": { "type": "string" }, + "stops": { + "type": "array", + "items": { + "type": "object", + "properties": { + "contact": { + "type": "object", + "properties": { + "phone": { "type": "string" }, + "email": { "type": "string", "format": "email" } + }, + "required": ["phone", "email"] + }, + "person": { "type": "object", "properties": { "name": { "type": "string" } }, "required": ["name"] }, + "authorization": { + "type": "object", + "properties": { + "type": { "type": "string", "enum": ["CODE", "CODE_PIN"] }, + "token": { "type": "string" } + }, + "required": ["type", "token"] + } + }, + "required": ["contact", "person", "authorization"] + } + } + }, + "required": ["id", "state", "type", "stops"] + } + }, + "billing": { + "type": "object", + "properties": { + "name": { "type": "string" }, + "address": { "type": "string" }, + "city": { "type": "object", "properties": { "name": { "type": "string" }, "code": { "type": "string" } }, "required": ["name", "code"] }, + "state": { "type": "object", "properties": { "name": { "type": "string" }, "code": { "type": "string" } }, "required": ["name", "code"] }, + "email": { "type": "string", "format": "email" }, + "phone": { "type": "string" } + }, + "required": ["name", "address", "city", "state", "email", "phone"] + }, + "quote": { + "type": "object", + "properties": { + "price": { "type": "object", "properties": { "currency": { "type": "string" }, "value": { "type": "string" } }, "required": ["currency", "value"] }, + "breakup": { + "type": "array", + "items": { + "type": "object", + "properties": { + "item": { "type": "object", "properties": { "id": { "type": "string" } }, "required": ["id"] }, + "title": { "type": "string" }, + "price": { "type": "object", "properties": { "currency": { "type": "string" }, "value": { "type": "string" } }, "required": ["currency", "value"] } + }, + "required": ["item", "title", "price"] + } + }, + "ttl": { "type": "string" } + }, + "required": ["price", "breakup", "ttl"] + } + }, + "required": ["id", "status", "cancellation", "provider", "items", "fulfillments", "billing", "quote"] + } + }, + "required": ["order"] + } + }, + "required": ["context", "message"] + } + \ No newline at end of file diff --git a/schema/FIS/Gift_Card/on_confirm.ts b/schema/FIS/Gift_Card/on_confirm.ts new file mode 100644 index 00000000..e6824e11 --- /dev/null +++ b/schema/FIS/Gift_Card/on_confirm.ts @@ -0,0 +1,153 @@ +export const onConfirmSchemaFIS10 = { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "context": { + "type": "object", + "properties": { + "domain": { "type": "string" }, + "location": { + "type": "object", + "properties": { + "city": { "type": "object", "properties": { "code": { "type": "string" } }, "required": ["code"] }, + "country": { "type": "object", "properties": { "code": { "type": "string" } }, "required": ["code"] } + }, + "required": ["city", "country"] + }, + "action": { "type": "string", "enum": ["on_confirm"] }, + "version": { "type": "string" }, + "bap_id": { "type": "string" }, + "bap_uri": { "type": "string", "format": "uri" }, + "bpp_id": { "type": "string" }, + "bpp_uri": { "type": "string", "format": "uri" }, + "transaction_id": { "type": "string" }, + "message_id": { "type": "string" }, + "timestamp": { "type": "string", "format": "date-time" } + }, + "required": ["domain", "location", "action", "version", "bap_id", "bap_uri", "bpp_id", "bpp_uri", "transaction_id", "message_id", "timestamp"] + }, + "message": { + "type": "object", + "properties": { + "order": { + "type": "object", + "properties": { + "id": { "type": "string" }, + "status": { "type": "string" }, + "provider": { "type": "object", "properties": { "id": { "type": "string" } }, "required": ["id"] }, + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { "type": "string" }, + "price": { "type": "object", "properties": { "currency": { "type": "string" }, "value": { "type": "string" }, "offered_value": { "type": "string" } }, "required": ["currency", "value", "offered_value"] }, + "quantity": { "type": "object", "properties": { "selected": { "type": "object", "properties": { "count": { "type": "integer" } }, "required": ["count"] } }, "required": ["selected"] }, + "fulfillment_ids": { "type": "array", "items": { "type": "string" } }, + "tags": { + "type": "array", + "items": { + "type": "object", + "properties": { + "descriptor": { "type": "object", "properties": { "code": { "type": "string" } }, "required": ["code"] }, + "list": { + "type": "array", + "items": { + "type": "object", + "properties": { + "descriptor": { "type": "object", "properties": { "code": { "type": "string" } }, "required": ["code"] }, + "value": { "type": "string" } + }, + "required": ["descriptor", "value"] + } + } + }, + "required": ["descriptor", "list"] + } + } + }, + "required": ["id", "price", "quantity", "fulfillment_ids", "tags"] + } + }, + "fulfillments": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { "type": "string" }, + "state": { "type": "object", "properties": { "descriptor": { "type": "object", "properties": { "code": { "type": "string" } }, "required": ["code"] } }, "required": ["descriptor"] }, + "type": { "type": "string" }, + "stops": { + "type": "array", + "items": { + "type": "object", + "properties": { + "contact": { "type": "object", "properties": { "phone": { "type": "string" }, "email": { "type": "string" } }, "required": ["phone", "email"] }, + "person": { "type": "object", "properties": { "name": { "type": "string" } }, "required": ["name"] } + }, + "required": ["contact", "person"] + } + } + }, + "required": ["id", "state", "type", "stops"] + } + }, + "billing": { + "type": "object", + "properties": { + "name": { "type": "string" }, + "address": { "type": "string" }, + "city": { "type": "object", "properties": { "name": { "type": "string" }, "code": { "type": "string" } }, "required": ["name", "code"] }, + "state": { "type": "object", "properties": { "name": { "type": "string" }, "code": { "type": "string" } }, "required": ["name", "code"] }, + "email": { "type": "string", "format": "email" }, + "phone": { "type": "string" } + }, + "required": ["name", "address", "city", "state", "email", "phone"] + }, + "quote": { + "type": "object", + "properties": { + "price": { "type": "object", "properties": { "currency": { "type": "string" }, "value": { "type": "string" } }, "required": ["currency", "value"] }, + "breakup": { + "type": "array", + "items": { + "type": "object", + "properties": { + "item": { "type": "object", "properties": { "id": { "type": "string" } }, "required": ["id"] }, + "title": { "type": "string" }, + "price": { "type": "object", "properties": { "currency": { "type": "string" }, "value": { "type": "string" } }, "required": ["currency", "value"] } + }, + "required": ["item", "title", "price"] + } + }, + "ttl": { "type": "string" } + }, + "required": ["price", "breakup", "ttl"] + }, + "payments": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { "type": "string" }, + "collected_by": { "type": "string" }, + "url": { "type": "string", "format": "uri" }, + "id": { "type": "string" }, + "params": { "type": "object", "properties": { "currency": { "type": "string" }, "transaction_id": { "type": "string" }, "amount": { "type": "string" } }, "required": ["currency", "transaction_id", "amount"] }, + "status": { "type": "string" } + }, + "required": ["type", "collected_by", "url", "id", "params", "status"] + } + }, + "created_at": { "type": "string", "format": "date-time" }, + "updated_at": { "type": "string", "format": "date-time" } + }, + "required": ["id", "status", "provider", "items", "fulfillments", "billing", "quote", "payments", "created_at", "updated_at"] + } + }, + "required": ["order"] + } + }, + "required": ["context", "message"] + } + \ No newline at end of file diff --git a/schema/FIS/Gift_Card/on_init.ts b/schema/FIS/Gift_Card/on_init.ts new file mode 100644 index 00000000..3b94dc74 --- /dev/null +++ b/schema/FIS/Gift_Card/on_init.ts @@ -0,0 +1,122 @@ +export const onInitSchemaFIS10 = { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "context": { + "type": "object", + "properties": { + "domain": { "type": "string" }, + "location": { + "type": "object", + "properties": { + "city": { "type": "object", "properties": { "code": { "type": "string" } }, "required": ["code"] }, + "country": { "type": "object", "properties": { "code": { "type": "string" } }, "required": ["code"] } + }, + "required": ["city", "country"] + }, + "action": { "type": "string", "enum": ["on_init"] }, + "version": { "type": "string" }, + "bap_id": { "type": "string" }, + "bap_uri": { "type": "string", "format": "uri" }, + "bpp_id": { "type": "string" }, + "bpp_uri": { "type": "string", "format": "uri" }, + "transaction_id": { "type": "string" }, + "message_id": { "type": "string" }, + "timestamp": { "type": "string", "format": "date-time" } + }, + "required": ["domain", "location", "action", "version", "bap_id", "bap_uri", "bpp_id", "bpp_uri", "transaction_id", "message_id", "timestamp"] + }, + "message": { + "type": "object", + "properties": { + "order": { + "type": "object", + "properties": { + "provider": { "type": "object", "properties": { "id": { "type": "string" } }, "required": ["id"] }, + "fulfillments": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { "type": "string" }, + "type": { "type": "string" }, + "stops": { + "type": "array", + "items": { + "type": "object", + "properties": { + "contact": { + "type": "object", + "properties": { + "phone": { "type": "string" }, + "email": { "type": "string", "format": "email" } + }, + "required": ["phone", "email"] + }, + "person": { "type": "object", "properties": { "name": { "type": "string" } }, "required": ["name"] } + }, + "required": ["contact", "person"] + } + } + }, + "required": ["id", "type", "stops"] + } + }, + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { "type": "string" }, + "price": { + "type": "object", + "properties": { + "currency": { "type": "string" }, + "value": { "type": "string" }, + "offered_value": { "type": "string" } + }, + "required": ["currency", "value", "offered_value"] + }, + "quantity": { + "type": "object", + "properties": { + "selected": { "type": "object", "properties": { "count": { "type": "integer" } }, "required": ["count"] } + }, + "required": ["selected"] + }, + "fulfillment_ids": { "type": "array", "items": { "type": "string" } }, + "tags": { + "type": "array", + "items": { + "type": "object", + "properties": { + "descriptor": { "type": "object", "properties": { "code": { "type": "string" } }, "required": ["code"] }, + "list": { + "type": "array", + "items": { + "type": "object", + "properties": { + "descriptor": { "type": "object", "properties": { "code": { "type": "string" } }, "required": ["code"] }, + "value": { "type": "string" } + }, + "required": ["descriptor", "value"] + } + } + }, + "required": ["descriptor", "list"] + } + } + }, + "required": ["id", "price", "quantity", "fulfillment_ids", "tags"] + } + } + }, + "required": ["provider", "fulfillments", "items"] + } + }, + "required": ["order"] + } + }, + "required": ["context", "message"] + } + \ No newline at end of file diff --git a/schema/FIS/Gift_Card/on_search.ts b/schema/FIS/Gift_Card/on_search.ts new file mode 100644 index 00000000..62386abd --- /dev/null +++ b/schema/FIS/Gift_Card/on_search.ts @@ -0,0 +1,105 @@ +export const onSearchSchemaFIS10 = { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "context": { + "type": "object", + "properties": { + "domain": { "type": "string", "enum": ["ONDC:FIS10"] }, + "location": { + "type": "object", + "properties": { + "city": { "type": "object", "properties": { "code": { "type": "string", "enum": ["std:080"] } }, "required": ["code"] }, + "country": { "type": "object", "properties": { "code": { "type": "string", "enum": ["IND"] } }, "required": ["code"] } + }, + "required": ["city", "country"] + }, + "action": { "type": "string", "enum": ["on_search"] }, + "version": { "type": "string", "enum": ["2.1.0"] }, + "bap_id": { "type": "string" }, + "bap_uri": { "type": "string", "format": "uri" }, + "bpp_id": { "type": "string" }, + "bpp_uri": { "type": "string", "format": "uri" }, + "transaction_id": { "type": "string", "format": "uuid" }, + "message_id": { "type": "string", "format": "uuid" }, + "timestamp": { "type": "string", "format": "date-time" } + }, + "required": ["domain", "location", "action", "version", "bap_id", "bap_uri", "bpp_id", "bpp_uri", "transaction_id", "message_id", "timestamp"] + }, + "message": { + "type": "object", + "properties": { + "catalog": { + "type": "object", + "properties": { + "fulfillments": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { "type": "string" }, + "type": { + "type": "string", + "enum": ["BPP_ONLINE_EMAIL_SMS", "BPP_ONLINE_EMAIL", "BPP_ONLINE_SMS", "BPP_OFFLINE", "BAP"] + } + }, + "required": ["id", "type"] + } + }, + "descriptor": { + "type": "object", + "properties": { + "name": { "type": "string" }, + "symbol": { "type": "string" }, + "short_desc": { "type": "string" }, + "long_desc": { "type": "string" }, + "images": { + "type": "array", + "items": { "type": "object", "properties": { "url": { "type": "string", "format": "uri" } }, "required": ["url"] } + } + }, + "required": ["name", "symbol", "short_desc", "long_desc", "images"] + }, + "providers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { "type": "string" }, + "ttl": { "type": "string" }, + "time": { + "type": "object", + "properties": { + "label": { "type": "string", "enum": ["ENABLE", "VALID"] }, + "timestamp": { "type": "string", "format": "date-time" } + }, + "required": ["label", "timestamp"] + }, + "categories": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { "type": "string" }, + "descriptor": { + "type": "object", + "properties": { "code": { "type": "string", "enum": ["CARD", "PROMO", "E_PAY", "E_RUPI"] } }, + "required": ["code"] + } + }, + "required": ["id", "descriptor"] + } + } + }, + "required": ["id", "ttl", "categories"] + } + } + }, + "required": ["fulfillments", "descriptor", "providers"] + } + }, + "required": ["catalog"] + } + }, + "required": ["context", "message"] + } \ No newline at end of file diff --git a/schema/FIS/Gift_Card/on_select.ts b/schema/FIS/Gift_Card/on_select.ts new file mode 100644 index 00000000..76538ec9 --- /dev/null +++ b/schema/FIS/Gift_Card/on_select.ts @@ -0,0 +1,272 @@ +export const onSelectSchemaFIS10 = { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "context": { + "type": "object", + "properties": { + "domain": { "type": "string", "enum": ["ONDC:FIS10"] }, + "location": { + "type": "object", + "properties": { + "city": { + "type": "object", + "properties": { + "code": { "type": "string", "enum": ["std:080"] } + }, + "required": ["code"] + }, + "country": { + "type": "object", + "properties": { + "code": { "type": "string", "enum": ["IND"] } + }, + "required": ["code"] + } + }, + "required": ["city", "country"] + }, + "action": { "type": "string", "enum": ["on_select"] }, + "version": { "type": "string", "enum": ["2.1.0"] }, + "bap_id": { "type": "string" }, + "bap_uri": { "type": "string", "format": "uri" }, + "bpp_id": { "type": "string" }, + "bpp_uri": { "type": "string", "format": "uri" }, + "transaction_id": { "type": "string", "format": "uuid" }, + "message_id": { "type": "string", "format": "uuid" }, + "timestamp": { "type": "string", "format": "date-time" } + }, + "required": [ + "domain", + "location", + "action", + "version", + "bap_id", + "bap_uri", + "bpp_id", + "bpp_uri", + "transaction_id", + "message_id", + "timestamp" + ] + }, + "message": { + "type": "object", + "properties": { + "order": { + "type": "object", + "properties": { + "provider": { + "type": "object", + "properties": { + "id": { "type": "string" } + }, + "required": ["id"] + }, + "fulfillments": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { "type": "string" }, + "type": { "type": "string", "enum": ["BPP_ONLINE_EMAIL_SMS", "BPP_ONLINE_PORTAL", "BPP_ONLINE_OTHERS"] } + }, + "required": ["id", "type"] + } + }, + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { "type": "string" }, + "price": { + "type": "object", + "properties": { + "currency": { "type": "string", "enum": ["INR"] }, + "value": { "type": "string", "pattern": "^[0-9]+(\\.[0-9]{1,2})?$" }, + "offered_value": { "type": "string", "pattern": "^[0-9]+(\\.[0-9]{1,2})?$" } + }, + "required": ["currency", "value", "offered_value"] + }, + "quantity": { + "type": "object", + "properties": { + "selected": { + "type": "object", + "properties": { + "count": { "type": "integer", "minimum": 1 } + }, + "required": ["count"] + } + }, + "required": ["selected"] + }, + "fulfillment_ids": { + "type": "array", + "items": { "type": "string" } + }, + "time": { + "type": "object", + "properties": { + "label": { "type": "string", "enum": ["VALIDITY"] }, + "duration": { "type": "string" }, + "timestamp": { "type": "string", "format": "date-time" } + }, + "required": ["label", "duration", "timestamp"] + }, + "tags": { + "type": "array", + "items": { + "type": "object", + "properties": { + "descriptor": { + "type": "object", + "properties": { + "code": { "type": "string" } + }, + "required": ["code"] + }, + "list": { + "type": "array", + "items": { + "type": "object", + "properties": { + "descriptor": { + "type": "object", + "properties": { + "code": { "type": "string" } + }, + "required": ["code"] + }, + "value": { "type": "string" } + }, + "required": ["descriptor"] + } + } + }, + "required": ["descriptor", "list"] + } + } + }, + "required": ["id", "price", "quantity", "fulfillment_ids", "time", "tags"] + } + }, + "offers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { "type": "string" }, + "item_ids": { + "type": "array", + "items": { "type": "string" } + }, + "tags": { + "type": "array", + "items": { + "type": "object", + "properties": { + "descriptor": { + "type": "object", + "properties": { + "code": { "type": "string" } + }, + "required": ["code"] + }, + "list": { + "type": "array", + "items": { + "type": "object", + "properties": { + "descriptor": { + "type": "object", + "properties": { + "code": { "type": "string" } + }, + "required": ["code"] + }, + "value": { "type": "string" } + }, + "required": ["descriptor", "value"] + } + } + }, + "required": ["descriptor", "list"] + } + } + }, + "required": ["id", "item_ids"] + } + }, + "quote": { + "type": "object", + "properties": { + "price": { + "type": "object", + "properties": { + "currency": { "type": "string", "enum": ["INR"] }, + "value": { "type": "string", "pattern": "^[0-9]+(\\.[0-9]{1,2})?$" } + }, + "required": ["currency", "value"] + }, + "breakup": { + "type": "array", + "items": { + "type": "object", + "properties": { + "item": { + "type": "object", + "properties": { + "id": { "type": "string" }, + "quantity": { + "type": "object", + "properties": { + "selected": { + "type": "object", + "properties": { + "count": { "type": "integer", "minimum": 1 } + }, + "required": ["count"] + } + }, + "required": ["selected"] + }, + "price": { + "type": "object", + "properties": { + "currency": { "type": "string", "enum": ["INR"] }, + "value": { "type": "string" }, + "offered_value": { "type": "string" } + }, + "required": ["currency", "value", "offered_value"] + } + } + }, + "title": { "type": "string" }, + "price": { + "type": "object", + "properties": { + "currency": { "type": "string", "enum": ["INR"] }, + "value": { "type": "string" } + }, + "required": ["currency", "value"] + } + }, + "required": ["item", "title", "price"] + } + }, + "ttl": { "type": "string" } + }, + "required": ["price", "breakup", "ttl"] + } + }, + "required": ["provider", "fulfillments", "items", "offers", "quote"] + } + }, + "required": ["order"] + } + }, + "required": ["context", "message"] + }; + \ No newline at end of file diff --git a/schema/FIS/Gift_Card/on_status.ts b/schema/FIS/Gift_Card/on_status.ts new file mode 100644 index 00000000..9ba03e73 --- /dev/null +++ b/schema/FIS/Gift_Card/on_status.ts @@ -0,0 +1,171 @@ +export const onStatusSchemaFIS10 = { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "context": { + "type": "object", + "properties": { + "domain": { "type": "string" }, + "location": { + "type": "object", + "properties": { + "city": { "type": "object", "properties": { "code": { "type": "string" } }, "required": ["code"] }, + "country": { "type": "object", "properties": { "code": { "type": "string" } }, "required": ["code"] } + }, + "required": ["city", "country"] + }, + "action": { "type": "string", "enum": ["on_status"] }, + "version": { "type": "string" }, + "bap_id": { "type": "string" }, + "bap_uri": { "type": "string", "format": "uri" }, + "bpp_id": { "type": "string" }, + "bpp_uri": { "type": "string", "format": "uri" }, + "transaction_id": { "type": "string" }, + "message_id": { "type": "string" }, + "timestamp": { "type": "string", "format": "date-time" } + }, + "required": ["domain", "location", "action", "version", "bap_id", "bap_uri", "bpp_id", "bpp_uri", "transaction_id", "message_id", "timestamp"] + }, + "message": { + "type": "object", + "properties": { + "order": { + "type": "object", + "properties": { + "id": { "type": "string" }, + "status": { "type": "string" }, + "provider": { "type": "object", "properties": { "id": { "type": "string" } }, "required": ["id"] }, + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { "type": "string" }, + "price": { + "type": "object", + "properties": { + "currency": { "type": "string" }, + "value": { "type": "string" }, + "offered_value": { "type": "string" } + }, + "required": ["currency", "value", "offered_value"] + }, + "quantity": { + "type": "object", + "properties": { + "selected": { "type": "object", "properties": { "count": { "type": "integer" } }, "required": ["count"] } + }, + "required": ["selected"] + }, + "fulfillment_ids": { "type": "array", "items": { "type": "string" } }, + "tags": { + "type": "array", + "items": { + "type": "object", + "properties": { + "descriptor": { "type": "object", "properties": { "code": { "type": "string" } }, "required": ["code"] }, + "list": { + "type": "array", + "items": { + "type": "object", + "properties": { + "descriptor": { "type": "object", "properties": { "code": { "type": "string" } }, "required": ["code"] }, + "value": { "type": "string" } + }, + "required": ["descriptor", "value"] + } + } + }, + "required": ["descriptor", "list"] + } + } + }, + "required": ["id", "price", "quantity", "fulfillment_ids"] + } + }, + "fulfillments": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { "type": "string" }, + "state": { + "type": "object", + "properties": { + "descriptor": { "type": "object", "properties": { "code": { "type": "string" } }, "required": ["code"] } + }, + "required": ["descriptor"] + }, + "type": { "type": "string" }, + "stops": { + "type": "array", + "items": { + "type": "object", + "properties": { + "contact": { + "type": "object", + "properties": { + "phone": { "type": "string" }, + "email": { "type": "string", "format": "email" } + }, + "required": ["phone", "email"] + }, + "person": { "type": "object", "properties": { "name": { "type": "string" } }, "required": ["name"] } + }, + "required": ["contact", "person"] + } + } + }, + "required": ["id", "state", "type", "stops"] + } + }, + "billing": { + "type": "object", + "properties": { + "name": { "type": "string" }, + "address": { "type": "string" }, + "city": { "type": "object", "properties": { "name": { "type": "string" }, "code": { "type": "string" } }, "required": ["name", "code"] }, + "state": { "type": "object", "properties": { "name": { "type": "string" }, "code": { "type": "string" } }, "required": ["name", "code"] }, + "email": { "type": "string", "format": "email" }, + "phone": { "type": "string" } + }, + "required": ["name", "address", "city", "state", "email", "phone"] + }, + "quote": { + "type": "object", + "properties": { + "price": { "type": "object", "properties": { "currency": { "type": "string" }, "value": { "type": "string" } }, "required": ["currency", "value"] }, + "breakup": { + "type": "array", + "items": { + "type": "object", + "properties": { + "item": { + "type": "object", + "properties": { + "id": { "type": "string" }, + "quantity": { "type": "object", "properties": { "selected": { "type": "object", "properties": { "count": { "type": "integer" } }, "required": ["count"] } }, "required": ["selected"] }, + "price": { "type": "object", "properties": { "currency": { "type": "string" }, "value": { "type": "string" } }, "required": ["currency", "value"] } + }, + "required": ["id", "price"] + }, + "title": { "type": "string" }, + "price": { "type": "object", "properties": { "currency": { "type": "string" }, "value": { "type": "string" } }, "required": ["currency", "value"] } + }, + "required": ["item", "title", "price"] + } + }, + "ttl": { "type": "string" } + }, + "required": ["price", "breakup", "ttl"] + } + }, + "required": ["id", "status", "provider", "items", "fulfillments", "billing", "quote"] + } + }, + "required": ["order"] + } + }, + "required": ["context", "message"] + } + \ No newline at end of file diff --git a/schema/FIS/Gift_Card/on_update.ts b/schema/FIS/Gift_Card/on_update.ts new file mode 100644 index 00000000..8385f221 --- /dev/null +++ b/schema/FIS/Gift_Card/on_update.ts @@ -0,0 +1,171 @@ +export const onUpdateFIS10 = { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "context": { + "type": "object", + "properties": { + "domain": { "type": "string" }, + "location": { + "type": "object", + "properties": { + "city": { "type": "object", "properties": { "code": { "type": "string" } }, "required": ["code"] }, + "country": { "type": "object", "properties": { "code": { "type": "string" } }, "required": ["code"] } + }, + "required": ["city", "country"] + }, + "action": { "type": "string", "enum": ["on_update"] }, + "version": { "type": "string" }, + "bap_id": { "type": "string" }, + "bap_uri": { "type": "string", "format": "uri" }, + "bpp_id": { "type": "string" }, + "bpp_uri": { "type": "string", "format": "uri" }, + "transaction_id": { "type": "string" }, + "message_id": { "type": "string" }, + "timestamp": { "type": "string", "format": "date-time" } + }, + "required": ["domain", "location", "action", "version", "bap_id", "bap_uri", "bpp_id", "bpp_uri", "transaction_id", "message_id", "timestamp"] + }, + "message": { + "type": "object", + "properties": { + "order": { + "type": "object", + "properties": { + "id": { "type": "string" }, + "status": { "type": "string" }, + "provider": { "type": "object", "properties": { "id": { "type": "string" } }, "required": ["id"] }, + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { "type": "string" }, + "price": { + "type": "object", + "properties": { + "currency": { "type": "string" }, + "value": { "type": "string" }, + "offered_value": { "type": "string" } + }, + "required": ["currency", "value", "offered_value"] + }, + "quantity": { + "type": "object", + "properties": { + "selected": { "type": "object", "properties": { "count": { "type": "integer" } }, "required": ["count"] } + }, + "required": ["selected"] + }, + "fulfillment_ids": { "type": "array", "items": { "type": "string" } }, + "tags": { + "type": "array", + "items": { + "type": "object", + "properties": { + "descriptor": { "type": "object", "properties": { "code": { "type": "string" } }, "required": ["code"] }, + "list": { + "type": "array", + "items": { + "type": "object", + "properties": { + "descriptor": { "type": "object", "properties": { "code": { "type": "string" } }, "required": ["code"] }, + "value": { "type": "string" } + }, + "required": ["descriptor", "value"] + } + } + }, + "required": ["descriptor", "list"] + } + } + }, + "required": ["id", "price", "quantity", "fulfillment_ids"] + } + }, + "fulfillments": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { "type": "string" }, + "state": { + "type": "object", + "properties": { + "descriptor": { "type": "object", "properties": { "code": { "type": "string" } }, "required": ["code"] } + }, + "required": ["descriptor"] + }, + "type": { "type": "string" }, + "stops": { + "type": "array", + "items": { + "type": "object", + "properties": { + "contact": { + "type": "object", + "properties": { + "phone": { "type": "string" }, + "email": { "type": "string", "format": "email" } + }, + "required": ["phone", "email"] + }, + "person": { "type": "object", "properties": { "name": { "type": "string" } }, "required": ["name"] }, + "authorization": { + "type": "object", + "properties": { + "type": { "type": "string", "enum": ["CODE", "CODE_PIN"] }, + "token": { "type": "string" } + }, + "required": ["type", "token"] + } + }, + "required": ["contact", "person", "authorization"] + } + } + }, + "required": ["id", "state", "type", "stops"] + } + }, + "billing": { + "type": "object", + "properties": { + "name": { "type": "string" }, + "address": { "type": "string" }, + "city": { "type": "object", "properties": { "name": { "type": "string" }, "code": { "type": "string" } }, "required": ["name", "code"] }, + "state": { "type": "object", "properties": { "name": { "type": "string" }, "code": { "type": "string" } }, "required": ["name", "code"] }, + "email": { "type": "string", "format": "email" }, + "phone": { "type": "string" } + }, + "required": ["name", "address", "city", "state", "email", "phone"] + }, + "quote": { + "type": "object", + "properties": { + "price": { "type": "object", "properties": { "currency": { "type": "string" }, "value": { "type": "string" } }, "required": ["currency", "value"] }, + "breakup": { + "type": "array", + "items": { + "type": "object", + "properties": { + "item": { "type": "object", "properties": { "id": { "type": "string" } }, "required": ["id"] }, + "title": { "type": "string" }, + "price": { "type": "object", "properties": { "currency": { "type": "string" }, "value": { "type": "string" } }, "required": ["currency", "value"] } + }, + "required": ["item", "title", "price"] + } + }, + "ttl": { "type": "string" } + }, + "required": ["price", "breakup", "ttl"] + } + }, + "required": ["id", "status", "provider", "items", "fulfillments", "billing", "quote"] + } + }, + "required": ["order"] + } + }, + "required": ["context", "message"] + } + \ No newline at end of file diff --git a/schema/FIS/Gift_Card/search.ts b/schema/FIS/Gift_Card/search.ts new file mode 100644 index 00000000..441fbcb9 --- /dev/null +++ b/schema/FIS/Gift_Card/search.ts @@ -0,0 +1,118 @@ +export const searchSchemaFIS10 = { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "context": { + "type": "object", + "properties": { + "domain": { "type": "string", "enum": ["ONDC:FIS10"] }, + "location": { + "type": "object", + "properties": { + "city": { + "type": "object", + "properties": { + "code": { "type": "string", "enum": ["std:080"] } + }, + "required": ["code"] + }, + "country": { + "type": "object", + "properties": { + "code": { "type": "string", "enum": ["IND"] } + }, + "required": ["code"] + } + }, + "required": ["city", "country"] + }, + "action": { "type": "string", "enum": ["on_search"] }, + "version": { "type": "string", "enum": ["2.1.0"] }, + "bap_id": { "type": "string" }, + "bap_uri": { "type": "string", "format": "uri" }, + "transaction_id": { "type": "string", "format": "uuid" }, + "message_id": { "type": "string", "format": "uuid" }, + "timestamp": { "type": "string", "format": "date-time" }, + "ttl": { "type": "string" } + }, + "required": [ + "domain", + "location", + "action", + "version", + "bap_id", + "bap_uri", + "transaction_id", + "message_id", + "timestamp", + "ttl" + ] + }, + "message": { + "type": "object", + "properties": { + "intent": { + "type": "object", + "properties": { + "category": { + "type": "object", + "properties": { + "descriptor": { + "type": "object", + "properties": { + "code": { "type": "string", "enum": ["CARD", "PROMO", "E_PAY", "E_RUPI"] } + }, + "required": ["code"] + } + }, + "required": ["descriptor"] + }, + "payment": { + "type": "object", + "properties": { + "tags": { + "type": "array", + "items": { + "type": "object", + "properties": { + "descriptor": { + "type": "object", + "properties": { + "code": { "type": "string", "enum": ["BRAND_DETAILS", "VARIANT_FIELDS", "ITEM_DETAILS"] } + }, + "required": ["code"] + }, + "list": { + "type": "array", + "items": { + "type": "object", + "properties": { + "descriptor": { + "type": "object", + "properties": { + "code": { "type": "string", "enum": ["BRAND_NAME", "OCCASION", "TERMS_CONDITION", "CATEGORY", "items.price.value"] } + }, + "required": ["code"] + }, + "value": { "type": "string" } + }, + "required": ["descriptor", "value"] + } + } + }, + "required": ["descriptor", "list"] + } + } + }, + "required": ["tags"] + } + }, + "required": ["category", "payment"] + } + }, + "required": ["intent"] + } + }, + "required": ["context", "message"] + }; + \ No newline at end of file diff --git a/schema/FIS/Gift_Card/select.ts b/schema/FIS/Gift_Card/select.ts new file mode 100644 index 00000000..10ce6cec --- /dev/null +++ b/schema/FIS/Gift_Card/select.ts @@ -0,0 +1,132 @@ +export const selectSchemaFIS10 = { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "context": { + "type": "object", + "properties": { + "domain": { "type": "string", "enum": ["ONDC:FIS10"] }, + "location": { + "type": "object", + "properties": { + "city": { + "type": "object", + "properties": { + "code": { "type": "string", "enum": ["std:080"] } + }, + "required": ["code"] + }, + "country": { + "type": "object", + "properties": { + "code": { "type": "string", "enum": ["IND"] } + }, + "required": ["code"] + } + }, + "required": ["city", "country"] + }, + "action": { "type": "string", "enum": ["select"] }, + "version": { "type": "string", "enum": ["2.1.0"] }, + "bap_id": { "type": "string" }, + "bap_uri": { "type": "string", "format": "uri" }, + "bpp_id": { "type": "string" }, + "bpp_uri": { "type": "string", "format": "uri" }, + "transaction_id": { "type": "string", "format": "uuid" }, + "message_id": { "type": "string", "format": "uuid" }, + "timestamp": { "type": "string", "format": "date-time" }, + "ttl": { "type": "string" } + }, + "required": [ + "domain", + "location", + "action", + "version", + "bap_id", + "bap_uri", + "bpp_id", + "bpp_uri", + "transaction_id", + "message_id", + "timestamp", + "ttl" + ] + }, + "message": { + "type": "object", + "properties": { + "order": { + "type": "object", + "properties": { + "provider": { + "type": "object", + "properties": { + "id": { "type": "string" } + }, + "required": ["id"] + }, + "fulfillments": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { "type": "string", "enum": ["BPP_ONLINE_EMAIL_SMS", "BPP_ONLINE_PORTAL", "BPP_ONLINE_OTHERS"] } + }, + "required": ["type"] + } + }, + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { "type": "string" }, + "quantity": { + "type": "object", + "properties": { + "selected": { + "type": "object", + "properties": { + "count": { "type": "integer", "minimum": 1 } + }, + "required": ["count"] + } + }, + "required": ["selected"] + }, + "price": { + "type": "object", + "properties": { + "currency": { "type": "string", "enum": ["INR"] }, + "offered_value": { "type": "string", "pattern": "^[0-9]+(\\.[0-9]{1,2})?$" } + }, + "required": ["currency", "offered_value"] + } + }, + "required": ["id", "quantity"] + } + }, + "offers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { "type": "string" }, + "item_ids": { + "type": "array", + "items": { "type": "string" } + } + }, + "required": ["id", "item_ids"] + } + } + }, + "required": ["provider", "fulfillments", "items", "offers"] + } + }, + "required": ["order"] + } + }, + "required": ["context", "message"] + }; + \ No newline at end of file diff --git a/schema/FIS/Gift_Card/status.ts b/schema/FIS/Gift_Card/status.ts new file mode 100644 index 00000000..02a48245 --- /dev/null +++ b/schema/FIS/Gift_Card/status.ts @@ -0,0 +1,40 @@ +export const statusSchemaFIS10 = { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "context": { + "type": "object", + "properties": { + "domain": { "type": "string" }, + "location": { + "type": "object", + "properties": { + "city": { "type": "object", "properties": { "code": { "type": "string" } }, "required": ["code"] }, + "country": { "type": "object", "properties": { "code": { "type": "string" } }, "required": ["code"] } + }, + "required": ["city", "country"] + }, + "action": { "type": "string", "enum": ["status"] }, + "version": { "type": "string" }, + "bap_id": { "type": "string" }, + "bap_uri": { "type": "string", "format": "uri" }, + "bpp_id": { "type": "string" }, + "bpp_uri": { "type": "string", "format": "uri" }, + "transaction_id": { "type": "string" }, + "message_id": { "type": "string" }, + "timestamp": { "type": "string", "format": "date-time" }, + "ttl": { "type": "string" } + }, + "required": ["domain", "location", "action", "version", "bap_id", "bap_uri", "bpp_id", "bpp_uri", "transaction_id", "message_id", "timestamp", "ttl"] + }, + "message": { + "type": "object", + "properties": { + "order_id": { "type": "string" } + }, + "required": ["order_id"] + } + }, + "required": ["context", "message"] + } + \ No newline at end of file diff --git a/shared/schemaValidator.ts b/shared/schemaValidator.ts index 564c4a39..339adb30 100644 --- a/shared/schemaValidator.ts +++ b/shared/schemaValidator.ts @@ -87,6 +87,18 @@ import {confirmFIS14Schema} from '../schema/FIS/Mutual_Funds/confirm' import {onConfirmFIS14Schema} from '../schema/FIS/Mutual_Funds/on_confirm' // import { onStatusFIS14Schema } from '../schema/FIS/Mutual_Funds/on_status' import { onUpdateFIS14Schema } from '../schema/FIS/Mutual_Funds/on_update' +import { searchSchemaFIS10 } from '../schema/FIS/Gift_Card/search' +import { selectSchemaFIS10 } from '../schema/FIS/Gift_Card/select' +import { onSelectSchemaFIS10 } from '../schema/FIS/Gift_Card/on_select' +import { InitSchemaFIS10 } from '../schema/FIS/Gift_Card/init' +import { onInitSchemaFIS10 } from '../schema/FIS/Gift_Card/on_init' +import { confirmSchemaFIS10 } from '../schema/FIS/Gift_Card/confirm' +import { onConfirmSchemaFIS10 } from '../schema/FIS/Gift_Card/on_confirm' +import { statusSchemaFIS10 } from '../schema/FIS/Gift_Card/status' +import { onStatusSchemaFIS10 } from '../schema/FIS/Gift_Card/on_status' +import { onSearchSchemaFIS10 } from '../schema/FIS/Gift_Card/on_search' +import { onUpdateFIS10 } from '../schema/FIS/Gift_Card/on_update' +import { onCancelSchemaFIS10 } from '../schema/FIS/Gift_Card/on_cancel' const ajv = new Ajv({ allErrors: true, @@ -1154,6 +1166,57 @@ const validate_schema_on_cancel_TRV12_for_json = (data: any) => { const error_list = validate_schema(data, onCancelSchemaTRV_12) return formatted_error(error_list) } +// FIS10 +const validate_schema_search_FIS10_for_json = (data: any) => { + const error_list = validate_schema(data, searchSchemaFIS10) + return formatted_error(error_list) +} +const validate_schema_on_search_FIS10_for_json = (data: any) => { + const error_list = validate_schema(data, onSearchSchemaFIS10) + return formatted_error(error_list) +} + +const validate_schema_select_FIS10_for_json = (data: any) => { + const error_list = validate_schema(data, selectSchemaFIS10) + return formatted_error(error_list) +} +const validate_schema_on_select_FIS10_for_json = (data: any) => { + const error_list = validate_schema(data, onSelectSchemaFIS10) + return formatted_error(error_list) +} +const validate_schema_init_FIS10_for_json = (data: any) => { + const error_list = validate_schema(data, InitSchemaFIS10) + return formatted_error(error_list) +} +const validate_schema_on_init_FIS10_for_json = (data: any) => { + const error_list = validate_schema(data, onInitSchemaFIS10) + return formatted_error(error_list) +} +const validate_schema_confirm_FIS10_for_json = (data: any) => { + const error_list = validate_schema(data, confirmSchemaFIS10) + return formatted_error(error_list) +} +const validate_schema_on_confirm_FIS10_for_json = (data: any) => { + const error_list = validate_schema(data, onConfirmSchemaFIS10) + return formatted_error(error_list) +} +const validate_schema_status_FIS10_for_json = (data: any) => { + const error_list = validate_schema(data, statusSchemaFIS10) + return formatted_error(error_list) +} +const validate_schema_on_status_FIS10_for_json = (data: any) => { + const error_list = validate_schema(data, onStatusSchemaFIS10) + return formatted_error(error_list) +} +const validate_schema_on_update_FIS10_for_json = (data: any) => { + const error_list = validate_schema(data, onUpdateFIS10) + return formatted_error(error_list) +} +const validate_schema_on_cancel_FIS10_for_json = (data: any) => { + const error_list = validate_schema(data, onCancelSchemaFIS10) + return formatted_error(error_list) +} + //________________________________________________________________________________________________ @@ -1575,6 +1638,19 @@ export default { // validate_schema_on_status_FIS14_for_json , validate_schema_on_update_FIS14_for_json, + // FIS10- Gift Card + validate_schema_search_FIS10_for_json, + validate_schema_on_search_FIS10_for_json, + validate_schema_select_FIS10_for_json, + validate_schema_on_select_FIS10_for_json, + validate_schema_init_FIS10_for_json, + validate_schema_on_init_FIS10_for_json, + validate_schema_confirm_FIS10_for_json, + validate_schema_on_confirm_FIS10_for_json, + validate_schema_status_FIS10_for_json, + validate_schema_on_status_FIS10_for_json, + validate_schema_on_update_FIS10_for_json, + validate_schema_on_cancel_FIS10_for_json, ...TRVValidator, ...FISValidator, } diff --git a/utils/FIS/FIS10/confirm.ts b/utils/FIS/FIS10/confirm.ts index f48026ef..70332b7f 100644 --- a/utils/FIS/FIS10/confirm.ts +++ b/utils/FIS/FIS10/confirm.ts @@ -27,7 +27,7 @@ export const checkConfirm = (data: any, msgIdSet: any) => { return { missingFields: '/context, /message, /order or /message/order is missing or empty' } } - const schemaValidation = validateSchema('FIS', constants.CONFIRM, data) + const schemaValidation = validateSchema('FIS10', constants.CONFIRM, data) const contextRes: any = validateContext(context, msgIdSet, constants.ON_INIT, constants.CONFIRM) if (schemaValidation !== 'error') { diff --git a/utils/FIS/FIS10/init.ts b/utils/FIS/FIS10/init.ts index e0833f67..a35fc316 100644 --- a/utils/FIS/FIS10/init.ts +++ b/utils/FIS/FIS10/init.ts @@ -17,7 +17,7 @@ export const checkInit = (data: any, msgIdSet: any) => { return { missingFields: '/context, /message, /order or /message/order is missing or empty' } } - const schemaValidation = validateSchema('FIS', constants.INIT, data) + const schemaValidation = validateSchema('FIS10', constants.INIT, data) const contextRes: any = validateContext(context, msgIdSet, constants.ON_SELECT, constants.INIT) if (schemaValidation !== 'error') { diff --git a/utils/FIS/FIS10/onCancel.ts b/utils/FIS/FIS10/onCancel.ts index b7716da9..d0ee9d4e 100644 --- a/utils/FIS/FIS10/onCancel.ts +++ b/utils/FIS/FIS10/onCancel.ts @@ -26,7 +26,7 @@ export const checkOnCancel = (data: any, msgIdSet: any) => { return { missingFields: '/context, /message, /order or /message/order is missing or empty' } } - const schemaValidation = validateSchema('FIS', constants.ON_CANCEL, data) + const schemaValidation = validateSchema('FIS10', constants.ON_CANCEL, data) const contextRes: any = validateContext(context, msgIdSet, constants.CANCEL, constants.ON_CANCEL) const errorObj: any = {} diff --git a/utils/FIS/FIS10/onConfirm.ts b/utils/FIS/FIS10/onConfirm.ts index bba156a9..88dae90d 100644 --- a/utils/FIS/FIS10/onConfirm.ts +++ b/utils/FIS/FIS10/onConfirm.ts @@ -26,7 +26,7 @@ export const checkOnConfirm = (data: any, msgIdSet: any) => { return { missingFields: '/context, /message, /order or /message/order is missing or empty' } } - const schemaValidation = validateSchema('FIS', constants.ON_CONFIRM, data) + const schemaValidation = validateSchema('FIS10', constants.ON_CONFIRM, data) const contextRes: any = validateContext(context, msgIdSet, constants.CONFIRM, constants.ON_CONFIRM) const errorObj: any = {} diff --git a/utils/FIS/FIS10/onInit.ts b/utils/FIS/FIS10/onInit.ts index 24972946..dc52d18c 100644 --- a/utils/FIS/FIS10/onInit.ts +++ b/utils/FIS/FIS10/onInit.ts @@ -26,7 +26,7 @@ export const checkOnInit = (data: any, msgIdSet: any) => { return { missingFields: '/context, /message, /order or /message/order is missing or empty' } } - const schemaValidation = validateSchema('FIS', constants.ON_INIT, data) + const schemaValidation = validateSchema('FIS10', constants.ON_INIT, data) const contextRes: any = validateContext(context, msgIdSet, constants.INIT, constants.ON_INIT) const errorObj: any = {} diff --git a/utils/FIS/FIS10/onSearch.ts b/utils/FIS/FIS10/onSearch.ts index dab84722..3868d9db 100644 --- a/utils/FIS/FIS10/onSearch.ts +++ b/utils/FIS/FIS10/onSearch.ts @@ -20,7 +20,7 @@ export const checkOnSearch = (data: any, msgIdSet: any, flow: string, action: st return { missingFields: '/context, /message, /catalog or /message/catalog is missing or empty' } } - const schemaValidation = validateSchema('FIS', constants.ON_SEARCH, data) + const schemaValidation = validateSchema('FIS10', constants.ON_SEARCH, data) const contextRes: any = validateContext(context, msgIdSet, constants.SEARCH, constants.ON_SEARCH) const errorObj: any = {} diff --git a/utils/FIS/FIS10/onSelect.ts b/utils/FIS/FIS10/onSelect.ts index 814544db..177fb057 100644 --- a/utils/FIS/FIS10/onSelect.ts +++ b/utils/FIS/FIS10/onSelect.ts @@ -21,7 +21,7 @@ export const checkOnSelect = (data: any, msgIdSet: any, flow: string) => { return { missingFields: '/context, /message, /order or /message/order is missing or empty' } } - const schemaValidation = validateSchema('FIS', constants.ON_SELECT, data) + const schemaValidation = validateSchema('FIS10', constants.ON_SELECT, data) const contextRes: any = validateContext(context, msgIdSet, constants.SELECT, constants.ON_SELECT) const errorObj: any = {} diff --git a/utils/FIS/FIS10/onStatus.ts b/utils/FIS/FIS10/onStatus.ts index 014bd7c6..694af4c6 100644 --- a/utils/FIS/FIS10/onStatus.ts +++ b/utils/FIS/FIS10/onStatus.ts @@ -26,7 +26,7 @@ export const checkOnStatus = (data: any, msgIdSet: any) => { return { missingFields: '/context, /message, /order or /message/order is missing or empty' } } - const schemaValidation = validateSchema('FIS', constants.ON_STATUS, data) + const schemaValidation = validateSchema('FIS10', constants.ON_STATUS, data) const contextRes: any = validateContext(context, msgIdSet, constants.STATUS, constants.ON_STATUS) const errorObj: any = {} diff --git a/utils/FIS/FIS10/onUpdate.ts b/utils/FIS/FIS10/onUpdate.ts index 8cf56674..9c27d95d 100644 --- a/utils/FIS/FIS10/onUpdate.ts +++ b/utils/FIS/FIS10/onUpdate.ts @@ -26,7 +26,7 @@ export const checkOnUpdate = (data: any, msgIdSet: any) => { return { missingFields: '/context, /message, /order or /message/order is missing or empty' } } - const schemaValidation = validateSchema('FIS', constants.ON_UPDATE, data) + const schemaValidation = validateSchema('FIS10', constants.ON_UPDATE, data) const contextRes: any = validateContext(context, msgIdSet, constants.UPDATE, constants.ON_UPDATE) const errorObj: any = {} diff --git a/utils/FIS/FIS10/search.ts b/utils/FIS/FIS10/search.ts index 7e81d28a..f163c01d 100644 --- a/utils/FIS/FIS10/search.ts +++ b/utils/FIS/FIS10/search.ts @@ -26,7 +26,7 @@ export const search = (data: any, msgIdSet: any) => { msgIdSet.add(context.message_id) // validate schema - const schemaValidation = validateSchema('FIS', constants.SEARCH, data) + const schemaValidation = validateSchema('FIS10', constants.SEARCH, data) if (schemaValidation !== 'error') { Object.assign(errorObj, schemaValidation) } diff --git a/utils/FIS/FIS10/select.ts b/utils/FIS/FIS10/select.ts index 4162cf14..c181f984 100644 --- a/utils/FIS/FIS10/select.ts +++ b/utils/FIS/FIS10/select.ts @@ -16,7 +16,7 @@ export const checkSelect = (data: any, msgIdSet: any) => { return { missingFields: '/context, /message, /order or /message/order is missing or empty' } } - const schemaValidation = validateSchema('FIS', constants.SELECT, data) + const schemaValidation = validateSchema('FIS10', constants.SELECT, data) const contextRes: any = validateContext(context, msgIdSet, constants.ON_SEARCH, constants.SELECT) const errorObj: any = {} diff --git a/utils/FIS/FIS10/status.ts b/utils/FIS/FIS10/status.ts index c0565684..5b913f60 100644 --- a/utils/FIS/FIS10/status.ts +++ b/utils/FIS/FIS10/status.ts @@ -18,7 +18,7 @@ export const checkStatus = (data: any, msgIdSet: any) => { return { missingFields: '/context, /message, /order or /message/order is missing or empty' } } - const schemaValidation = validateSchema('FIS', constants.STATUS, data) + const schemaValidation = validateSchema('FIS10', constants.STATUS, data) const contextRes: any = validateContext(context, msgIdSet, constants.ON_CONFIRM, constants.STATUS) if (schemaValidation !== 'error') { diff --git a/utils/index.ts b/utils/index.ts index 125ba632..65eb11f8 100644 --- a/utils/index.ts +++ b/utils/index.ts @@ -215,6 +215,7 @@ export const checkMetroContext = ( const validate_schema_for_retail_json = (vertical: string, api: string, data: any) => { console.log(`+++++++++ validate_schema_${api}_${vertical}_for_json`) const res = (schemaValidator as any)[`validate_schema_${api}_${vertical}_for_json`](data) + // validate_schema_search_FIS10_for_json return res }