diff --git a/Examples/BookingSystem.AspNetCore/Feeds/FacilitiesFeeds.cs b/Examples/BookingSystem.AspNetCore/Feeds/FacilitiesFeeds.cs index 0b2d8301..71378941 100644 --- a/Examples/BookingSystem.AspNetCore/Feeds/FacilitiesFeeds.cs +++ b/Examples/BookingSystem.AspNetCore/Feeds/FacilitiesFeeds.cs @@ -26,6 +26,9 @@ public AcmeFacilityUseRpdeGenerator(AppSettings appSettings, FakeBookingSystem f protected override async Task>> GetRpdeItems(long? afterTimestamp, long? afterId) { + var facilityTypeId = Environment.GetEnvironmentVariable("FACILITY_TYPE_ID") ?? "https://openactive.io/facility-types#a1f82b7a-1258-4d9a-8dc5-bfc2ae961651"; + var facilityTypePrefLabel = Environment.GetEnvironmentVariable("FACILITY_TYPE_PREF_LABEL") ?? "Squash Court"; + using (var db = _fakeBookingSystem.Database.Mem.Database.Open()) { var q = db.From() @@ -93,8 +96,8 @@ protected override async Task>> GetRpdeItems(long? af FacilityType = new List { new Concept { - Id = new Uri("https://openactive.io/facility-types#a1f82b7a-1258-4d9a-8dc5-bfc2ae961651"), - PrefLabel = "Squash Court", + Id = new Uri(facilityTypeId), + PrefLabel = facilityTypePrefLabel, InScheme = new Uri("https://openactive.io/facility-types") } } diff --git a/Examples/BookingSystem.AspNetCore/Feeds/SessionsFeeds.cs b/Examples/BookingSystem.AspNetCore/Feeds/SessionsFeeds.cs index aba2e7d8..b803b921 100644 --- a/Examples/BookingSystem.AspNetCore/Feeds/SessionsFeeds.cs +++ b/Examples/BookingSystem.AspNetCore/Feeds/SessionsFeeds.cs @@ -85,6 +85,9 @@ public AcmeSessionSeriesRpdeGenerator(AppSettings appSettings, FakeBookingSystem protected override async Task>> GetRpdeItems(long? afterTimestamp, long? afterId) { + var activityId = Environment.GetEnvironmentVariable("ACTIVITY_ID") ?? "https://openactive.io/activity-list#c07d63a0-8eb9-4602-8bcc-23be6deb8f83"; + var activityPrefLabel = Environment.GetEnvironmentVariable("ACTIVITY_PREF_LABEL") ?? "Jet Skiing"; + using (var db = _fakeBookingSystem.Database.Mem.Database.Open()) { var q = db.From() @@ -178,8 +181,8 @@ protected override async Task>> GetRpdeItems(long? { new Concept { - Id = new Uri("https://openactive.io/activity-list#c07d63a0-8eb9-4602-8bcc-23be6deb8f83"), - PrefLabel = "Jet Skiing", + Id = new Uri(activityId), + PrefLabel = activityPrefLabel, InScheme = new Uri("https://openactive.io/activity-list") } } diff --git a/Examples/BookingSystem.AspNetCore/Stores/FacilityStore.cs b/Examples/BookingSystem.AspNetCore/Stores/FacilityStore.cs index 7e44b71e..c8f2a311 100644 --- a/Examples/BookingSystem.AspNetCore/Stores/FacilityStore.cs +++ b/Examples/BookingSystem.AspNetCore/Stores/FacilityStore.cs @@ -288,6 +288,9 @@ protected override async Task TriggerTestAction(OpenBookingSimulateAction simula // Similar to the RPDE logic, this needs to render and return an new hypothetical OrderItem from the database based on the supplied opportunity IDs protected override async Task GetOrderItems(List> orderItemContexts, StoreBookingFlowContext flowContext, OrderStateContext stateContext) { + var facilityTypeId = Environment.GetEnvironmentVariable("FACILITY_TYPE_ID") ?? "https://openactive.io/facility-types#a1f82b7a-1258-4d9a-8dc5-bfc2ae961651"; + var facilityTypePrefLabel = Environment.GetEnvironmentVariable("FACILITY_TYPE_PREF_LABEL") ?? "Squash Court"; + // Note the implementation of this method must also check that this OrderItem is from the Seller specified by context.SellerId (this is not required if using a Single Seller) // Additionally this method must check that there are enough spaces in each entry @@ -343,8 +346,8 @@ protected override async Task GetOrderItems(List { new Concept { - Id = new Uri("https://openactive.io/facility-types#a1f82b7a-1258-4d9a-8dc5-bfc2ae961651"), - PrefLabel = "Squash Court", + Id = new Uri(facilityTypeId), + PrefLabel = facilityTypePrefLabel, InScheme = new Uri("https://openactive.io/facility-types") } } diff --git a/Examples/BookingSystem.AspNetFramework/Feeds/FacilitiesFeeds.cs b/Examples/BookingSystem.AspNetFramework/Feeds/FacilitiesFeeds.cs index 0b2d8301..71378941 100644 --- a/Examples/BookingSystem.AspNetFramework/Feeds/FacilitiesFeeds.cs +++ b/Examples/BookingSystem.AspNetFramework/Feeds/FacilitiesFeeds.cs @@ -26,6 +26,9 @@ public AcmeFacilityUseRpdeGenerator(AppSettings appSettings, FakeBookingSystem f protected override async Task>> GetRpdeItems(long? afterTimestamp, long? afterId) { + var facilityTypeId = Environment.GetEnvironmentVariable("FACILITY_TYPE_ID") ?? "https://openactive.io/facility-types#a1f82b7a-1258-4d9a-8dc5-bfc2ae961651"; + var facilityTypePrefLabel = Environment.GetEnvironmentVariable("FACILITY_TYPE_PREF_LABEL") ?? "Squash Court"; + using (var db = _fakeBookingSystem.Database.Mem.Database.Open()) { var q = db.From() @@ -93,8 +96,8 @@ protected override async Task>> GetRpdeItems(long? af FacilityType = new List { new Concept { - Id = new Uri("https://openactive.io/facility-types#a1f82b7a-1258-4d9a-8dc5-bfc2ae961651"), - PrefLabel = "Squash Court", + Id = new Uri(facilityTypeId), + PrefLabel = facilityTypePrefLabel, InScheme = new Uri("https://openactive.io/facility-types") } } diff --git a/Examples/BookingSystem.AspNetFramework/Feeds/SessionsFeeds.cs b/Examples/BookingSystem.AspNetFramework/Feeds/SessionsFeeds.cs index aba2e7d8..b803b921 100644 --- a/Examples/BookingSystem.AspNetFramework/Feeds/SessionsFeeds.cs +++ b/Examples/BookingSystem.AspNetFramework/Feeds/SessionsFeeds.cs @@ -85,6 +85,9 @@ public AcmeSessionSeriesRpdeGenerator(AppSettings appSettings, FakeBookingSystem protected override async Task>> GetRpdeItems(long? afterTimestamp, long? afterId) { + var activityId = Environment.GetEnvironmentVariable("ACTIVITY_ID") ?? "https://openactive.io/activity-list#c07d63a0-8eb9-4602-8bcc-23be6deb8f83"; + var activityPrefLabel = Environment.GetEnvironmentVariable("ACTIVITY_PREF_LABEL") ?? "Jet Skiing"; + using (var db = _fakeBookingSystem.Database.Mem.Database.Open()) { var q = db.From() @@ -178,8 +181,8 @@ protected override async Task>> GetRpdeItems(long? { new Concept { - Id = new Uri("https://openactive.io/activity-list#c07d63a0-8eb9-4602-8bcc-23be6deb8f83"), - PrefLabel = "Jet Skiing", + Id = new Uri(activityId), + PrefLabel = activityPrefLabel, InScheme = new Uri("https://openactive.io/activity-list") } } diff --git a/Examples/BookingSystem.AspNetFramework/Stores/FacilityStore.cs b/Examples/BookingSystem.AspNetFramework/Stores/FacilityStore.cs index 7e44b71e..c8f2a311 100644 --- a/Examples/BookingSystem.AspNetFramework/Stores/FacilityStore.cs +++ b/Examples/BookingSystem.AspNetFramework/Stores/FacilityStore.cs @@ -288,6 +288,9 @@ protected override async Task TriggerTestAction(OpenBookingSimulateAction simula // Similar to the RPDE logic, this needs to render and return an new hypothetical OrderItem from the database based on the supplied opportunity IDs protected override async Task GetOrderItems(List> orderItemContexts, StoreBookingFlowContext flowContext, OrderStateContext stateContext) { + var facilityTypeId = Environment.GetEnvironmentVariable("FACILITY_TYPE_ID") ?? "https://openactive.io/facility-types#a1f82b7a-1258-4d9a-8dc5-bfc2ae961651"; + var facilityTypePrefLabel = Environment.GetEnvironmentVariable("FACILITY_TYPE_PREF_LABEL") ?? "Squash Court"; + // Note the implementation of this method must also check that this OrderItem is from the Seller specified by context.SellerId (this is not required if using a Single Seller) // Additionally this method must check that there are enough spaces in each entry @@ -343,8 +346,8 @@ protected override async Task GetOrderItems(List { new Concept { - Id = new Uri("https://openactive.io/facility-types#a1f82b7a-1258-4d9a-8dc5-bfc2ae961651"), - PrefLabel = "Squash Court", + Id = new Uri(facilityTypeId), + PrefLabel = facilityTypePrefLabel, InScheme = new Uri("https://openactive.io/facility-types") } }