diff --git a/api-service/src/config/build.yaml b/api-service/src/config/build.yaml index d6059658..5454c7c9 100644 --- a/api-service/src/config/build.yaml +++ b/api-service/src/config/build.yaml @@ -19324,11 +19324,8 @@ x-validations: - _NAME_: ON_SEARCH_ITEMS_PAGE_1 action: - on_search - _SCOPE_: $.message.catalog.tags[?(@.descriptor.code=='PAGINATION')] - subTags: $.list[*].descriptor.code - var_page: - - CURRENT_PAGE_NUMBER - _CONTINUE_: '!(var_page all in subTags)' + var_items_exist: $.message.catalog.providers[*].items[*].id + _CONTINUE_: '!(var_items_exist are present)' _RETURN_: - _NAME_: REQUIRED_ITEMS _RETURN_: @@ -19580,6 +19577,7 @@ x-validations: _RETURN_: attr are present - _NAME_: REQUIRED_ORDER_FULFILLMENT_TIME attr: $.message.order.fulfillments[*].stops[*].time.timestamp + _CONTINUE_: '!(attr are present)' _RETURN_: attr are present - _NAME_: ENUM_FULFILLMENT _RETURN_: @@ -19592,6 +19590,7 @@ x-validations: attr: $.message.order.fulfillments[*].stops[*].time.timestamp reg: - ^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\.\\d{3}Z$ + _CONTINUE_: '!(attr are present)' _RETURN_: attr follow regex reg - _NAME_: SELECT_PROVIDER action: @@ -20496,6 +20495,7 @@ x-validations: _RETURN_: attr are present - _NAME_: REQUIRED_ORDER_FULFILLMENT_TIME attr: $.message.order.fulfillments[*].stops[*].time.timestamp + _CONTINUE_: '!(attr are present)' _RETURN_: attr are present - _NAME_: REQUIRED_FULFILMENT_STATE attr: $.message.order.fulfillments[*].state.descriptor.code @@ -20524,6 +20524,7 @@ x-validations: attr: $.message.order.fulfillments[*].stops[*].time.timestamp reg: - ^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\.\\d{3}Z$ + _CONTINUE_: '!(attr are present)' _RETURN_: attr follow regex reg - _NAME_: REQUIRED_FULFILMENT_STATE attr: $.message.order.fulfillments[*].state.descriptor.code @@ -20709,6 +20710,7 @@ x-validations: _RETURN_: attr are present - _NAME_: REQUIRED_ORDER_FULFILLMENT_TIME attr: $.message.order.fulfillments[*].stops[*].time.timestamp + _CONTINUE_: '!(attr are present)' _RETURN_: attr are present - _NAME_: REQUIRED_FULFILMENT_STATE attr: $.message.order.fulfillments[*].state.descriptor.code @@ -20737,6 +20739,7 @@ x-validations: attr: $.message.order.fulfillments[*].stops[*].time.timestamp reg: - ^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\.\\d{3}Z$ + _CONTINUE_: '!(attr are present)' _RETURN_: attr follow regex reg - _NAME_: REQUIRED_FULFILMENT_STATE attr: $.message.order.fulfillments[*].state.descriptor.code diff --git a/mock-service/src/config/mock-config/TRV14/2.0.0/on_select/data.json b/mock-service/src/config/mock-config/TRV14/2.0.0/on_select/data.json deleted file mode 100644 index e3ef2e21..00000000 --- a/mock-service/src/config/mock-config/TRV14/2.0.0/on_select/data.json +++ /dev/null @@ -1,624 +0,0 @@ -{ - "items": [ - { - "id": "I0", - "descriptor": { - "name": "Parent Item for Culture & Heritage", - "code": "ABSTRACT", - "short_desc": "Ticket for Qutab Minar", - "long_desc": "This ticket grants entry to the Qutab Minar.", - "images": [ - { - "url": "https://api.unreserved-entry-pass.com/sites/default/files/event/logo/event_logo_2.png", - "size_type": "xs" - } - ] - }, - "location_ids": [ - "L1" - ], - "category_ids": [ - "C2" - ], - "time": { - "label": "VALIDITY", - "duration": "P2D" - }, - "fulfillment_ids": [ - "F1" - ], - "tags": [ - { - "descriptor": { - "code": "INCLUSIONS" - }, - "list": [ - { - "value": "water" - } - ] - }, - { - "descriptor": { - "code": "EXCLUSIONS" - }, - "list": [ - { - "value": "out side food" - }, - { - "value": "photography" - } - ] - }, - { - "descriptor": { - "code": "INFO", - "name": "Info" - }, - "display": false, - "list": [ - { - "descriptor": { - "code": "TNC_LINK", - "name": "Terms & Conditions" - }, - "value": "https://api.unreserved-entry-pass/beckn/tnc.html" - } - ] - } - ] - }, - { - "id": "I1", - "descriptor": { - "name": "Adult-Ticket Culture & Heritage Item", - "code": "ENTRY_PASS", - "short_desc": "Ticket for Qutab Minar", - "long_desc": "This ticket grants entry to the Qutab Minar.", - "images": [ - { - "url": "https://api.unreserved-entry-pass.com/sites/default/files/event/logo/event_logo_2.png", - "size_type": "xs" - } - ] - }, - "parent_item_id": "I0", - "location_ids": [ - "L1" - ], - "category_ids": [ - "C2" - ], - "price": { - "currency": "INR", - "value": "350" - }, - "quantity": { - "selected": { - "count": 1 - } - }, - "time": { - "label": "VALIDITY", - "duration": "P2D" - }, - "fulfillment_ids": [ - "F1" - ], - "add_ons": [ - { - "id": "A1", - "descriptor": { - "name": "Audio Assistance" - }, - "quantity": { - "selected": { - "count": 1 - } - }, - "price": { - "value": "100", - "currency": "INR" - } - } - ], - "tags": [ - { - "descriptor": { - "code": "FARE_POLICY" - }, - "list": [ - { - "descriptor": { - "code": "MIN_AGE" - }, - "value": "1" - }, - { - "descriptor": { - "code": "MAX_AGE" - }, - "value": "70" - }, - { - "descriptor": { - "code": "GENDER" - }, - "value": "MALE" - }, - { - "descriptor": { - "code": "NATIONALITY" - }, - "value": "INDIAN" - }, - { - "descriptor": { - "code": "ADDITIONAL_DETAILS_REQUIRED" - }, - "value": "TRUE" - } - ] - }, - { - "descriptor": { - "code": "INCLUSIONS" - }, - "list": [ - { - "value": "water" - }, - { - "value": "guide_tour" - } - ] - }, - { - "descriptor": { - "code": "EXCLUSIONS" - }, - "list": [ - { - "value": "out side food" - }, - { - "value": "photography" - } - ] - }, - { - "descriptor": { - "code": "INFO", - "name": "Info" - }, - "display": false, - "list": [ - { - "descriptor": { - "code": "TNC_LINK", - "name": "Terms & Conditions" - }, - "value": "https://api.unreserved-entry-pass/beckn/tnc.html" - } - ] - } - ], - "xinput": { - "head": { - "descriptor": { - "name": "Additional Details" - }, - "index": { - "min": 0, - "cur": 0, - "max": 0 - }, - "headings": [ - "ADDITIONAL_DETAILS" - ] - }, - "form": { - "id": "first_form_testing", - "mime_type": "text/html", - "url": "https://api.unreserved-entry-pass.com/xinput/additonal-details/first_form_testing", - "resubmit": false, - "multiple_submissions": false - }, - "required": true - } - }, - { - "id": "I2", - "descriptor": { - "name": "Child-Ticket Culture & Heritage Item", - "code": "ENTRY_PASS", - "short_desc": "Ticket for Qutab Minar", - "long_desc": "This ticket grants entry to the Qutab Minar.", - "images": [ - { - "url": "https://api.unreserved-entry-pass.com/sites/default/files/event/logo/event_logo_2.png", - "size_type": "xs" - } - ] - }, - "parent_item_id": "I0", - "location_ids": [ - "L1" - ], - "category_ids": [ - "C2" - ], - "price": { - "currency": "INR", - "value": "150" - }, - "quantity": { - "selected": { - "count": 1 - } - }, - "time": { - "label": "VALIDITY", - "duration": "P2D" - }, - "fulfillment_ids": [ - "F1" - ], - "add_ons": [ - { - "id": "A1", - "descriptor": { - "name": "Audio Assistance" - }, - "quantity": { - "selected": { - "count": 1 - } - }, - "price": { - "value": "100", - "currency": "INR" - } - } - ], - "xinput": { - "head": { - "descriptor": { - "name": "Additional Details" - }, - "index": { - "min": 0, - "cur": 0, - "max": 0 - }, - "headings": [ - "ADDITIONAL_DETAILS" - ] - }, - "form": { - "id": "F02", - "mime_type": "text/html", - "url": "https://api.unreserved-entry-pass.com/xinput/additonal-details/F02", - "resubmit": false, - "multiple_submissions": false - }, - "required": true - }, - "tags": [ - { - "descriptor": { - "code": "FARE_POLICY" - }, - "list": [ - { - "descriptor": { - "code": "MIN_AGE" - }, - "value": "1" - }, - { - "descriptor": { - "code": "MAX_AGE" - }, - "value": "70" - }, - { - "descriptor": { - "code": "GENDER" - }, - "value": "MALE" - }, - { - "descriptor": { - "code": "NATIONALITY" - }, - "value": "INDIAN" - }, - { - "descriptor": { - "code": "ADDITIONAL_DETAILS_REQUIRED" - }, - "value": "TRUE" - } - ] - }, - { - "descriptor": { - "code": "INCLUSIONS" - }, - "list": [ - { - "value": "water" - }, - { - "value": "guide_tour" - } - ] - }, - { - "descriptor": { - "code": "EXCLUSIONS" - }, - "list": [ - { - "value": "out side food" - }, - { - "value": "photography" - } - ] - }, - { - "descriptor": { - "code": "INFO", - "name": "Info" - }, - "display": false, - "list": [ - { - "descriptor": { - "code": "TNC_LINK", - "name": "Terms & Conditions" - }, - "value": "https://api.unreserved-entry-pass/beckn/tnc.html" - } - ] - } - ] - }, - { - "id": "I5", - "location_ids": [ - "L1" - ], - "descriptor": { - "name": "Add on item", - "code": "ADD_ON", - "images": [ - { - "url": "https://api.unreserved-entry-pass.com/sites/default/files/event/logo/event_logo_2.png", - "size_type": "xs" - } - ] - }, - "parent_item_id": "I0", - "price": { - "currency": "INR", - "value": "100" - }, - "quantity": { - "selected": { - "count": 1 - } - }, - "tags": [ - { - "descriptor": { - "code": "INFO", - "name": "Info" - }, - "display": false, - "list": [ - { - "descriptor": { - "code": "TNC_LINK", - "name": "Terms & Conditions" - }, - "value": "https://api.unreserved-entry-pass/beckn/tnc.html" - } - ] - } - ] - } - ], - "fulfillments": [ - { - "id": "F1", - "type": "VISIT", - "stops": [ - { - "type": "START", - "instructions": { - "additional_desc": { - "url": "https://api.unreserved-entry-pass.com/sites/additional-info", - "content_type": "text/plain" - } - }, - "time": { - "timestamp": "2024-06-28T05:00:16.000Z" - } - } - ], - "agent": { - "organization": { - "contact": { - "phone": "+91-9999999999", - "email": "john.doe@example.com" - } - } - }, - "vehicle": { - "category": "SITE" - } - } - ], - "provider": { - "id": "P1", - "descriptor": { - "name": "Unreserved Entry Pass", - "images": [ - { - "url": "https://api.unreserved-entry-pass.com/sites/default/files/event/logo/event_logo_2.png", - "size_type": "xs" - } - ] - }, - "locations": [ - { - "id": "L1", - "gps": "28.524596, 77.185577", - "descriptor": { - "name": "Qutab Minar", - "short_desc": "Seth Sarai, Mehrauli, New Delhi, Delhi. The Qutb Minar, also spelled Qutub Minar and Qutab Minar, is a minaret and \"victory tower\" that forms part of the Qutb complex", - "additional_desc": { - "url": "https://api.unreserved-entry-pass.com/sites/additional-info", - "content_type": "text/plain" - }, - "images": [ - { - "url": "https://api.unreserved-entry-pass.com/sites/images/location.png", - "size_type": "md" - } - ] - }, - "rating": "5" - } - ] - }, - "cancellation_terms": [ - { - "cancellation_fee": { - "percentage": "10" - }, - "fulfillment_state": { - "descriptor": { - "code": "CONFIRMED" - } - }, - "cancel_by": { - "label": "DURATION", - "duration": "PT1H30M" - }, - "cancellation_eligible": true - }, - { - "external_ref": { - "mimetype": "text/html", - "url": "https://api.unreserved-entry-pass.com/beckn/tnc.html" - }, - "cancellation_eligible": true - } - ], - "replacement_terms": [ - { - "external_ref": { - "mimetype": "text/html", - "url": "https://api.unreserved-entry-pass.com/beckn/replacement.html" - } - } - ], - "quote": { - "breakup": [ - { - "title": "BASE_FARE", - "item": { - "id": "I1", - "price": { - "currency": "INR", - "value": "350" - }, - "quantity": { - "selected": { - "count": 1 - } - } - }, - "price": { - "currency": "INR", - "value": "350" - } - }, - { - "title": "BASE_FARE", - "item": { - "id": "I2", - "price": { - "currency": "INR", - "value": "150" - }, - "quantity": { - "selected": { - "count": 1 - } - } - }, - "price": { - "currency": "INR", - "value": "150" - } - }, - { - "title": "TAX", - "price": { - "currency": "INR", - "value": "0" - } - }, - { - "title": "ADD_ONS", - "item": { - "id": "I1", - "add_ons": [ - { - "id": "A1" - } - ] - }, - "price": { - "currency": "INR", - "value": "100" - } - }, - { - "title": "ADD_ONS", - "item": { - "id": "I2", - "add_ons": [ - { - "id": "A1" - } - ] - }, - "price": { - "currency": "INR", - "value": "100" - } - }, - { - "title": "ADD_ONS", - "item": { - "id": "I5" - }, - "price": { - "currency": "INR", - "value": "100" - } - } - ], - "price": { - "currency": "INR", - "value": "800" - } - } -} \ No newline at end of file diff --git a/mock-service/src/config/mock-config/TRV14/2.0.0/on_select/generator.ts b/mock-service/src/config/mock-config/TRV14/2.0.0/on_select/generator.ts index 35e0805d..16754bb4 100644 --- a/mock-service/src/config/mock-config/TRV14/2.0.0/on_select/generator.ts +++ b/mock-service/src/config/mock-config/TRV14/2.0.0/on_select/generator.ts @@ -9,7 +9,6 @@ * Note: Parent items (items without price/quantity) are included in response for * demonstration purposes but excluded from price calculations */ -import data from "./data.json" /** * Merges add-on selection data with full add-on details @@ -138,7 +137,7 @@ function calculateQuote(items: any[]): any { export async function onSelectDefaultGenerator(existingPayload: any, sessionData: any) { // Note: Validation is handled in meetRequirements method of the class // inject default data - sessionData.fulfillments = data.fulfillments + // sessionData.fulfillments = data.fulfillments // Filter and merge items based on selected_items diff --git a/mock-service/src/config/mock-config/TRV14/2.0.0/on_select_cultural/data.json b/mock-service/src/config/mock-config/TRV14/2.0.0/on_select_cultural/data.json deleted file mode 100644 index 6d13dfcf..00000000 --- a/mock-service/src/config/mock-config/TRV14/2.0.0/on_select_cultural/data.json +++ /dev/null @@ -1,769 +0,0 @@ -{ - "items": [ - { - "id": "I0", - "descriptor": { - "name": "Parent Item for Culture & Heritage", - "code": "ABSTRACT", - "short_desc": "Ticket for Qutab Minar", - "long_desc": "This ticket grants entry to the Qutab Minar.", - "images": [ - { - "url": "https://api.unreserved-entry-pass.com/sites/default/files/event/logo/event_logo_2.png", - "size_type": "xs" - } - ] - }, - "location_ids": [ - "L1" - ], - "category_ids": [ - "C2" - ], - "time": { - "label": "VALIDITY", - "duration": "P2D", - "range": { - "start": "2026-01-28T10:19:12.594Z", - "end": "2026-01-30T10:19:12.594Z" - } - }, - "fulfillment_ids": [ - "F1", - "F2" - ], - "cancellation_terms": [ - { - "cancellation_fee": { - "percentage": "10" - }, - "fulfillment_state": { - "descriptor": { - "code": "CONFIRMED" - } - }, - "cancel_by": { - "label": "DURATION", - "duration": "PT1H30M" - }, - "cancellation_eligible": true - }, - { - "external_ref": { - "mimetype": "text/html", - "url": "https://api.unreserved-entry-pass.com/beckn/tnc.html" - }, - "cancellation_eligible": true - } - ], - "replacement_terms": [ - { - "external_ref": { - "mimetype": "text/html", - "url": "https://api.unreserved-entry-pass/beckn/replacement.html" - } - } - ], - "tags": [ - { - "descriptor": { - "code": "INCLUSIONS" - }, - "list": [ - { - "value": "water" - } - ] - }, - { - "descriptor": { - "code": "EXCLUSIONS" - }, - "list": [ - { - "value": "out side food" - }, - { - "value": "photography" - } - ] - }, - { - "descriptor": { - "code": "INFO", - "name": "Info" - }, - "display": false, - "list": [ - { - "descriptor": { - "code": "TNC_LINK", - "name": "Terms & Conditions" - }, - "value": "https://api.unreserved-entry-pass/beckn/tnc.html" - } - ] - } - ] - }, - { - "id": "I1", - "descriptor": { - "name": "Adult-Ticket Culture & Heritage Item", - "code": "ENTRY_PASS", - "short_desc": "Ticket for Qutab Minar", - "long_desc": "This ticket grants entry to the Qutab Minar.", - "images": [ - { - "url": "https://api.unreserved-entry-pass.com/sites/default/files/event/logo/event_logo_2.png", - "size_type": "xs" - } - ] - }, - "parent_item_id": "I0", - "location_ids": [ - "L1" - ], - "category_ids": [ - "C2" - ], - "price": { - "currency": "INR", - "value": "350" - }, - "quantity": { - "maximum": { - "count": 6 - }, - "minimum": { - "count": 1 - } - }, - "time": { - "label": "VALIDITY", - "duration": "P2D", - "range": { - "start": "2026-01-28T10:19:12.594Z", - "end": "2026-01-30T10:19:12.594Z" - } - }, - "fulfillment_ids": [ - "F1", - "F2" - ], - "add_ons": [ - { - "id": "A1", - "descriptor": { - "name": "Audio Assistance" - }, - "quantity": { - "available": { - "count": 1 - } - }, - "price": { - "value": "100", - "currency": "INR" - } - } - ], - "tags": [ - { - "descriptor": { - "code": "FARE_POLICY" - }, - "list": [ - { - "descriptor": { - "code": "MIN_AGE" - }, - "value": "18" - }, - { - "descriptor": { - "code": "MAX_AGE" - }, - "value": "70" - }, - { - "descriptor": { - "code": "GENDER" - }, - "value": "MALE" - }, - { - "descriptor": { - "code": "NATIONALITY" - }, - "value": "INDIAN" - }, - { - "descriptor": { - "code": "ADDITIONAL_DETAILS_REQUIRED" - }, - "value": "TRUE" - } - ] - }, - { - "descriptor": { - "code": "INFO", - "name": "Info" - }, - "display": false, - "list": [ - { - "descriptor": { - "code": "TNC_LINK", - "name": "Terms & Conditions" - }, - "value": "https://api.unreserved-entry-pass/beckn/tnc.html" - } - ] - } - ] - }, - { - "id": "I2", - "descriptor": { - "name": "Child-Ticket Culture & Heritage Item", - "code": "ENTRY_PASS", - "short_desc": "Ticket for Qutab Minar", - "long_desc": "This ticket grants entry to the Qutab Minar.", - "images": [ - { - "url": "https://api.unreserved-entry-pass.com/sites/default/files/event/logo/event_logo_2.png", - "size_type": "xs" - } - ] - }, - "parent_item_id": "I0", - "location_ids": [ - "L1" - ], - "category_ids": [ - "C2" - ], - "price": { - "currency": "INR", - "value": "150" - }, - "quantity": { - "maximum": { - "count": 4 - }, - "minimum": { - "count": 1 - } - }, - "time": { - "label": "VALIDITY", - "duration": "P2D", - "range": { - "start": "2026-01-28T10:19:12.594Z", - "end": "2026-01-30T10:19:12.594Z" - } - }, - "fulfillment_ids": [ - "F1", - "F2" - ], - "add_ons": [ - { - "id": "A1", - "descriptor": { - "name": "Audio Assistance" - }, - "quantity": { - "available": { - "count": 1 - } - }, - "price": { - "value": "100", - "currency": "INR" - } - } - ], - "tags": [ - { - "descriptor": { - "code": "FARE_POLICY" - }, - "list": [ - { - "descriptor": { - "code": "MIN_AGE" - }, - "value": "1" - }, - { - "descriptor": { - "code": "MAX_AGE" - }, - "value": "70" - }, - { - "descriptor": { - "code": "GENDER" - }, - "value": "MALE" - }, - { - "descriptor": { - "code": "NATIONALITY" - }, - "value": "INDIAN" - }, - { - "descriptor": { - "code": "ADDITIONAL_DETAILS_REQUIRED" - }, - "value": "TRUE" - } - ] - }, - { - "descriptor": { - "code": "INFO", - "name": "Info" - }, - "display": false, - "list": [ - { - "descriptor": { - "code": "TNC_LINK", - "name": "Terms & Conditions" - }, - "value": "https://api.unreserved-entry-pass/beckn/tnc.html" - } - ] - } - ] - }, - { - "id": "I0_1", - "descriptor": { - "name": "Parent Item for Culture & Heritage", - "code": "ABSTRACT", - "short_desc": "Ticket for Qutab Minar", - "long_desc": "This ticket grants entry to the Qutab Minar.", - "images": [ - { - "url": "https://api.unreserved-entry-pass.com/sites/default/files/event/logo/event_logo_2.png", - "size_type": "xs" - } - ] - }, - "location_ids": [ - "L1" - ], - "category_ids": [ - "C3" - ], - "time": { - "label": "VALIDITY", - "duration": "P2D", - "range": { - "start": "2026-01-28T10:19:12.594Z", - "end": "2026-01-30T10:19:12.594Z" - } - }, - "fulfillment_ids": [ - "F1", - "F2" - ], - "cancellation_terms": [ - { - "cancellation_fee": { - "percentage": "10" - }, - "fulfillment_state": { - "descriptor": { - "code": "CONFIRMED" - } - }, - "cancel_by": { - "label": "DURATION", - "duration": "PT1H30M" - }, - "cancellation_eligible": true - }, - { - "external_ref": { - "mimetype": "text/html", - "url": "https://api.unreserved-entry-pass.com/beckn/tnc.html" - }, - "cancellation_eligible": true - } - ], - "replacement_terms": [ - { - "external_ref": { - "mimetype": "text/html", - "url": "https://api.unreserved-entry-pass/beckn/replacement.html" - } - } - ], - "tags": [ - { - "descriptor": { - "code": "INCLUSIONS" - }, - "list": [ - { - "value": "water" - } - ] - }, - { - "descriptor": { - "code": "EXCLUSIONS" - }, - "list": [ - { - "value": "out side food" - } - ] - }, - { - "descriptor": { - "code": "INFO", - "name": "Info" - }, - "display": false, - "list": [ - { - "descriptor": { - "code": "TNC_LINK", - "name": "Terms & Conditions" - }, - "value": "https://api.unreserved-entry-pass/beckn/tnc.html" - } - ] - } - ] - }, - { - "id": "I3", - "descriptor": { - "name": "Adult-Ticket Culture & Heritage Item", - "code": "ENTRY_PASS", - "short_desc": "Ticket for Qutab Minar", - "long_desc": "This ticket grants entry to the Qutab Minar.", - "images": [ - { - "url": "https://api.unreserved-entry-pass.com/sites/default/files/event/logo/event_logo_2.png", - "size_type": "xs" - } - ] - }, - "parent_item_id": "I0_1", - "location_ids": [ - "L1" - ], - "category_ids": [ - "C3" - ], - "price": { - "currency": "INR", - "value": "400" - }, - "quantity": { - "maximum": { - "count": 6 - }, - "minimum": { - "count": 1 - } - }, - "time": { - "label": "VALIDITY", - "duration": "P2D", - "range": { - "start": "2026-01-28T10:19:12.594Z", - "end": "2026-01-30T10:19:12.594Z" - } - }, - "fulfillment_ids": [ - "F1", - "F2" - ], - "add_ons": [ - { - "id": "A1", - "descriptor": { - "name": "Audio Assistance" - }, - "quantity": { - "available": { - "count": 1 - } - }, - "price": { - "value": "100", - "currency": "INR" - } - } - ], - "tags": [ - { - "descriptor": { - "code": "FARE_POLICY" - }, - "list": [ - { - "descriptor": { - "code": "MIN_AGE" - }, - "value": "18" - }, - { - "descriptor": { - "code": "MAX_AGE" - }, - "value": "70" - }, - { - "descriptor": { - "code": "GENDER" - }, - "value": "MALE" - }, - { - "descriptor": { - "code": "NATIONALITY" - }, - "value": "INDIAN" - }, - { - "descriptor": { - "code": "ADDITIONAL_DETAILS_REQUIRED" - }, - "value": "FALSE" - } - ] - }, - { - "descriptor": { - "code": "INFO", - "name": "Info" - }, - "display": false, - "list": [ - { - "descriptor": { - "code": "TNC_LINK", - "name": "Terms & Conditions" - }, - "value": "https://api.unreserved-entry-pass/beckn/tnc.html" - } - ] - } - ] - }, - { - "id": "I4", - "descriptor": { - "name": "Child-Ticket Culture & Heritage Item", - "code": "ENTRY_PASS", - "short_desc": "Ticket for Qutab Minar", - "long_desc": "This ticket grants entry to the Qutab Minar.", - "images": [ - { - "url": "https://api.unreserved-entry-pass.com/sites/default/files/event/logo/event_logo_2.png", - "size_type": "xs" - } - ] - }, - "parent_item_id": "I0_1", - "location_ids": [ - "L1" - ], - "category_ids": [ - "C3" - ], - "price": { - "currency": "INR", - "value": "250" - }, - "quantity": { - "maximum": { - "count": 4 - }, - "minimum": { - "count": 1 - } - }, - "time": { - "label": "VALIDITY", - "duration": "P2D", - "range": { - "start": "2026-01-28T10:19:12.594Z", - "end": "2026-01-30T10:19:12.594Z" - } - }, - "fulfillment_ids": [ - "F1", - "F2" - ], - "add_ons": [ - { - "id": "A1", - "descriptor": { - "name": "Audio Assistance" - }, - "quantity": { - "available": { - "count": 1 - } - }, - "price": { - "value": "100", - "currency": "INR" - } - } - ], - "tags": [ - { - "descriptor": { - "code": "FARE_POLICY" - }, - "list": [ - { - "descriptor": { - "code": "MIN_AGE" - }, - "value": "1" - }, - { - "descriptor": { - "code": "MAX_AGE" - }, - "value": "70" - }, - { - "descriptor": { - "code": "GENDER" - }, - "value": "MALE" - }, - { - "descriptor": { - "code": "NATIONALITY" - }, - "value": "INDIAN" - }, - { - "descriptor": { - "code": "ADDITIONAL_DETAILS_REQUIRED" - }, - "value": "FALSE" - } - ] - }, - { - "descriptor": { - "code": "INFO", - "name": "Info" - }, - "display": false, - "list": [ - { - "descriptor": { - "code": "TNC_LINK", - "name": "Terms & Conditions" - }, - "value": "https://api.unreserved-entry-pass/beckn/tnc.html" - } - ] - } - ] - }, - { - "id": "I5", - "location_ids": [ - "L1" - ], - "descriptor": { - "name": "Add on item", - "code": "ADD_ON", - "images": [ - { - "url": "https://api.unreserved-entry-pass.com/sites/default/files/event/logo/event_logo_2.png", - "size_type": "xs" - } - ] - }, - "parent_item_id": "I0", - "price": { - "currency": "INR", - "value": "100" - }, - "quantity": { - "maximum": { - "count": 3 - }, - "minimum": { - "count": 1 - } - }, - "tags": [ - { - "descriptor": { - "code": "INFO", - "name": "Info" - }, - "display": false, - "list": [ - { - "descriptor": { - "code": "TNC_LINK", - "name": "Terms & Conditions" - }, - "value": "https://api.unreserved-entry-pass/beckn/tnc.html" - } - ] - } - ], - "time": { - "range": { - "start": "2026-01-28T10:19:12.594Z", - "end": "2026-01-30T10:19:12.594Z" - } - } - } - ], - "fulfillments": [ - { - "id": "F1", - "type": "VISIT", - "stops": [ - { - "type": "START", - "instructions": { - "additional_desc": { - "url": "https://api.unreserved-entry-pass.com/sites/additional-info", - "content_type": "text/plain" - } - }, - "time": { - "timestamp": "2024-06-28T05:00:16.000Z" - } - } - ], - "agent": { - "organization": { - "contact": { - "phone": "+91-9999999999", - "email": "john.doe@example.com" - } - } - }, - "vehicle": { - "category": "SITE" - } - } - ] -} \ No newline at end of file diff --git a/mock-service/src/config/mock-config/TRV14/2.0.0/on_select_cultural/generator.ts b/mock-service/src/config/mock-config/TRV14/2.0.0/on_select_cultural/generator.ts index 9ebd287b..228c4dfd 100644 --- a/mock-service/src/config/mock-config/TRV14/2.0.0/on_select_cultural/generator.ts +++ b/mock-service/src/config/mock-config/TRV14/2.0.0/on_select_cultural/generator.ts @@ -1,4 +1,3 @@ -import data from "./data.json" function mergeAddOnsWithSelection(fullAddOns: any[], selectedAddOns: any[]): any[] { return fullAddOns.map((fullAddOn: any) => { @@ -102,7 +101,6 @@ function calculateQuote(items: any[]): any { } export async function onSelectDefaultGenerator(existingPayload: any, sessionData: any) { - sessionData.fulfillments = data.fulfillments const responseItems: any[] = []; const addedParentIds: Set = new Set(); diff --git a/mock-service/src/config/mock-config/TRV14/2.0.0/on_select_without_form/data.json b/mock-service/src/config/mock-config/TRV14/2.0.0/on_select_without_form/data.json deleted file mode 100644 index 6a8e904b..00000000 --- a/mock-service/src/config/mock-config/TRV14/2.0.0/on_select_without_form/data.json +++ /dev/null @@ -1,523 +0,0 @@ -{ - "items": [ - { - "id": "I0_1", - "descriptor": { - "name": "Parent Item for Culture & Heritage", - "code": "ABSTRACT", - "short_desc": "Ticket for Qutab Minar", - "long_desc": "This ticket grants entry to the Qutab Minar.", - "images": [ - { - "url": "https://api.unreserved-entry-pass.com/sites/default/files/event/logo/event_logo_2.png", - "size_type": "xs" - } - ] - }, - "location_ids": [ - "L1" - ], - "category_ids": [ - "C3" - ], - "time": { - "label": "VALIDITY", - "duration": "P2D" - }, - "fulfillment_ids": [ - "F1" - ], - "tags": [ - { - "descriptor": { - "code": "INCLUSIONS" - }, - "list": [ - { - "value": "water" - } - ] - }, - { - "descriptor": { - "code": "EXCLUSIONS" - }, - "list": [ - { - "value": "out side food" - } - ] - }, - { - "descriptor": { - "code": "INFO", - "name": "Info" - }, - "display": false, - "list": [ - { - "descriptor": { - "code": "TNC_LINK", - "name": "Terms & Conditions" - }, - "value": "https://api.unreserved-entry-pass/beckn/tnc.html" - } - ] - } - ] - }, - { - "id": "I3", - "descriptor": { - "name": "Adult-Ticket Culture & Heritage Item", - "code": "ENTRY_PASS", - "short_desc": "Ticket for Qutab Minar", - "long_desc": "This ticket grants entry to the Qutab Minar.", - "images": [ - { - "url": "https://api.unreserved-entry-pass.com/sites/default/files/event/logo/event_logo_2.png", - "size_type": "xs" - } - ] - }, - "parent_item_id": "I0_1", - "location_ids": [ - "L1" - ], - "category_ids": [ - "C3" - ], - "price": { - "currency": "INR", - "value": "400" - }, - "quantity": { - "selected": { - "count": 1 - } - }, - "time": { - "label": "VALIDITY", - "duration": "P2D" - }, - "fulfillment_ids": [ - "F1" - ], - "add_ons": [ - { - "id": "A1", - "descriptor": { - "name": "Audio Assistance" - }, - "quantity": { - "selected": { - "count": 1 - } - }, - "price": { - "value": "100", - "currency": "INR" - } - } - ], - "tags": [ - { - "descriptor": { - "code": "FARE_POLICY" - }, - "list": [ - { - "descriptor": { - "code": "MIN_AGE" - }, - "value": "18" - }, - { - "descriptor": { - "code": "MAX_AGE" - }, - "value": "70" - }, - { - "descriptor": { - "code": "GENDER" - }, - "value": "MALE" - }, - { - "descriptor": { - "code": "NATIONALITY" - }, - "value": "INDIAN" - }, - { - "descriptor": { - "code": "ADDITIONAL_DETAILS_REQUIRED" - }, - "value": "FALSE" - } - ] - }, - { - "descriptor": { - "code": "INFO", - "name": "Info" - }, - "display": false, - "list": [ - { - "descriptor": { - "code": "TNC_LINK", - "name": "Terms & Conditions" - }, - "value": "https://api.unreserved-entry-pass/beckn/tnc.html" - } - ] - } - ] - }, - { - "id": "I4", - "descriptor": { - "name": "Child-Ticket Culture & Heritage Item", - "code": "ENTRY_PASS", - "short_desc": "Ticket for Qutab Minar", - "long_desc": "This ticket grants entry to the Qutab Minar.", - "images": [ - { - "url": "https://api.unreserved-entry-pass.com/sites/default/files/event/logo/event_logo_2.png", - "size_type": "xs" - } - ] - }, - "parent_item_id": "I0_1", - "location_ids": [ - "L1" - ], - "category_ids": [ - "C3" - ], - "price": { - "currency": "INR", - "value": "250" - }, - "quantity": { - "selected": { - "count": 1 - } - }, - "time": { - "label": "VALIDITY", - "duration": "P2D" - }, - "fulfillment_ids": [ - "F1" - ], - "add_ons": [ - { - "id": "A1", - "descriptor": { - "name": "Audio Assistance" - }, - "quantity": { - "selected": { - "count": 1 - } - }, - "price": { - "value": "100", - "currency": "INR" - } - } - ], - "tags": [ - { - "descriptor": { - "code": "FARE_POLICY" - }, - "list": [ - { - "descriptor": { - "code": "MIN_AGE" - }, - "value": "1" - }, - { - "descriptor": { - "code": "MAX_AGE" - }, - "value": "70" - }, - { - "descriptor": { - "code": "GENDER" - }, - "value": "MALE" - }, - { - "descriptor": { - "code": "NATIONALITY" - }, - "value": "INDIAN" - }, - { - "descriptor": { - "code": "ADDITIONAL_DETAILS_REQUIRED" - }, - "value": "FALSE" - } - ] - }, - { - "descriptor": { - "code": "INFO", - "name": "Info" - }, - "display": false, - "list": [ - { - "descriptor": { - "code": "TNC_LINK", - "name": "Terms & Conditions" - }, - "value": "https://api.unreserved-entry-pass/beckn/tnc.html" - } - ] - } - ] - }, - { - "id": "I5", - "location_ids": [ - "L1" - ], - "descriptor": { - "name": "Add on item", - "code": "ADD_ON", - "images": [ - { - "url": "https://api.unreserved-entry-pass.com/sites/default/files/event/logo/event_logo_2.png", - "size_type": "xs" - } - ] - }, - "parent_item_id": "I0_1", - "price": { - "currency": "INR", - "value": "100" - }, - "quantity": { - "selected": { - "count": 1 - } - }, - "tags": [ - { - "descriptor": { - "code": "INFO", - "name": "Info" - }, - "display": false, - "list": [ - { - "descriptor": { - "code": "TNC_LINK", - "name": "Terms & Conditions" - }, - "value": "https://api.unreserved-entry-pass/beckn/tnc.html" - } - ] - } - ] - } - ], - "fulfillments": [ - { - "id": "F1", - "type": "VISIT", - "stops": [ - { - "type": "START", - "instructions": { - "additional_desc": { - "url": "https://api.unreserved-entry-pass.com/sites/additional-info", - "content_type": "text/plain" - } - }, - "time": { - "timestamp": "2024-06-28T05:00:16.000Z" - } - } - ], - "agent": { - "organization": { - "contact": { - "phone": "+91-9999999999", - "email": "john.doe@example.com" - } - } - }, - "vehicle": { - "category": "SITE" - } - } - ], - "provider": { - "id": "P1", - "descriptor": { - "name": "Unreserved Entry Pass", - "images": [ - { - "url": "https://api.unreserved-entry-pass.com/sites/default/files/event/logo/event_logo_2.png", - "size_type": "xs" - } - ] - }, - "locations": [ - { - "id": "L1", - "gps": "28.524596, 77.185577", - "descriptor": { - "name": "Qutab Minar", - "short_desc": "Seth Sarai, Mehrauli, New Delhi, Delhi. The Qutb Minar, also spelled Qutub Minar and Qutab Minar, is a minaret and \"victory tower\" that forms part of the Qutb complex", - "additional_desc": { - "url": "https://api.unreserved-entry-pass.com/sites/additional-info", - "content_type": "text/plain" - }, - "images": [ - { - "url": "https://api.unreserved-entry-pass.com/sites/images/location.png", - "size_type": "md" - } - ] - }, - "rating": "5" - } - ] - }, - "cancellation_terms": [ - { - "cancellation_fee": { - "percentage": "10" - }, - "fulfillment_state": { - "descriptor": { - "code": "CONFIRMED" - } - }, - "cancel_by": { - "label": "DURATION", - "duration": "PT1H30M" - }, - "cancellation_eligible": true - }, - { - "external_ref": { - "mimetype": "text/html", - "url": "https://api.unreserved-entry-pass.com/beckn/tnc.html" - }, - "cancellation_eligible": true - } - ], - "replacement_terms": [ - { - "external_ref": { - "mimetype": "text/html", - "url": "https://api.unreserved-entry-pass.com/beckn/replacement.html" - } - } - ], - "quote": { - "breakup": [ - { - "title": "BASE_FARE", - "item": { - "id": "I3", - "price": { - "currency": "INR", - "value": "400" - }, - "quantity": { - "selected": { - "count": 1 - } - } - }, - "price": { - "currency": "INR", - "value": "400" - } - }, - { - "title": "BASE_FARE", - "item": { - "id": "I2", - "price": { - "currency": "INR", - "value": "250" - }, - "quantity": { - "selected": { - "count": 1 - } - } - }, - "price": { - "currency": "INR", - "value": "250" - } - }, - { - "title": "TAX", - "price": { - "currency": "INR", - "value": "0" - } - }, - { - "title": "ADD_ONS", - "item": { - "id": "I1", - "add_ons": [ - { - "id": "A1" - } - ] - }, - "price": { - "currency": "INR", - "value": "100" - } - }, - { - "title": "ADD_ONS", - "item": { - "id": "I2", - "add_ons": [ - { - "id": "A1" - } - ] - }, - "price": { - "currency": "INR", - "value": "100" - } - }, - { - "title": "ADD_ONS", - "item": { - "id": "I5" - }, - "price": { - "currency": "INR", - "value": "100" - } - } - ], - "price": { - "currency": "INR", - "value": "950" - } - } -} \ No newline at end of file diff --git a/mock-service/src/config/mock-config/TRV14/2.0.0/on_select_without_form/generator.ts b/mock-service/src/config/mock-config/TRV14/2.0.0/on_select_without_form/generator.ts index 401a757a..bb2228dd 100644 --- a/mock-service/src/config/mock-config/TRV14/2.0.0/on_select_without_form/generator.ts +++ b/mock-service/src/config/mock-config/TRV14/2.0.0/on_select_without_form/generator.ts @@ -9,7 +9,6 @@ * Note: Parent items (items without price/quantity) are included in response for * demonstration purposes but excluded from price calculations */ -import data from "./data.json" /** * Merges add-on selection data with full add-on details @@ -145,7 +144,6 @@ function calculateQuote(items: any[]): any { export async function onSelectWithoutFormGenerator(existingPayload: any, sessionData: any) { // Note: Validation is handled in meetRequirements method of the class // inject default data - sessionData.fulfillments = data.fulfillments // Filter and merge items based on selected_items diff --git a/mock-service/src/config/mock-config/TRV14/2.0.0/select/class.ts b/mock-service/src/config/mock-config/TRV14/2.0.0/select/class.ts index e4fd685c..ad39210e 100644 --- a/mock-service/src/config/mock-config/TRV14/2.0.0/select/class.ts +++ b/mock-service/src/config/mock-config/TRV14/2.0.0/select/class.ts @@ -82,7 +82,7 @@ export class MockSelectClass extends MockAction { } // Validate fulfillment - if (!userInputs.fulfillment) { + if (!userInputs.fulfillments) { return { valid: false, message: "fulfillment is required in user_inputs", diff --git a/mock-service/src/config/mock-config/TRV14/2.0.0/select/generator.ts b/mock-service/src/config/mock-config/TRV14/2.0.0/select/generator.ts index bf59fcba..f89e2244 100644 --- a/mock-service/src/config/mock-config/TRV14/2.0.0/select/generator.ts +++ b/mock-service/src/config/mock-config/TRV14/2.0.0/select/generator.ts @@ -48,31 +48,14 @@ function createItemPayload(userInputItem: any): any { export async function selectDefaultGenerator(existingPayload: any, sessionData: any) { const userInputs = sessionData.user_inputs; - // Process all items from user_inputs const itemPayloads = userInputs.items.map((item: any) => createItemPayload(item)); - // Update the payload with all selected items existingPayload.message.order.items = itemPayloads; - // Set provider ID from user_inputs existingPayload.message.order.provider.id = userInputs.provider; - // Create fulfillment object with the selected fulfillment ID - const contextTimestamp = existingPayload.context?.timestamp || new Date().toISOString(); + existingPayload.message.order.fulfillments = userInputs?.fulfillments - existingPayload.message.order.fulfillments = [ - { - id: userInputs.fulfillment, - stops: [ - { - type: "START", - time: { - timestamp: contextTimestamp - } - } - ] - } - ]; return existingPayload; } diff --git a/mock-service/src/config/mock-config/TRV14/2.0.0/select/select_partial_cancellation/generator.ts b/mock-service/src/config/mock-config/TRV14/2.0.0/select/select_partial_cancellation/generator.ts index 2b04e8a8..1952c27c 100644 --- a/mock-service/src/config/mock-config/TRV14/2.0.0/select/select_partial_cancellation/generator.ts +++ b/mock-service/src/config/mock-config/TRV14/2.0.0/select/select_partial_cancellation/generator.ts @@ -50,13 +50,13 @@ export async function selectPartialCancellationGenerator(existingPayload: any, s // Select the first item (index 0) or second item (index 1) based on availability let selectedItem: any; - if(sessionData.items.length > 1){ - selectedItem = sessionData.items[1]; + if (sessionData.items.length > 1) { + selectedItem = sessionData.items[1]; } - else{ - selectedItem = sessionData.items[0]; + else { + selectedItem = sessionData.items[0]; } - + // Create item payload for the selected item only (don't include parent in select payload) const selectedItemPayload = createItemPayload(selectedItem); diff --git a/mock-service/src/config/mock-config/TRV14/2.0.0/select_for_partial_cancellation/class.ts b/mock-service/src/config/mock-config/TRV14/2.0.0/select_for_partial_cancellation/class.ts index dacc3f45..97f8b768 100644 --- a/mock-service/src/config/mock-config/TRV14/2.0.0/select_for_partial_cancellation/class.ts +++ b/mock-service/src/config/mock-config/TRV14/2.0.0/select_for_partial_cancellation/class.ts @@ -84,10 +84,10 @@ export class MockSelectForPartialCancellationClass extends MockAction { } // Validate fulfillment - if (!userInputs.fulfillment) { + if (!userInputs.fulfillments) { return { valid: false, - message: "fulfillment is required in user_inputs", + message: "fulfillments is required in user_inputs", code: "MISSING_FULFILLMENT" }; } diff --git a/mock-service/src/config/mock-config/TRV14/2.0.0/select_for_partial_cancellation/generator.ts b/mock-service/src/config/mock-config/TRV14/2.0.0/select_for_partial_cancellation/generator.ts index e57c1b8c..a4096dfc 100644 --- a/mock-service/src/config/mock-config/TRV14/2.0.0/select_for_partial_cancellation/generator.ts +++ b/mock-service/src/config/mock-config/TRV14/2.0.0/select_for_partial_cancellation/generator.ts @@ -63,19 +63,21 @@ export async function selectForPartialCancellationGenerator(existingPayload: any // Create fulfillment object with the selected fulfillment ID const contextTimestamp = existingPayload.context?.timestamp || new Date().toISOString(); - existingPayload.message.order.fulfillments = [ - { - id: userInputs.fulfillment, - stops: [ - { - type: "START", - time: { - timestamp: contextTimestamp - } - } - ] - } - ]; + existingPayload.message.order.fulfillments = userInputs?.fulfillments + + // [ + // { + // id: userInputs.fulfillment, + // stops: [ + // { + // type: "START", + // time: { + // timestamp: userInputs?.timestamp || contextTimestamp + // } + // } + // ] + // } + // ]; return existingPayload; } \ No newline at end of file