< Return to Summary | File Generated: Wed Mar 27 2024 15:05:41 GMT+0000 (Coordinated Universal Time)

seller-requested-replacement >> book-and-seller-replace-items (OpenBookingApprovalFlow >> ScheduledSession)

Booking Flow: OpenBookingApprovalFlow

Opportunity Type: ScheduledSession

Feature: Cancellation / Seller Requested Replacement (Implemented)

Test: Book and seller replaces order items.

A successful replacement of order items by seller.

Running only this test

npm start -- --runInBand test/features/cancellation/seller-requested-replacement/implemented/book-and-seller-replace-items-test.js

Is this test failing?

The OpenActive Reference Implementation test result for this test can be used as a reference to help with debugging.


⚠️ 20 passed with 0 failures, 128 warnings and 48 suggestions


✅ Fetch Opportunities

Local Microservice Test Interface for OrderItem 0 Request

POST http://localhost:3000/test-interface/datasets/uat-ci/opportunities

{
  "@type": "ScheduledSession",
  "superEvent": {
    "@type": "SessionSeries",
    "organizer": {
      "@type": "Organization",
      "@id": "https://localhost:5001/api/identifiers/sellers/1"
    }
  },
  "@context": [
    "https://openactive.io/",
    "https://openactive.io/test-interface"
  ],
  "test:testOpportunityCriteria": "https://openactive.io/test-interface#TestOpportunityBookable",
  "test:testOpenBookingFlow": "https://openactive.io/test-interface#OpenBookingApprovalFlow"
}

Response status code: 200 OK. Responded in 3.131751ms.

{
  "@context": "https://openactive.io/",
  "@type": "ScheduledSession",
  "@id": "https://localhost:5001/api/identifiers/scheduled-sessions/1063/events/10628"
}

Opportunity Feed extract for OrderItem 0 Request

GET http://localhost:3000/opportunity/https%3A%2F%2Flocalhost%3A5001%2Fapi%2Fidentifiers%2Fscheduled-sessions%2F1063%2Fevents%2F10628?useCacheIfAvailable=true


Response status code: 200 OK. Responded in 2.103921ms.

{
  "data": {
    "@context": [
      "https://openactive.io/"
    ],
    "@type": "ScheduledSession",
    "@id": "https://localhost:5001/api/identifiers/scheduled-sessions/1063/events/10628",
    "startDate": "2024-04-05T15:20:08+00:00",
    "endDate": "2024-04-05T21:18:08+00:00",
    "superEvent": {
      "@type": "SessionSeries",
      "@id": "https://localhost:5001/api/identifiers/session-series/1063",
      "name": "Metal Walking",
      "activity": [
        {
          "@type": "Concept",
          "@id": "https://openactive.io/activity-list#c07d63a0-8eb9-4602-8bcc-23be6deb8f83",
          "inScheme": "https://openactive.io/activity-list",
          "prefLabel": "Jet Skiing"
        }
      ],
      "eventAttendanceMode": "https://schema.org/OfflineEventAttendanceMode",
      "location": {
        "@type": "Place",
        "identifier": 2,
        "name": "Premier Lifters",
        "description": "Where your Fitness Goals are Always Inn-Sight. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
        "address": {
          "@type": "PostalAddress",
          "addressCountry": "GB",
          "addressLocality": "Oxford",
          "addressRegion": "Oxfordshire",
          "postalCode": "OX1 1BB",
          "streetAddress": "Greyfriars Court, Paradise Square"
        },
        "amenityFeature": [
          {
            "@type": "ChangingFacilities",
            "name": "Changing Facilities",
            "value": false
          },
          {
            "@type": "Showers",
            "name": "Showers",
            "value": false
          },
          {
            "@type": "Lockers",
            "name": "Lockers",
            "value": false
          },
          {
            "@type": "Towels",
            "name": "Towels",
            "value": true
          },
          {
            "@type": "Creche",
            "name": "Creche",
            "value": true
          },
          {
            "@type": "Parking",
            "name": "Parking",
            "value": true
          }
        ],
        "geo": {
          "@type": "GeoCoordinates",
          "latitude": 51.7504933,
          "longitude": -1.2620685
        },
        "image": [
          {
            "@type": "ImageObject",
            "url": "https://upload.wikimedia.org/wikipedia/commons/5/53/Cambridge_Orchard_Park_Premier_Inn.jpg"
          }
        ],
        "telephone": "01865 000002",
        "url": "https://en.wikipedia.org/wiki/Premier_Inn"
      },
      "offers": [
        {
          "@type": "Offer",
          "@id": "https://localhost:5001/api/identifiers/session-series/1063#/offers/0",
          "allowCustomerCancellationFullRefund": false,
          "latestCancellationBeforeStartDate": "P1DT16H",
          "openBookingFlowRequirement": [
            "https://openactive.io/OpenBookingApproval"
          ],
          "price": 0,
          "priceCurrency": "GBP"
        }
      ],
      "organizer": {
        "@type": "Organization",
        "@id": "https://localhost:5001/api/identifiers/sellers/1",
        "name": "Acme Fitness Ltd",
        "isOpenBookingAllowed": true,
        "taxMode": "https://openactive.io/TaxGross",
        "termsOfService": [
          {
            "@type": "PrivacyPolicy",
            "name": "Privacy Policy",
            "requiresExplicitConsent": false,
            "url": "https://example.com/privacy.html"
          }
        ]
      },
      "url": "https://www.example.com/a-session-age"
    },
    "duration": "PT5H58M",
    "maximumAttendeeCapacity": 32,
    "remainingAttendeeCapacity": 32
  }
}

Specs

✅ Fetch Opportunities >> validation of Opportunity Feed extract for OrderItem 0

Specs

Validations

✅ C1

C1 Request

PUT https://localhost:5001/api/openbooking/order-quote-templates/edde2935-0863-4978-b698-57cdb1e536a6

{
  "@context": "https://openactive.io/",
  "@type": "OrderQuote",
  "brokerRole": "https://openactive.io/AgentBroker",
  "broker": {
    "@type": "Organization",
    "name": "MyFitnessApp",
    "url": "https://myfitnessapp.example.com",
    "description": "A fitness app for all the community",
    "logo": {
      "@type": "ImageObject",
      "url": "http://data.myfitnessapp.org.uk/images/logo.png"
    },
    "address": {
      "@type": "PostalAddress",
      "streetAddress": "Alan Peacock Way",
      "addressLocality": "Village East",
      "addressRegion": "Middlesbrough",
      "postalCode": "TS4 3AE",
      "addressCountry": "GB"
    }
  },
  "seller": "https://localhost:5001/api/identifiers/sellers/1",
  "orderedItem": [
    {
      "@type": "OrderItem",
      "position": 0,
      "acceptedOffer": "https://localhost:5001/api/identifiers/session-series/1063#/offers/0",
      "orderedItem": "https://localhost:5001/api/identifiers/scheduled-sessions/1063/events/10628"
    }
  ],
  "payment": {
    "@type": "Payment",
    "name": "AcmeBroker Points",
    "accountId": "SN1593",
    "paymentProviderId": "STRIPE"
  }
}

Response status code: 200 OK. Responded in 26.108157ms.

