Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Examples/BookingSystem.AspNetCore/Feeds/FacilitiesFeeds.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ public AcmeFacilityUseRpdeGenerator(AppSettings appSettings)

protected override async Task<List<RpdeItem<FacilityUse>>> 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.FakeDatabase.DatabaseWrapper.Database.Open())
{
var q = db.From<FacilityUseTable>()
Expand Down Expand Up @@ -107,8 +110,8 @@ protected override async Task<List<RpdeItem<FacilityUse>>> GetRpdeItems(long? af
FacilityType = new List<Concept> {
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")
}
}
Expand Down
7 changes: 5 additions & 2 deletions Examples/BookingSystem.AspNetCore/Feeds/SessionsFeeds.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ public AcmeSessionSeriesRpdeGenerator(AppSettings appSettings)

protected override async Task<List<RpdeItem<SessionSeries>>> 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.FakeDatabase.DatabaseWrapper.Database.Open())
{
var q = db.From<ClassTable>()
Expand Down Expand Up @@ -199,8 +202,8 @@ protected override async Task<List<RpdeItem<SessionSeries>>> 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")
}
}
Expand Down
7 changes: 5 additions & 2 deletions Examples/BookingSystem.AspNetCore/Stores/FacilityStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,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<OrderItemContext<FacilityOpportunity>> 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
Expand Down Expand Up @@ -349,8 +352,8 @@ protected override async Task GetOrderItems(List<OrderItemContext<FacilityOpport
FacilityType = new List<Concept> {
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")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ public AcmeFacilityUseRpdeGenerator(AppSettings appSettings)

protected override async Task<List<RpdeItem<FacilityUse>>> 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.FakeDatabase.DatabaseWrapper.Database.Open())
{
var q = db.From<FacilityUseTable>()
Expand Down Expand Up @@ -107,8 +110,8 @@ protected override async Task<List<RpdeItem<FacilityUse>>> GetRpdeItems(long? af
FacilityType = new List<Concept> {
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")
}
}
Expand Down
7 changes: 5 additions & 2 deletions Examples/BookingSystem.AspNetFramework/Feeds/SessionsFeeds.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ public AcmeSessionSeriesRpdeGenerator(AppSettings appSettings)

protected override async Task<List<RpdeItem<SessionSeries>>> 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.FakeDatabase.DatabaseWrapper.Database.Open())
{
var q = db.From<ClassTable>()
Expand Down Expand Up @@ -199,8 +202,8 @@ protected override async Task<List<RpdeItem<SessionSeries>>> 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")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,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<OrderItemContext<FacilityOpportunity>> 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
Expand Down Expand Up @@ -349,8 +352,8 @@ protected override async Task GetOrderItems(List<OrderItemContext<FacilityOpport
FacilityType = new List<Concept> {
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")
}
}
Expand Down