@@ -12,6 +12,51 @@ public static class EngineConfig
1212 {
1313 public static StoreBookingEngine CreateStoreBookingEngine ( AppSettings appSettings , FakeBookingSystem fakeBookingSystem )
1414 {
15+ var facilityBookablePaidIdTemplate = appSettings . FeatureFlags . FacilityUseHasSlots ?
16+ new BookablePairIdTemplate < FacilityOpportunity > (
17+ // Opportunity
18+ new OpportunityIdConfiguration
19+ {
20+ OpportunityType = OpportunityType . FacilityUseSlot ,
21+ AssignedFeed = OpportunityType . FacilityUseSlot ,
22+ OpportunityIdTemplate = "{+BaseUrl}/facility-uses/{FacilityUseId}/slots/{SlotId}" ,
23+ OfferIdTemplate = "{+BaseUrl}/facility-uses/{FacilityUseId}/slots/{SlotId}#/offers/{OfferId}" ,
24+ Bookable = true
25+ } ,
26+ // Parent
27+ new OpportunityIdConfiguration
28+ {
29+ OpportunityType = OpportunityType . FacilityUse ,
30+ AssignedFeed = OpportunityType . FacilityUse ,
31+ OpportunityIdTemplate = "{+BaseUrl}/facility-uses/{FacilityUseId}"
32+ } )
33+ :
34+ new BookablePairIdTemplate < FacilityOpportunity > (
35+ // Opportunity
36+ new OpportunityIdConfiguration
37+ {
38+ OpportunityType = OpportunityType . IndividualFacilityUseSlot ,
39+ AssignedFeed = OpportunityType . IndividualFacilityUseSlot ,
40+ OpportunityIdTemplate = "{+BaseUrl}/facility-uses/{FacilityUseId}/individual-facility-uses/{IndividualFacilityUseId}/slots/{SlotId}" ,
41+ OfferIdTemplate = "{+BaseUrl}/facility-uses/{FacilityUseId}/individual-facility-uses/{IndividualFacilityUseId}/slots/{SlotId}#/offers/{OfferId}" ,
42+ Bookable = true
43+ } ,
44+ // Parent
45+ new OpportunityIdConfiguration
46+ {
47+ OpportunityType = OpportunityType . IndividualFacilityUse ,
48+ AssignedFeed = OpportunityType . FacilityUse ,
49+ OpportunityIdTemplate = "{+BaseUrl}/facility-uses/{FacilityUseId}/individual-facility-uses/{IndividualFacilityUseId}"
50+ } ,
51+ // Grandparent
52+ new OpportunityIdConfiguration
53+ {
54+ OpportunityType = OpportunityType . FacilityUse ,
55+ AssignedFeed = OpportunityType . FacilityUse ,
56+ OpportunityIdTemplate = "{+BaseUrl}/facility-uses/{FacilityUseId}"
57+ } )
58+ ;
59+
1560 return new StoreBookingEngine (
1661 new BookingEngineSettings
1762 {
@@ -38,24 +83,8 @@ public static StoreBookingEngine CreateStoreBookingEngine(AppSettings appSetting
3883 Bookable = false
3984 } ) ,
4085
41- new BookablePairIdTemplate < FacilityOpportunity > (
42- // Opportunity
43- new OpportunityIdConfiguration
44- {
45- OpportunityType = OpportunityType . FacilityUseSlot ,
46- AssignedFeed = OpportunityType . FacilityUseSlot ,
47- OpportunityIdTemplate = "{+BaseUrl}/facility-uses/{FacilityUseId}/facility-use-slots/{SlotId}" ,
48- OfferIdTemplate = "{+BaseUrl}/facility-uses/{FacilityUseId}/facility-use-slots/{SlotId}#/offers/{OfferId}" ,
49- Bookable = true
50- } ,
51- // Parent
52- new OpportunityIdConfiguration
53- {
54- OpportunityType = OpportunityType . FacilityUse ,
55- AssignedFeed = OpportunityType . FacilityUse ,
56- OpportunityIdTemplate = "{+BaseUrl}/facility-uses/{FacilityUseId}"
57- } ) /*,
58-
86+ facilityBookablePaidIdTemplate ,
87+ /*
5988 new BookablePairIdTemplate<ScheduledSessionOpportunity>(
6089 // Opportunity
6190 new OpportunityIdConfiguration
@@ -148,7 +177,7 @@ public static StoreBookingEngine CreateStoreBookingEngine(AppSettings appSetting
148177 OpportunityType . FacilityUse , new AcmeFacilityUseRpdeGenerator ( appSettings , fakeBookingSystem )
149178 } ,
150179 {
151- OpportunityType . FacilityUseSlot , new AcmeFacilityUseSlotRpdeGenerator ( appSettings , fakeBookingSystem )
180+ appSettings . FeatureFlags . FacilityUseHasSlots ? OpportunityType . FacilityUseSlot : OpportunityType . IndividualFacilityUseSlot , new AcmeFacilityUseSlotRpdeGenerator ( appSettings , fakeBookingSystem )
152181 }
153182 } ,
154183
@@ -253,7 +282,7 @@ public static StoreBookingEngine CreateStoreBookingEngine(AppSettings appSetting
253282 new SessionStore ( appSettings , fakeBookingSystem ) , new List < OpportunityType > { OpportunityType . ScheduledSession }
254283 } ,
255284 {
256- new FacilityStore ( appSettings , fakeBookingSystem ) , new List < OpportunityType > { OpportunityType . FacilityUseSlot }
285+ new FacilityStore ( appSettings , fakeBookingSystem ) , new List < OpportunityType > { appSettings . FeatureFlags . FacilityUseHasSlots ? OpportunityType . FacilityUseSlot : OpportunityType . IndividualFacilityUseSlot }
257286 }
258287 } ,
259288 OrderStore = new AcmeOrderStore ( appSettings , fakeBookingSystem ) ,
0 commit comments