{
  "@context": "https://openactive.io/",
  "@type": "OrderQuote",
  "@id": "https://localhost:5001/api/openbooking/order-quotes/edde2935-0863-4978-b698-57cdb1e536a6",
  "lease": {
    "@type": "Lease",
    "leaseExpires": "2024-03-27T15:11:04+00:00"
  },
  "orderRequiresApproval": true,
  "bookingService": {
    "@type": "BookingService",
    "name": "Acme booking system",
    "termsOfService": [
      {
        "@type": "PrivacyPolicy",
        "name": "Privacy Policy",
        "requiresExplicitConsent": false,
        "url": "https://example.com/privacy.html"
      }
    ],
    "url": "https://example.com"
  },
  "broker": {
    "@type": "Organization",
    "name": "MyFitnessApp",
    "url": "https://myfitnessapp.example.com"
  },
  "brokerRole": "https://openactive.io/AgentBroker",
  "orderedItem": [
    {
      "@type": "OrderItem",
      "acceptedOffer": {
        "@type": "Offer",
        "@id": "https://localhost:5001/api/identifiers/session-series/1063#/offers/0",
        "allowCustomerCancellationFullRefund": false,
        "latestCancellationBeforeStartDate": "P1DT16H",
        "price": 0,
        "priceCurrency": "GBP"
      },
      "orderedItem": {
        "@type": "ScheduledSession",
        "@id": "https://localhost:5001/api/identifiers/scheduled-sessions/1063/events/10628",
        "startDate": "2024-04-05T15:20:08+00:00",
        "endDate": "2024-04-05T21:18:08+00:00",
        "superEvent": {
          "@type": "SessionSeries",
          "@id": "https://localhost:5001/api/identifiers/session-series/1063",
          "name": "Metal Walking",
          "activity": [
            {
              "@type": "Concept",
              "@id": "https://openactive.io/activity-list#6bdea630-ad22-4e58-98a3-bca26ee3f1da",
              "inScheme": "https://openactive.io/activity-list",
              "prefLabel": "Rave Fitness"
            }
          ],
          "location": {
            "@type": "Place",
            "identifier": 2,
            "name": "Premier Lifters",
            "description": "Where your Fitness Goals are Always Inn-Sight. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
            "address": {
              "@type": "PostalAddress",
              "addressCountry": "GB",
              "addressLocality": "Oxford",
              "addressRegion": "Oxfordshire",
              "postalCode": "OX1 1BB",
              "streetAddress": "Greyfriars Court, Paradise Square"
            },
            "amenityFeature": [
              {
                "@type": "ChangingFacilities",
                "name": "Changing Facilities",
                "value": false
              },
              {
                "@type": "Showers",
                "name": "Showers",
                "value": false
              },
              {
                "@type": "Lockers",
                "name": "Lockers",
                "value": false
              },
              {
                "@type": "Towels",
                "name": "Towels",
                "value": true
              },
              {
                "@type": "Creche",
                "name": "Creche",
                "value": true
              },
              {
                "@type": "Parking",
                "name": "Parking",
                "value": true
              }
            ],
            "geo": {
              "@type": "GeoCoordinates",
              "latitude": 51.7504933,
              "longitude": -1.2620685
            },
            "image": [
              {
                "@type": "ImageObject",
                "url": "https://upload.wikimedia.org/wikipedia/commons/5/53/Cambridge_Orchard_Park_Premier_Inn.jpg"
              }
            ],
            "telephone": "01865 000002",
            "url": "https://en.wikipedia.org/wiki/Premier_Inn"
          },
          "url": "https://example.com/events/1063"
        },
        "maximumAttendeeCapacity": 32,
        "remainingAttendeeCapacity": 32
      },
      "position": 0,
      "unitTaxSpecification": [
        {
          "@type": "TaxChargeSpecification",
          "name": "VAT at 20%",
          "price": 0,
          "priceCurrency": "GBP",
          "rate": 0.2
        }
      ]
    }
  ],
  "seller": {
    "@type": "Organization",
    "@id": "https://localhost:5001/api/identifiers/sellers/1",
    "name": "Acme Fitness Ltd",
    "address": {
      "@type": "PostalAddress",
      "addressCountry": "GB",
      "addressLocality": "Another town",
      "addressRegion": "Oxfordshire",
      "postalCode": "OX1 1AA",
      "streetAddress": "1 Hidden Gem"
    },
    "isOpenBookingAllowed": true,
    "legalName": "Acme Fitness Ltd",
    "taxMode": "https://openactive.io/TaxGross",
    "termsOfService": [
      {
        "@type": "PrivacyPolicy",
        "name": "Privacy Policy",
        "requiresExplicitConsent": false,
        "url": "https://example.com/privacy.html"
      }
    ]
  },
  "totalPaymentDue": {
    "@type": "PriceSpecification",
    "openBookingPrepayment": "https://openactive.io/Unavailable",
    "price": 0,
    "priceCurrency": "GBP"
  },
  "totalPaymentTax": [
    {
      "@type": "TaxChargeSpecification",
      "name": "VAT at 20%",
      "price": 0,
      "priceCurrency": "GBP",
      "rate": 0.2
    }
  ]
}

Specs

✅ C1 >> validation of C1

Specs

Validations

✅ Assert Opportunity Capacity (after C1)

Opportunity Feed extract for OrderItem 0 Request

GET http://localhost:3000/opportunity/https%3A%2F%2Flocalhost%3A5001%2Fapi%2Fidentifiers%2Fscheduled-sessions%2F1063%2Fevents%2F10628?useCacheIfAvailable=true&expectedCapacity=31


Response status code: 200 OK. Responded in 123.006035ms.

{
  "state": "updated",
  "id": "https://localhost:5001/api/identifiers/scheduled-sessions/1063/events/10628",
  "modified": "1711551965982",
  "data": {
    "@context": [
      "https://openactive.io/"
    ],
    "@type": "ScheduledSession",
    "@id": "https://localhost:5001/api/identifiers/scheduled-sessions/1063/events/10628",
    "startDate": "2024-04-05T15:20:08+00:00",
    "endDate": "2024-04-05T21:18:08+00:00",
    "superEvent": {
      "@type": "SessionSeries",
      "@id": "https://localhost:5001/api/identifiers/session-series/1063",
      "name": "Metal Walking",
      "activity": [
        {
          "@type": "Concept",
          "@id": "https://openactive.io/activity-list#c07d63a0-8eb9-4602-8bcc-23be6deb8f83",
          "inScheme": "https://openactive.io/activity-list",
          "prefLabel": "Jet Skiing"
        }
      ],
      "eventAttendanceMode": "https://schema.org/OfflineEventAttendanceMode",
      "location": {
        "@type": "Place",
        "identifier": 2,
        "name": "Premier Lifters",
        "description": "Where your Fitness Goals are Always Inn-Sight. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
        "address": {
          "@type": "PostalAddress",
          "addressCountry": "GB",
          "addressLocality": "Oxford",
          "addressRegion": "Oxfordshire",
          "postalCode": "OX1 1BB",
          "streetAddress": "Greyfriars Court, Paradise Square"
        },
        "amenityFeature": [
          {
            "@type": "ChangingFacilities",
            "name": "Changing Facilities",
            "value": false
          },
          {
            "@type": "Showers",
            "name": "Showers",
            "value": false
          },
          {
            "@type": "Lockers",
            "name": "Lockers",
            "value": false
          },
          {
            "@type": "Towels",
            "name": "Towels",
            "value": true
          },
          {
            "@type": "Creche",
            "name": "Creche",
            "value": true
          },
          {
            "@type": "Parking",
            "name": "Parking",
            "value": true
          }
        ],
        "geo": {
          "@type": "GeoCoordinates",
          "latitude": 51.7504933,
          "longitude": -1.2620685
        },
        "image": [
          {
            "@type": "ImageObject",
            "url": "https://upload.wikimedia.org/wikipedia/commons/5/53/Cambridge_Orchard_Park_Premier_Inn.jpg"
          }
        ],
        "telephone": "01865 000002",
        "url": "https://en.wikipedia.org/wiki/Premier_Inn"
      },
      "offers": [
        {
          "@type": "Offer",
          "@id": "https://localhost:5001/api/identifiers/session-series/1063#/offers/0",
          "allowCustomerCancellationFullRefund": false,
          "latestCancellationBeforeStartDate": "P1DT16H",
          "openBookingFlowRequirement": [
            "https://openactive.io/OpenBookingApproval"
          ],
          "price": 0,
          "priceCurrency": "GBP"
        }
      ],
      "organizer": {
        "@type": "Organization",
        "@id": "https://localhost:5001/api/identifiers/sellers/1",
        "name": "Acme Fitness Ltd",
        "isOpenBookingAllowed": true,
        "taxMode": "https://openactive.io/TaxGross",
        "termsOfService": [
          {
            "@type": "PrivacyPolicy",
            "name": "Privacy Policy",
            "requiresExplicitConsent": false,
            "url": "https://example.com/privacy.html"
          }
        ]
      },
      "url": "https://www.example.com/a-session-age"
    },
    "duration": "PT5H58M",
    "maximumAttendeeCapacity": 32,
    "remainingAttendeeCapacity": 31
  }
}

Specs

✅ Assert Opportunity Capacity (after C1) >> validation of Opportunity Feed extract for OrderItem 0

Specs

Validations

✅ C2

C2 Request

PUT https://localhost:5001/api/openbooking/order-quotes/edde2935-0863-4978-b698-57cdb1e536a6

{
  "@context": "https://openactive.io/",
  "@type": "OrderQuote",
  "brokerRole": "https://openactive.io/AgentBroker",
  "broker": {
    "@type": "Organization",
    "name": "MyFitnessApp",
    "url": "https://myfitnessapp.example.com",
    "description": "A fitness app for all the community",
    "logo": {
      "@type": "ImageObject",
      "url": "http://data.myfitnessapp.org.uk/images/logo.png"
    },
    "address": {
      "@type": "PostalAddress",
      "streetAddress": "Alan Peacock Way",
      "addressLocality": "Village East",
      "addressRegion": "Middlesbrough",
      "postalCode": "TS4 3AE",
      "addressCountry": "GB"
    }
  },
  "seller": "https://localhost:5001/api/identifiers/sellers/1",
  "customer": {
    "@type": "Person",
    "email": "[email protected]",
    "givenName": "Blick"
  },
  "orderedItem": [
    {
      "@type": "OrderItem",
      "position": 0,
      "acceptedOffer": "https://localhost:5001/api/identifiers/session-series/1063#/offers/0",
      "orderedItem": "https://localhost:5001/api/identifiers/scheduled-sessions/1063/events/10628"
    }
  ],
  "payment": {
    "@type": "Payment",
    "name": "AcmeBroker Points",
    "accountId": "SN1593",
    "paymentProviderId": "STRIPE"
  }
}

Response status code: 200 OK. Responded in 35.033225ms.

{
  "@context": "https://openactive.io/",
  "@type": "OrderQuote",
  "@id": "https://localhost:5001/api/openbooking/order-quotes/edde2935-0863-4978-b698-57cdb1e536a6",
  "lease": {
    "@type": "Lease",
    "leaseExpires": "2024-03-27T15:11:05+00:00"
  },
  "orderRequiresApproval": true,
  "bookingService": {
    "@type": "BookingService",
    "name": "Acme booking system",
    "termsOfService": [
      {
        "@type": "PrivacyPolicy",
        "name": "Privacy Policy",
        "requiresExplicitConsent": false,
        "url": "https://example.com/privacy.html"
      }
    ],
    "url": "https://example.com"
  },
  "broker": {
    "@type": "Organization",
    "name": "MyFitnessApp",
    "url": "https://myfitnessapp.example.com"
  },
  "brokerRole": "https://openactive.io/AgentBroker",
  "customer": {
    "@type": "Person",
    "email": "[email protected]",
    "givenName": "Blick"
  },
  "orderedItem": [
    {
      "@type": "OrderItem",
      "acceptedOffer": {
        "@type": "Offer",
        "@id": "https://localhost:5001/api/identifiers/session-series/1063#/offers/0",
        "allowCustomerCancellationFullRefund": false,
        "latestCancellationBeforeStartDate": "P1DT16H",
        "price": 0,
        "priceCurrency": "GBP"
      },
      "orderedItem": {
        "@type": "ScheduledSession",
        "@id": "https://localhost:5001/api/identifiers/scheduled-sessions/1063/events/10628",
        "startDate": "2024-04-05T15:20:08+00:00",
        "endDate": "2024-04-05T21:18:08+00:00",
        "superEvent": {
          "@type": "SessionSeries",
          "@id": "https://localhost:5001/api/identifiers/session-series/1063",
          "name": "Metal Walking",
          "activity": [
            {
              "@type": "Concept",
              "@id": "https://openactive.io/activity-list#6bdea630-ad22-4e58-98a3-bca26ee3f1da",
              "inScheme": "https://openactive.io/activity-list",
              "prefLabel": "Rave Fitness"
            }
          ],
          "location": {
            "@type": "Place",
            "identifier": 2,
            "name": "Premier Lifters",
            "description": "Where your Fitness Goals are Always Inn-Sight. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
            "address": {
              "@type": "PostalAddress",
              "addressCountry": "GB",
              "addressLocality": "Oxford",
              "addressRegion": "Oxfordshire",
              "postalCode": "OX1 1BB",
              "streetAddress": "Greyfriars Court, Paradise Square"
            },
            "amenityFeature": [
              {
                "@type": "ChangingFacilities",
                "name": "Changing Facilities",
                "value": false
              },
              {
                "@type": "Showers",
                "name": "Showers",
                "value": false
              },
              {
                "@type": "Lockers",
                "name": "Lockers",
                "value": false
              },
              {
                "@type": "Towels",
                "name": "Towels",
                "value": true
              },
              {
                "@type": "Creche",
                "name": "Creche",
                "value": true
              },
              {
                "@type": "Parking",
                "name": "Parking",
                "value": true
              }
            ],
            "geo": {
              "@type": "GeoCoordinates",
              "latitude": 51.7504933,
              "longitude": -1.2620685
            },
            "image": [
              {
                "@type": "ImageObject",
                "url": "https://upload.wikimedia.org/wikipedia/commons/5/53/Cambridge_Orchard_Park_Premier_Inn.jpg"
              }
            ],
            "telephone": "01865 000002",
            "url": "https://en.wikipedia.org/wiki/Premier_Inn"
          },
          "url": "https://example.com/events/1063"
        },
        "maximumAttendeeCapacity": 32,
        "remainingAttendeeCapacity": 32
      },
      "position": 0,
      "unitTaxSpecification": [
        {
          "@type": "TaxChargeSpecification",
          "name": "VAT at 20%",
          "price": 0,
          "priceCurrency": "GBP",
          "rate": 0.2
        }
      ]
    }
  ],
  "seller": {
    "@type": "Organization",
    "@id": "https://localhost:5001/api/identifiers/sellers/1",
    "name": "Acme Fitness Ltd",
    "address": {
      "@type": "PostalAddress",
      "addressCountry": "GB",
      "addressLocality": "Another town",
      "addressRegion": "Oxfordshire",
      "postalCode": "OX1 1AA",
      "streetAddress": "1 Hidden Gem"
    },
    "isOpenBookingAllowed": true,
    "legalName": "Acme Fitness Ltd",
    "taxMode": "https://openactive.io/TaxGross",
    "termsOfService": [
      {
        "@type": "PrivacyPolicy",
        "name": "Privacy Policy",
        "requiresExplicitConsent": false,
        "url": "https://example.com/privacy.html"
      }
    ]
  },
  "totalPaymentDue": {
    "@type": "PriceSpecification",
    "openBookingPrepayment": "https://openactive.io/Unavailable",
    "price": 0,
    "priceCurrency": "GBP"
  },
  "totalPaymentTax": [
    {
      "@type": "TaxChargeSpecification",
      "name": "VAT at 20%",
      "price": 0,
      "priceCurrency": "GBP",
      "rate": 0.2
    }
  ]
}

Specs

✅ C2 >> validation of C2

Specs

Validations

✅ Assert Opportunity Capacity (after C2)

Opportunity Feed extract for OrderItem 0 Request

GET http://localhost:3000/opportunity/https%3A%2F%2Flocalhost%3A5001%2Fapi%2Fidentifiers%2Fscheduled-sessions%2F1063%2Fevents%2F10628?useCacheIfAvailable=true&expectedCapacity=31


Response status code: 200 OK. Responded in 3.279026ms.

{
  "data": {
    "@context": [
      "https://openactive.io/"
    ],
    "@type": "ScheduledSession",
    "@id": "https://localhost:5001/api/identifiers/scheduled-sessions/1063/events/10628",
    "startDate": "2024-04-05T15:20:08+00:00",
    "endDate": "2024-04-05T21:18:08+00:00",
    "superEvent": {
      "@type": "SessionSeries",
      "@id": "https://localhost:5001/api/identifiers/session-series/1063",
      "name": "Metal Walking",
      "activity": [
        {
          "@type": "Concept",
          "@id": "https://openactive.io/activity-list#c07d63a0-8eb9-4602-8bcc-23be6deb8f83",
          "inScheme": "https://openactive.io/activity-list",
          "prefLabel": "Jet Skiing"
        }
      ],
      "eventAttendanceMode": "https://schema.org/OfflineEventAttendanceMode",
      "location": {
        "@type": "Place",
        "identifier": 2,
        "name": "Premier Lifters",
        "description": "Where your Fitness Goals are Always Inn-Sight. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
        "address": {
          "@type": "PostalAddress",
          "addressCountry": "GB",
          "addressLocality": "Oxford",
          "addressRegion": "Oxfordshire",
          "postalCode": "OX1 1BB",
          "streetAddress": "Greyfriars Court, Paradise Square"
        },
        "amenityFeature": [
          {
            "@type": "ChangingFacilities",
            "name": "Changing Facilities",
            "value": false
          },
          {
            "@type": "Showers",
            "name": "Showers",
            "value": false
          },
          {
            "@type": "Lockers",
            "name": "Lockers",
            "value": false
          },
          {
            "@type": "Towels",
            "name": "Towels",
            "value": true
          },
          {
            "@type": "Creche",
            "name": "Creche",
            "value": true
          },
          {
            "@type": "Parking",
            "name": "Parking",
            "value": true
          }
        ],
        "geo": {
          "@type": "GeoCoordinates",
          "latitude": 51.7504933,
          "longitude": -1.2620685
        },
        "image": [
          {
            "@type": "ImageObject",
            "url": "https://upload.wikimedia.org/wikipedia/commons/5/53/Cambridge_Orchard_Park_Premier_Inn.jpg"
          }
        ],
        "telephone": "01865 000002",
        "url": "https://en.wikipedia.org/wiki/Premier_Inn"
      },
      "offers": [
        {
          "@type": "Offer",
          "@id": "https://localhost:5001/api/identifiers/session-series/1063#/offers/0",
          "allowCustomerCancellationFullRefund": false,
          "latestCancellationBeforeStartDate": "P1DT16H",
          "openBookingFlowRequirement": [
            "https://openactive.io/OpenBookingApproval"
          ],
          "price": 0,
          "priceCurrency": "GBP"
        }
      ],
      "organizer": {
        "@type": "Organization",
        "@id": "https://localhost:5001/api/identifiers/sellers/1",
        "name": "Acme Fitness Ltd",
        "isOpenBookingAllowed": true,
        "taxMode": "https://openactive.io/TaxGross",
        "termsOfService": [
          {
            "@type": "PrivacyPolicy",
            "name": "Privacy Policy",
            "requiresExplicitConsent": false,
            "url": "https://example.com/privacy.html"
          }
        ]
      },
      "url": "https://www.example.com/a-session-age"
    },
    "duration": "PT5H58M",
    "maximumAttendeeCapacity": 32,
    "remainingAttendeeCapacity": 31
  }
}

Specs

✅ Assert Opportunity Capacity (after C2) >> validation of Opportunity Feed extract for OrderItem 0

Specs

Validations

✅ P

P Request

PUT https://localhost:5001/api/openbooking/order-proposals/edde2935-0863-4978-b698-57cdb1e536a6

{
  "@context": "https://openactive.io/",
  "@type": "OrderProposal",
  "brokerRole": "https://openactive.io/AgentBroker",
  "broker": {
    "@type": "Organization",
    "name": "MyFitnessApp",
    "url": "https://myfitnessapp.example.com",
    "description": "A fitness app for all the community",
    "logo": {
      "@type": "ImageObject",
      "url": "http://data.myfitnessapp.org.uk/images/logo.png"
    },
    "address": {
      "@type": "PostalAddress",
      "streetAddress": "Alan Peacock Way",
      "addressLocality": "Village East",
      "addressRegion": "Middlesbrough",
      "postalCode": "TS4 3AE",
      "addressCountry": "GB"
    }
  },
  "seller": "https://localhost:5001/api/identifiers/sellers/1",
  "customer": {
    "@type": "Person",
    "email": "[email protected]",
    "givenName": "Blick"
  },
  "orderedItem": [
    {
      "@type": "OrderItem",
      "position": 0,
      "acceptedOffer": "https://localhost:5001/api/identifiers/session-series/1063#/offers/0",
      "orderedItem": "https://localhost:5001/api/identifiers/scheduled-sessions/1063/events/10628"
    }
  ],
  "totalPaymentDue": {
    "@type": "PriceSpecification",
    "price": 0,
    "priceCurrency": "GBP"
  }
}

Response status code: 201 Created. Responded in 166.055417ms.

{
  "@context": "https://openactive.io/",
  "@type": "OrderProposal",
  "@id": "https://localhost:5001/api/openbooking/order-proposals/edde2935-0863-4978-b698-57cdb1e536a6",
  "orderProposalStatus": "https://openactive.io/AwaitingSellerConfirmation",
  "bookingService": {
    "@type": "BookingService",
    "name": "Acme booking system",
    "termsOfService": [
      {
        "@type": "PrivacyPolicy",
        "name": "Privacy Policy",
        "requiresExplicitConsent": false,
        "url": "https://example.com/privacy.html"
      }
    ],
    "url": "https://example.com"
  },
  "broker": {
    "@type": "Organization",
    "name": "MyFitnessApp",
    "url": "https://myfitnessapp.example.com"
  },
  "brokerRole": "https://openactive.io/AgentBroker",
  "customer": {
    "@type": "Person",
    "email": "[email protected]",
    "givenName": "Blick"
  },
  "orderedItem": [
    {
      "@type": "OrderItem",
      "@id": "https://localhost:5001/api/openbooking/orders/edde2935-0863-4978-b698-57cdb1e536a6#/orderedItems/439",
      "acceptedOffer": {
        "@type": "Offer",
        "@id": "https://localhost:5001/api/identifiers/session-series/1063#/offers/0",
        "allowCustomerCancellationFullRefund": false,
        "latestCancellationBeforeStartDate": "P1DT16H",
        "price": 0,
        "priceCurrency": "GBP"
      },
      "orderedItem": {
        "@type": "ScheduledSession",
        "@id": "https://localhost:5001/api/identifiers/scheduled-sessions/1063/events/10628",
        "startDate": "2024-04-05T15:20:08+00:00",
        "endDate": "2024-04-05T21:18:08+00:00",
        "superEvent": {
          "@type": "SessionSeries",
          "@id": "https://localhost:5001/api/identifiers/session-series/1063",
          "name": "Metal Walking",
          "activity": [
            {
              "@type": "Concept",
              "@id": "https://openactive.io/activity-list#6bdea630-ad22-4e58-98a3-bca26ee3f1da",
              "inScheme": "https://openactive.io/activity-list",
              "prefLabel": "Rave Fitness"
            }
          ],
          "location": {
            "@type": "Place",
            "identifier": 2,
            "name": "Premier Lifters",
            "description": "Where your Fitness Goals are Always Inn-Sight. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
            "address": {
              "@type": "PostalAddress",
              "addressCountry": "GB",
              "addressLocality": "Oxford",
              "addressRegion": "Oxfordshire",
              "postalCode": "OX1 1BB",
              "streetAddress": "Greyfriars Court, Paradise Square"
            },
            "amenityFeature": [
              {
                "@type": "ChangingFacilities",
                "name": "Changing Facilities",
                "value": false
              },
              {
                "@type": "Showers",
                "name": "Showers",
                "value": false
              },
              {
                "@type": "Lockers",
                "name": "Lockers",
                "value": false
              },
              {
                "@type": "Towels",
                "name": "Towels",
                "value": true
              },
              {
                "@type": "Creche",
                "name": "Creche",
                "value": true
              },
              {
                "@type": "Parking",
                "name": "Parking",
                "value": true
              }
            ],
            "geo": {
              "@type": "GeoCoordinates",
              "latitude": 51.7504933,
              "longitude": -1.2620685
            },
            "image": [
              {
                "@type": "ImageObject",
                "url": "https://upload.wikimedia.org/wikipedia/commons/5/53/Cambridge_Orchard_Park_Premier_Inn.jpg"
              }
            ],
            "telephone": "01865 000002",
            "url": "https://en.wikipedia.org/wiki/Premier_Inn"
          },
          "url": "https://example.com/events/1063"
        },
        "maximumAttendeeCapacity": 32,
        "remainingAttendeeCapacity": 32
      },
      "position": 0,
      "unitTaxSpecification": [
        {
          "@type": "TaxChargeSpecification",
          "name": "VAT at 20%",
          "price": 0,
          "priceCurrency": "GBP",
          "rate": 0.2
        }
      ]
    }
  ],
  "orderProposalVersion": "https://localhost:5001/api/openbooking/order-proposals/edde2935-0863-4978-b698-57cdb1e536a6/versions/a1805f93-3bef-4c38-8e9f-104be9bc7029",
  "seller": {
    "@type": "Organization",
    "@id": "https://localhost:5001/api/identifiers/sellers/1",
    "name": "Acme Fitness Ltd",
    "address": {
      "@type": "PostalAddress",
      "addressCountry": "GB",
      "addressLocality": "Another town",
      "addressRegion": "Oxfordshire",
      "postalCode": "OX1 1AA",
      "streetAddress": "1 Hidden Gem"
    },
    "isOpenBookingAllowed": true,
    "legalName": "Acme Fitness Ltd",
    "taxMode": "https://openactive.io/TaxGross",
    "termsOfService": [
      {
        "@type": "PrivacyPolicy",
        "name": "Privacy Policy",
        "requiresExplicitConsent": false,
        "url": "https://example.com/privacy.html"
      }
    ]
  },
  "totalPaymentDue": {
    "@type": "PriceSpecification",
    "openBookingPrepayment": "https://openactive.io/Unavailable",
    "price": 0,
    "priceCurrency": "GBP"
  },
  "totalPaymentTax": [
    {
      "@type": "TaxChargeSpecification",
      "name": "VAT at 20%",
      "price": 0,
      "priceCurrency": "GBP",
      "rate": 0.2
    }
  ]
}

Specs

✅ P >> validation of P

Specs

Validations

✅ Simulate Seller Approval (Test Interface Action)

Orders (order-proposals) Feed listen for 'edde2935-0863-4978-b698-57cdb1e536a6' change (auth: primary) Request

POST http://localhost:3000/order-listeners/order-proposals/primary/edde2935-0863-4978-b698-57cdb1e536a6


Response status code: 200 OK. Responded in 3.721759ms.

{
  "headers": {
    "Accept": "application/json, application/vnd.openactive.booking+json; version=1",
    "Cache-Control": "max-age=0",
    "Authorization": "Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IkIwNEY3QjkxREUzQjk0NzhDNjE4MzNGQjI0QUE1Q0RCIiwidHlwIjoiYXQrand0In0.eyJuYmYiOjE3MTE1NTE1NTAsImV4cCI6MTcxMTU1NTE1MCwiaXNzIjoiaHR0cHM6Ly9sb2NhbGhvc3Q6NTAwMyIsImF1ZCI6Im9wZW5ib29raW5nIiwiY2xpZW50X2lkIjoiNWU3ZTc3YzEtZjNmOS00NDdlLWJlYmItNTMzNTE5ZTVmMDUwIiwiaHR0cHM6Ly9vcGVuYWN0aXZlLmlvL2NsaWVudElkIjoiNWU3ZTc3YzEtZjNmOS00NDdlLWJlYmItNTMzNTE5ZTVmMDUwIiwianRpIjoiRkE0MjgzRDQ0MDA3MUY5RjZFRTBDNDM3QTE0QjVCOTYiLCJpYXQiOjE3MTE1NTE1NTAsInNjb3BlIjpbIm9wZW5hY3RpdmUtb3JkZXJzZmVlZCJdfQ.m24ax6vRnSWEdSqTa1JORrPBwxjxlXZGRKgd-hMO1LPlNkNzTnVprhPgiCuWbAZSC-slvUhRw9Q212agkZVOnPHvXlUUsv0vPknga-eL2-LS9zARQxAeSxfgVPRZ_BYXXKoXYKxvdvOXxE5FnNTPuE7hv4rILZlFJdYBty8LSpWpTKAglq5jAZo0XcJPudTpam31wX7J_NUinYlQu180xcgIt4D5Tn5QbKC29T8-CqfdGnfvs_Izd0Yi_y4uOQqR5Znu-isr5-BxcqWIB3-SoZrz9twaW544KZTZ0rrz4ppNkm37blFWDyNLiLq-2GCsJZmjQoBb3hC1_6yukYXYmA"
  },
  "startingFeedPage": "https://localhost:5001/api/openbooking/order-proposals-rpde?afterTimestamp=638471487631947991&afterId=fd75d8be-20fc-4a5f-837a-7d8aaff196a5",
  "message": "Listening for UUID: 'edde2935-0863-4978-b698-57cdb1e536a6' in feed: order-proposals, for Booking Partner: primary from startingFeedPage using headers"
}

Call TestInterface Action of type: test:SellerAcceptOrderProposalSimulateAction Request

POST https://localhost:5001/api/openbooking/test-interface/actions

{
  "@context": [
    "https://openactive.io/",
    "https://openactive.io/test-interface"
  ],
  "@type": "test:SellerAcceptOrderProposalSimulateAction",
  "object": {
    "@type": "OrderProposal",
    "@id": "https://localhost:5001/api/openbooking/order-proposals/edde2935-0863-4978-b698-57cdb1e536a6"
  }
}

Response status code: 204 No Content. Responded in 23.230285ms.

Specs

✅ OrderProposal Feed Update (after Simulate Seller Approval)

Orders (order-proposals) Feed collect for 'edde2935-0863-4978-b698-57cdb1e536a6' change (auth: primary) Request

GET http://localhost:3000/order-listeners/order-proposals/primary/edde2935-0863-4978-b698-57cdb1e536a6


Response status code: 200 OK. Responded in 2341.53248ms.

{
  "state": "updated",
  "kind": "Order",
  "id": "edde2935-0863-4978-b698-57cdb1e536a6",
  "modified": "638471487655338953",
  "data": {
    "@context": "https://openactive.io/",
    "@type": "OrderProposal",
    "@id": "https://localhost:5001/api/openbooking/order-proposals/edde2935-0863-4978-b698-57cdb1e536a6",
    "identifier": "edde2935-0863-4978-b698-57cdb1e536a6",
    "orderProposalStatus": "https://openactive.io/SellerAccepted",
    "orderedItem": [
      {
        "@type": "OrderItem",
        "@id": "https://localhost:5001/api/openbooking/orders/edde2935-0863-4978-b698-57cdb1e536a6#/orderedItems/439",
        "acceptedOffer": {
          "@type": "Offer",
          "@id": "https://localhost:5001/api/identifiers/session-series/1063#/offers/0",
          "price": 0,
          "priceCurrency": "GBP"
        },
        "orderedItem": "https://localhost:5001/api/identifiers/scheduled-sessions/1063/events/10628"
      }
    ],
    "orderProposalVersion": "https://localhost:5001/api/openbooking/order-proposals/edde2935-0863-4978-b698-57cdb1e536a6/versions/a1805f93-3bef-4c38-8e9f-104be9bc7029",
    "totalPaymentDue": {
      "@type": "PriceSpecification",
      "openBookingPrepayment": "https://openactive.io/Unavailable",
      "price": 0,
      "priceCurrency": "GBP"
    }
  }
}

Specs

✅ OrderProposal Feed Update (after Simulate Seller Approval) >> validation of OrderFeed

Specs

Validations

✅ B

Orders (order-proposals) Feed listen for 'edde2935-0863-4978-b698-57cdb1e536a6' change (auth: primary) Request

POST http://localhost:3000/order-listeners/order-proposals/primary/edde2935-0863-4978-b698-57cdb1e536a6


Response status code: 200 OK. Responded in 23.686071ms.

{
  "headers": {
    "Accept": "application/json, application/vnd.openactive.booking+json; version=1",
    "Cache-Control": "max-age=0",
    "Authorization": "Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IkIwNEY3QjkxREUzQjk0NzhDNjE4MzNGQjI0QUE1Q0RCIiwidHlwIjoiYXQrand0In0.eyJuYmYiOjE3MTE1NTE1NTAsImV4cCI6MTcxMTU1NTE1MCwiaXNzIjoiaHR0cHM6Ly9sb2NhbGhvc3Q6NTAwMyIsImF1ZCI6Im9wZW5ib29raW5nIiwiY2xpZW50X2lkIjoiNWU3ZTc3YzEtZjNmOS00NDdlLWJlYmItNTMzNTE5ZTVmMDUwIiwiaHR0cHM6Ly9vcGVuYWN0aXZlLmlvL2NsaWVudElkIjoiNWU3ZTc3YzEtZjNmOS00NDdlLWJlYmItNTMzNTE5ZTVmMDUwIiwianRpIjoiRkE0MjgzRDQ0MDA3MUY5RjZFRTBDNDM3QTE0QjVCOTYiLCJpYXQiOjE3MTE1NTE1NTAsInNjb3BlIjpbIm9wZW5hY3RpdmUtb3JkZXJzZmVlZCJdfQ.m24ax6vRnSWEdSqTa1JORrPBwxjxlXZGRKgd-hMO1LPlNkNzTnVprhPgiCuWbAZSC-slvUhRw9Q212agkZVOnPHvXlUUsv0vPknga-eL2-LS9zARQxAeSxfgVPRZ_BYXXKoXYKxvdvOXxE5FnNTPuE7hv4rILZlFJdYBty8LSpWpTKAglq5jAZo0XcJPudTpam31wX7J_NUinYlQu180xcgIt4D5Tn5QbKC29T8-CqfdGnfvs_Izd0Yi_y4uOQqR5Znu-isr5-BxcqWIB3-SoZrz9twaW544KZTZ0rrz4ppNkm37blFWDyNLiLq-2GCsJZmjQoBb3hC1_6yukYXYmA"
  },
  "startingFeedPage": "https://localhost:5001/api/openbooking/order-proposals-rpde?afterTimestamp=638471487655338953&afterId=edde2935-0863-4978-b698-57cdb1e536a6",
  "message": "Listening for UUID: 'edde2935-0863-4978-b698-57cdb1e536a6' in feed: order-proposals, for Booking Partner: primary from startingFeedPage using headers"
}

B Request

PUT https://localhost:5001/api/openbooking/orders/edde2935-0863-4978-b698-57cdb1e536a6

{
  "@context": "https://openactive.io/",
  "@type": "Order",
  "orderProposalVersion": "https://localhost:5001/api/openbooking/order-proposals/edde2935-0863-4978-b698-57cdb1e536a6/versions/a1805f93-3bef-4c38-8e9f-104be9bc7029"
}

Response status code: 201 Created. Responded in 69.409694ms.

{
  "@context": [
    "https://openactive.io/",
    "https://openactive.io/ns-beta"
  ],
  "@type": "Order",
  "@id": "https://localhost:5001/api/openbooking/orders/edde2935-0863-4978-b698-57cdb1e536a6",
  "identifier": "edde2935-0863-4978-b698-57cdb1e536a6",
  "bookingService": {
    "@type": "BookingService",
    "name": "Acme booking system",
    "termsOfService": [
      {
        "@type": "PrivacyPolicy",
        "name": "Privacy Policy",
        "requiresExplicitConsent": false,
        "url": "https://example.com/privacy.html"
      }
    ],
    "url": "https://example.com"
  },
  "broker": {
    "@type": "Organization",
    "name": "MyFitnessApp",
    "url": "https://myfitnessapp.example.com/"
  },
  "brokerRole": "https://openactive.io/AgentBroker",
  "customer": {
    "@type": "Person",
    "email": "[email protected]",
    "givenName": "Blick"
  },
  "orderedItem": [
    {
      "@type": "OrderItem",
      "@id": "https://localhost:5001/api/openbooking/orders/edde2935-0863-4978-b698-57cdb1e536a6#/orderedItems/439",
      "acceptedOffer": {
        "@type": "Offer",
        "@id": "https://localhost:5001/api/identifiers/session-series/1063#/offers/0",
        "allowCustomerCancellationFullRefund": false,
        "latestCancellationBeforeStartDate": "P1DT16H",
        "price": 0,
        "priceCurrency": "GBP"
      },
      "accessCode": [
        {
          "@type": "PropertyValue",
          "name": "Pin Code",
          "description": "594511"
        }
      ],
      "accessPass": [
        {
          "@type": "ImageObject",
          "url": "https://via.placeholder.com/25x25/cccccc/9c9c9c.png"
        },
        {
          "@type": "Barcode",
          "text": "6722755032",
          "url": "https://via.placeholder.com/25x25/cccccc/9c9c9c.png",
          "beta:codeType": "code128"
        }
      ],
      "orderedItem": {
        "@type": "ScheduledSession",
        "@id": "https://localhost:5001/api/identifiers/scheduled-sessions/1063/events/10628",
        "startDate": "2024-04-05T15:20:08+00:00",
        "endDate": "2024-04-05T21:18:08+00:00",
        "superEvent": {
          "@type": "SessionSeries",
          "@id": "https://localhost:5001/api/identifiers/session-series/1063",
          "name": "Metal Walking",
          "activity": [
            {
              "@type": "Concept",
              "@id": "https://openactive.io/activity-list#6bdea630-ad22-4e58-98a3-bca26ee3f1da",
              "inScheme": "https://openactive.io/activity-list",
              "prefLabel": "Rave Fitness"
            }
          ],
          "location": {
            "@type": "Place",
            "identifier": 2,
            "name": "Premier Lifters",
            "description": "Where your Fitness Goals are Always Inn-Sight. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
            "address": {
              "@type": "PostalAddress",
              "addressCountry": "GB",
              "addressLocality": "Oxford",
              "addressRegion": "Oxfordshire",
              "postalCode": "OX1 1BB",
              "streetAddress": "Greyfriars Court, Paradise Square"
            },
            "amenityFeature": [
              {
                "@type": "ChangingFacilities",
                "name": "Changing Facilities",
                "value": false
              },
              {
                "@type": "Showers",
                "name": "Showers",
                "value": false
              },
              {
                "@type": "Lockers",
                "name": "Lockers",
                "value": false
              },
              {
                "@type": "Towels",
                "name": "Towels",
                "value": true
              },
              {
                "@type": "Creche",
                "name": "Creche",
                "value": true
              },
              {
                "@type": "Parking",
                "name": "Parking",
                "value": true
              }
            ],
            "geo": {
              "@type": "GeoCoordinates",
              "latitude": 51.7504933,
              "longitude": -1.2620685
            },
            "image": [
              {
                "@type": "ImageObject",
                "url": "https://upload.wikimedia.org/wikipedia/commons/5/53/Cambridge_Orchard_Park_Premier_Inn.jpg"
              }
            ],
            "telephone": "01865 000002",
            "url": "https://en.wikipedia.org/wiki/Premier_Inn"
          },
          "url": "https://example.com/events/1063"
        },
        "maximumAttendeeCapacity": 32,
        "remainingAttendeeCapacity": 32
      },
      "orderItemStatus": "https://openactive.io/OrderItemConfirmed",
      "unitTaxSpecification": [
        {
          "@type": "TaxChargeSpecification",
          "name": "VAT at 20%",
          "price": 0,
          "priceCurrency": "GBP",
          "rate": 0.2
        }
      ]
    }
  ],
  "seller": {
    "@type": "Organization",
    "@id": "https://localhost:5001/api/identifiers/sellers/1",
    "name": "Acme Fitness Ltd",
    "address": {
      "@type": "PostalAddress",
      "addressCountry": "GB",
      "addressLocality": "Another town",
      "addressRegion": "Oxfordshire",
      "postalCode": "OX1 1AA",
      "streetAddress": "1 Hidden Gem"
    },
    "isOpenBookingAllowed": true,
    "legalName": "Acme Fitness Ltd",
    "taxMode": "https://openactive.io/TaxGross",
    "termsOfService": [
      {
        "@type": "PrivacyPolicy",
        "name": "Privacy Policy",
        "requiresExplicitConsent": false,
        "url": "https://example.com/privacy.html"
      }
    ]
  },
  "totalPaymentDue": {
    "@type": "PriceSpecification",
    "openBookingPrepayment": "https://openactive.io/Unavailable",
    "price": 0,
    "priceCurrency": "GBP"
  },
  "totalPaymentTax": [
    {
      "@type": "TaxChargeSpecification",
      "name": "VAT at 20%",
      "price": 0,
      "priceCurrency": "GBP",
      "rate": 0.2
    }
  ]
}

Specs

✅ B >> validation of B

Specs

Validations

✅ OrderProposal Feed Deletion (after B)

Orders (order-proposals) Feed collect for 'edde2935-0863-4978-b698-57cdb1e536a6' change (auth: primary) Request

GET http://localhost:3000/order-listeners/order-proposals/primary/edde2935-0863-4978-b698-57cdb1e536a6


Response status code: 200 OK. Responded in 1884.455747ms.

{
  "state": "deleted",
  "kind": "Order",
  "id": "edde2935-0863-4978-b698-57cdb1e536a6",
  "modified": "638471487679648186"
}

Specs

✅ OrderProposal Feed Deletion (after B) >> validation of OrderFeed

Specs

Validations

✅ Assert Opportunity Capacity (after OrderProposal Feed Deletion (after B))

Opportunity Feed extract for OrderItem 0 Request

GET http://localhost:3000/opportunity/https%3A%2F%2Flocalhost%3A5001%2Fapi%2Fidentifiers%2Fscheduled-sessions%2F1063%2Fevents%2F10628?useCacheIfAvailable=true&expectedCapacity=31


Response status code: 200 OK. Responded in 10.139839ms.

{
  "data": {
    "@context": [
      "https://openactive.io/"
    ],
    "@type": "ScheduledSession",
    "@id": "https://localhost:5001/api/identifiers/scheduled-sessions/1063/events/10628",
    "startDate": "2024-04-05T15:20:08+00:00",
    "endDate": "2024-04-05T21:18:08+00:00",
    "superEvent": {
      "@type": "SessionSeries",
      "@id": "https://localhost:5001/api/identifiers/session-series/1063",
      "name": "Metal Walking",
      "activity": [
        {
          "@type": "Concept",
          "@id": "https://openactive.io/activity-list#c07d63a0-8eb9-4602-8bcc-23be6deb8f83",
          "inScheme": "https://openactive.io/activity-list",
          "prefLabel": "Jet Skiing"
        }
      ],
      "eventAttendanceMode": "https://schema.org/OfflineEventAttendanceMode",
      "location": {
        "@type": "Place",
        "identifier": 2,
        "name": "Premier Lifters",
        "description": "Where your Fitness Goals are Always Inn-Sight. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
        "address": {
          "@type": "PostalAddress",
          "addressCountry": "GB",
          "addressLocality": "Oxford",
          "addressRegion": "Oxfordshire",
          "postalCode": "OX1 1BB",
          "streetAddress": "Greyfriars Court, Paradise Square"
        },
        "amenityFeature": [
          {
            "@type": "ChangingFacilities",
            "name": "Changing Facilities",
            "value": false
          },
          {
            "@type": "Showers",
            "name": "Showers",
            "value": false
          },
          {
            "@type": "Lockers",
            "name": "Lockers",
            "value": false
          },
          {
            "@type": "Towels",
            "name": "Towels",
            "value": true
          },
          {
            "@type": "Creche",
            "name": "Creche",
            "value": true
          },
          {
            "@type": "Parking",
            "name": "Parking",
            "value": true
          }
        ],
        "geo": {
          "@type": "GeoCoordinates",
          "latitude": 51.7504933,
          "longitude": -1.2620685
        },
        "image": [
          {
            "@type": "ImageObject",
            "url": "https://upload.wikimedia.org/wikipedia/commons/5/53/Cambridge_Orchard_Park_Premier_Inn.jpg"
          }
        ],
        "telephone": "01865 000002",
        "url": "https://en.wikipedia.org/wiki/Premier_Inn"
      },
      "offers": [
        {
          "@type": "Offer",
          "@id": "https://localhost:5001/api/identifiers/session-series/1063#/offers/0",
          "allowCustomerCancellationFullRefund": false,
          "latestCancellationBeforeStartDate": "P1DT16H",
          "openBookingFlowRequirement": [
            "https://openactive.io/OpenBookingApproval"
          ],
          "price": 0,
          "priceCurrency": "GBP"
        }
      ],
      "organizer": {
        "@type": "Organization",
        "@id": "https://localhost:5001/api/identifiers/sellers/1",
        "name": "Acme Fitness Ltd",
        "isOpenBookingAllowed": true,
        "taxMode": "https://openactive.io/TaxGross",
        "termsOfService": [
          {
            "@type": "PrivacyPolicy",
            "name": "Privacy Policy",
            "requiresExplicitConsent": false,
            "url": "https://example.com/privacy.html"
          }
        ]
      },
      "url": "https://www.example.com/a-session-age"
    },
    "duration": "PT5H58M",
    "maximumAttendeeCapacity": 32,
    "remainingAttendeeCapacity": 31
  }
}

Specs

✅ Assert Opportunity Capacity (after OrderProposal Feed Deletion (after B)) >> validation of Opportunity Feed extract for OrderItem 0

Specs

Validations

✅ Test Interface Action (test:ReplacementSimulateAction)

Orders (orders) Feed listen for 'edde2935-0863-4978-b698-57cdb1e536a6' change (auth: primary) Request

POST http://localhost:3000/order-listeners/orders/primary/edde2935-0863-4978-b698-57cdb1e536a6


Response status code: 200 OK. Responded in 3.226788ms.

{
  "headers": {
    "Accept": "application/json, application/vnd.openactive.booking+json; version=1",
    "Cache-Control": "max-age=0",
    "Authorization": "Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IkIwNEY3QjkxREUzQjk0NzhDNjE4MzNGQjI0QUE1Q0RCIiwidHlwIjoiYXQrand0In0.eyJuYmYiOjE3MTE1NTE1NTAsImV4cCI6MTcxMTU1NTE1MCwiaXNzIjoiaHR0cHM6Ly9sb2NhbGhvc3Q6NTAwMyIsImF1ZCI6Im9wZW5ib29raW5nIiwiY2xpZW50X2lkIjoiNWU3ZTc3YzEtZjNmOS00NDdlLWJlYmItNTMzNTE5ZTVmMDUwIiwiaHR0cHM6Ly9vcGVuYWN0aXZlLmlvL2NsaWVudElkIjoiNWU3ZTc3YzEtZjNmOS00NDdlLWJlYmItNTMzNTE5ZTVmMDUwIiwianRpIjoiRkE0MjgzRDQ0MDA3MUY5RjZFRTBDNDM3QTE0QjVCOTYiLCJpYXQiOjE3MTE1NTE1NTAsInNjb3BlIjpbIm9wZW5hY3RpdmUtb3JkZXJzZmVlZCJdfQ.m24ax6vRnSWEdSqTa1JORrPBwxjxlXZGRKgd-hMO1LPlNkNzTnVprhPgiCuWbAZSC-slvUhRw9Q212agkZVOnPHvXlUUsv0vPknga-eL2-LS9zARQxAeSxfgVPRZ_BYXXKoXYKxvdvOXxE5FnNTPuE7hv4rILZlFJdYBty8LSpWpTKAglq5jAZo0XcJPudTpam31wX7J_NUinYlQu180xcgIt4D5Tn5QbKC29T8-CqfdGnfvs_Izd0Yi_y4uOQqR5Znu-isr5-BxcqWIB3-SoZrz9twaW544KZTZ0rrz4ppNkm37blFWDyNLiLq-2GCsJZmjQoBb3hC1_6yukYXYmA"
  },
  "startingFeedPage": "https://localhost:5001/api/openbooking/orders-rpde?afterTimestamp=638471487644715727&afterId=f884697d-c034-4995-9b97-28b2d38e8cf5",
  "message": "Listening for UUID: 'edde2935-0863-4978-b698-57cdb1e536a6' in feed: orders, for Booking Partner: primary from startingFeedPage using headers"
}

Call TestInterface Action of type: test:ReplacementSimulateAction Request

POST https://localhost:5001/api/openbooking/test-interface/actions

{
  "@context": [
    "https://openactive.io/",
    "https://openactive.io/test-interface"
  ],
  "@type": "test:ReplacementSimulateAction",
  "object": {
    "@type": "Order",
    "@id": "https://localhost:5001/api/openbooking/orders/edde2935-0863-4978-b698-57cdb1e536a6"
  }
}

Response status code: 204 No Content. Responded in 17.548944ms.

Specs

✅ Orders Feed (after test:ReplacementSimulateAction)

Orders (orders) Feed collect for 'edde2935-0863-4978-b698-57cdb1e536a6' change (auth: primary) Request

GET http://localhost:3000/order-listeners/orders/primary/edde2935-0863-4978-b698-57cdb1e536a6


Response status code: 200 OK. Responded in 2416.092106ms.

{
  "state": "updated",
  "kind": "Order",
  "id": "edde2935-0863-4978-b698-57cdb1e536a6",
  "modified": "638471487705599636",
  "data": {
    "@context": [
      "https://openactive.io/",
      "https://openactive.io/ns-beta"
    ],
    "@type": "Order",
    "@id": "https://localhost:5001/api/openbooking/orders/edde2935-0863-4978-b698-57cdb1e536a6",
    "identifier": "edde2935-0863-4978-b698-57cdb1e536a6",
    "orderedItem": [
      {
        "@type": "OrderItem",
        "@id": "https://localhost:5001/api/openbooking/orders/edde2935-0863-4978-b698-57cdb1e536a6#/orderedItems/439",
        "acceptedOffer": {
          "@type": "Offer",
          "@id": "https://localhost:5001/api/identifiers/session-series/1#/offers/0",
          "price": 0,
          "priceCurrency": "GBP"
        },
        "accessCode": [
          {
            "@type": "PropertyValue",
            "name": "Pin Code",
            "description": "594511"
          }
        ],
        "accessPass": [
          {
            "@type": "Barcode",
            "text": "6722755032",
            "url": "https://via.placeholder.com/25x25/cccccc/9c9c9c.png",
            "beta:codeType": "code128"
          }
        ],
        "orderedItem": "https://localhost:5001/api/identifiers/scheduled-sessions/1/events/1",
        "orderItemStatus": "https://openactive.io/OrderItemConfirmed"
      }
    ],
    "totalPaymentDue": {
      "@type": "PriceSpecification",
      "openBookingPrepayment": "https://openactive.io/Unavailable",
      "price": 0,
      "priceCurrency": "GBP"
    }
  }
}

Specs

✅ Orders Feed (after test:ReplacementSimulateAction) >> validation of OrderFeed

Specs

Validations