From c80d666fb736303b029214de87ed532676ed7ae1 Mon Sep 17 00:00:00 2001 From: alexweinstein Date: Fri, 8 Mar 2024 07:52:01 -0500 Subject: [PATCH] various changes --- src/main/riddl/Commerce/commerce.riddl | 20 +-- .../Events/Reservations/reservation.riddl | 3 +- .../reservationTypeDefinitions.riddl | 4 +- .../Events/eventReservationProjections.riddl | 6 +- .../demoScenarioGateway.riddl | 2 +- .../Gateway/MemberGateway/memberGateway.riddl | 2 +- .../reservationStories.riddl | 36 ++---- src/main/riddl/KalixStudy.conf | 1 + .../locationsReservationsProjections.riddl | 6 +- src/main/riddl/Members/members.riddl | 3 +- src/main/riddl/Order/Order.riddl | 2 +- .../riddl/Organization/organization.riddl | 3 +- src/main/riddl/Product/product.riddl | 2 +- src/main/riddl/Store/Store.riddl | 120 ++---------------- src/main/riddl/Tenant/tenant.riddl | 3 +- .../riddl/Venues/Locations/location.riddl | 3 +- .../Venues/Locations/locationMessages.riddl | 34 ++--- .../Locations/locationTypeDefinitions.riddl | 2 +- src/main/riddl/Venues/venueContext.riddl | 9 +- .../riddl/Venues/venueLocationsMessages.riddl | 2 +- .../Venues/venueLocationsProjections.riddl | 2 +- .../venueLocationsReservationsMessages.riddl | 14 +- ...enueLocationsReservationsProjections.riddl | 2 +- src/main/riddl/Venues/venueMessages.riddl | 8 +- .../riddl/Venues/venueTypeDefinitions.riddl | 4 +- 25 files changed, 91 insertions(+), 202 deletions(-) diff --git a/src/main/riddl/Commerce/commerce.riddl b/src/main/riddl/Commerce/commerce.riddl index 1c0a7b5a6..47ee8ae3c 100644 --- a/src/main/riddl/Commerce/commerce.riddl +++ b/src/main/riddl/Commerce/commerce.riddl @@ -11,17 +11,17 @@ context Commerce is { type DeliveryId is Id( Delivery ) type DeliveryInfo is { orderId: OrderId, - location: LocationId, + location: Venues.LocationId, specialInstructions: String } //not part of MVP type NullState is Nothing entity Promotion is { - state Active of ^^NullState is {???} - handler ActivePromotionHandler is {???} - state Expired of ^^NullState is {???} - handler InactivePromotionHandler is {???} + state Active of NullState is { ??? } + handler ActivePromotionHandler is { ??? } + state Expired of NullState is { ??? } + handler InactivePromotionHandler is { ??? } } //not part of MVP entity PaymentProvider is {???} //TBD - after MVP @@ -33,20 +33,20 @@ context Commerce is { amount: Number, dateProcessed: DateTime } - state Payment of ^PaymentState is { + state Payment of PaymentState is { handler PaymentHandler is {???} } } entity Cart is {???} //develop as a future feature - Persistant Cart - Training exercise entity Delivery is { - state Pending of ^^NullState is {???} + state Pending of NullState is {???} handler PendingDeliveryHandler is {???} - state Ready of ^^NullState is {???} + state Ready of NullState is {???} handler ReadyDeliveryHandler is {???} - state EnRoute of ^^NullState is {???} + state EnRoute of NullState is {???} handler EnRoutDeliveryHandler is {???} - state Delivered of ^^NullState is {???} + state Delivered of NullState is {???} handler DeliveredDeliveryHandler is {???} } //not part of MVP } diff --git a/src/main/riddl/Events/Reservations/reservation.riddl b/src/main/riddl/Events/Reservations/reservation.riddl index 65c79e100..85ae3bf49 100644 --- a/src/main/riddl/Events/Reservations/reservation.riddl +++ b/src/main/riddl/Events/Reservations/reservation.riddl @@ -13,7 +13,8 @@ context ReservationContext is { outlet Events is type PublicReservationEvent entity Reservation is { - options (event-sourced, available) + option event-sourced + option available handler ReservationHandler is { on command EstablishReservation { diff --git a/src/main/riddl/Events/Reservations/reservationTypeDefinitions.riddl b/src/main/riddl/Events/Reservations/reservationTypeDefinitions.riddl index ed6592c0f..06935fe47 100644 --- a/src/main/riddl/Events/Reservations/reservationTypeDefinitions.riddl +++ b/src/main/riddl/Events/Reservations/reservationTypeDefinitions.riddl @@ -4,12 +4,12 @@ type Info is { range: Chrono.TimeRange, title: String, description: String, - location: LocationId, + location: Venues.LocationId, forOrg: OrganizationId } type UpdateInfo is { - range: TimeRange?, + range: Chrono.TimeRange?, title: String?, description: String?, forOrg: OrganizationId? diff --git a/src/main/riddl/Events/eventReservationProjections.riddl b/src/main/riddl/Events/eventReservationProjections.riddl index 40ee6a4ca..0957b3340 100644 --- a/src/main/riddl/Events/eventReservationProjections.riddl +++ b/src/main/riddl/Events/eventReservationProjections.riddl @@ -1,7 +1,5 @@ -include "../Venues/Locations/location" - query GetLocationForEvent is { event: EventId } -result LocationForEvent is { event: EventId, location: LocationId } +result LocationForEvent is { event: EventId, location: Venues.LocationId } result EventNotFound is { ??? } result NoReservationForEvent is { ??? } result NoLocationForEventReservation is { ??? } @@ -10,7 +8,7 @@ context EventReservationProjections is { projector EventReservationView is { record EventReservationFields { event: EventId, - location: LocationId, + location: Venues.LocationId, reservation: ReservationId } handler EventReservationViewHandler is { diff --git a/src/main/riddl/Gateway/DemoScenarioGateway/demoScenarioGateway.riddl b/src/main/riddl/Gateway/DemoScenarioGateway/demoScenarioGateway.riddl index 019eebcad..87587245b 100644 --- a/src/main/riddl/Gateway/DemoScenarioGateway/demoScenarioGateway.riddl +++ b/src/main/riddl/Gateway/DemoScenarioGateway/demoScenarioGateway.riddl @@ -1,5 +1,5 @@ context DemoScenarioGateway is { - options(gateway) + option gateway type StartScenario is command { numTenants: Integer, diff --git a/src/main/riddl/Gateway/MemberGateway/memberGateway.riddl b/src/main/riddl/Gateway/MemberGateway/memberGateway.riddl index 0eb393cb2..8eff97405 100644 --- a/src/main/riddl/Gateway/MemberGateway/memberGateway.riddl +++ b/src/main/riddl/Gateway/MemberGateway/memberGateway.riddl @@ -1,5 +1,5 @@ context MemberGateway is { - options(gateway) + option gateway type MemberType is any of {Student, FacultyStaff, Vendor, Sponsor, General, Alumni, Parent, Fan} type MemberMap is mapping from MemberContext.MemberId to MemberInfo diff --git a/src/main/riddl/Gateway/ReservationGateway/reservationStories.riddl b/src/main/riddl/Gateway/ReservationGateway/reservationStories.riddl index 6be17c98f..542a061f1 100644 --- a/src/main/riddl/Gateway/ReservationGateway/reservationStories.riddl +++ b/src/main/riddl/Gateway/ReservationGateway/reservationStories.riddl @@ -4,37 +4,23 @@ epic CreateReservation { //"Create a new Reservation without booking it" case HappyPath is { - //interaction is { - // step from user Member "provides a ReservationId" to user App - // briefly "initial invocation", - // step from user App send command Reservation.CreateReservation to user GatewayAPI - // briefly "send creation message", - // step from user GatewayAPI "Create Reservation" to entity ImprovingApp.ReservationContext.Reservations - // briefly "create reservation", - // step from entity ImprovingApp.ReservationContext.Reservations "ReservationCreated" to pipe ImprovingApp.ReservationContext.ReservationEvents - // briefly "reservation created" - // step from pipe ImprovingApp.ReservationContext.ReservationEvents "ReservationCreated" to user App - //} - //example Success is { - // when Member provides CreateReservation command w/ necessary info to App - // then App sends CreateReservation message to GatewayAPI - // and GatewayAPI forwards message to ReservationContext - // and Reservation is booked - // and ReservationCreated message is returned from ReservationContext to GatewayAPI - // and GatewayAPI forwards message to App - // and App displays success notification to Member - } + step from user Member "provides a ReservationId" to user App + briefly "initial invocation" + step send command Reservation.CreateReservation from application App to context GatewayAPI + briefly "send creation message" + step from user GatewayAPI "Create Reservation" to entity ImprovingApp.ReservationContext.Reservations + briefly "create reservation" + step from entity ImprovingApp.ReservationContext.Reservations "ReservationCreated" to source ImprovingApp.ReservationContext.ReservationEvents + briefly "reservation created" + step from source ImprovingApp.ReservationContext.ReservationEvents "ReservationCreated" to application App } } briefly "A story about creating a reservation in Improving.app" described as "This is the story of how a reservation comes into existence" //Reservation Gateway Stories epic BookReservation is { - As user Member wants to "Book a Reservation" so that "I can book my Reservations in ImprovingApp" - author Alex is { - name: "Alex Weinstein" - email: "alex.weinstin@improving.com" - } + user Member wants to "Book a Reservation" so that "I can book my Reservations in ImprovingApp" + by author Alex //"Book a new Reservation by picking from a list, given time parameters" case TimePickHappyPath is { //interaction is { diff --git a/src/main/riddl/KalixStudy.conf b/src/main/riddl/KalixStudy.conf index 1c765fb28..59cf5f15e 100644 --- a/src/main/riddl/KalixStudy.conf +++ b/src/main/riddl/KalixStudy.conf @@ -14,6 +14,7 @@ common = { hide-style-warnings = true debug = false show-unused-warnings = false + group-messages-by-kind = true } # This block provides options for the "hugo" command to translate riddl to a hugo web site. diff --git a/src/main/riddl/LocationsReservationsProjections/locationsReservationsProjections.riddl b/src/main/riddl/LocationsReservationsProjections/locationsReservationsProjections.riddl index 3143d9c3b..330d982d0 100644 --- a/src/main/riddl/LocationsReservationsProjections/locationsReservationsProjections.riddl +++ b/src/main/riddl/LocationsReservationsProjections/locationsReservationsProjections.riddl @@ -1,5 +1,3 @@ -include "../Venues/Locations/location" - query ScheduleEasyEvent is { maxAttendance: Integer, event: EventInfo, @@ -8,14 +6,14 @@ query ScheduleEasyEvent is { schedulingMember: MemberId } result EasyEventNoAvailability is { ??? } -result EasyScheduledEvent is {locations: LocationId+} +result EasyScheduledEvent is {locations: Venues.LocationId+} context LocationsReservationsProjections is { projector LocationsReservationsView is { record LocationsReservationsFields { venueId: VenueId, orgId: OrganizationId, - locationId: LocationId, + locationId: Venues.LocationId, capacity: Integer, reservationId: ReservationId, reservationStart: TimeStamp, diff --git a/src/main/riddl/Members/members.riddl b/src/main/riddl/Members/members.riddl index a204b9f75..46c4774be 100644 --- a/src/main/riddl/Members/members.riddl +++ b/src/main/riddl/Members/members.riddl @@ -217,7 +217,8 @@ context MemberContext is { } entity Member is { - options(aggregate, technology("akka")) + option aggregate + option technology("akka") handler MemberHandler is { on command RegisterMember { diff --git a/src/main/riddl/Order/Order.riddl b/src/main/riddl/Order/Order.riddl index 53ce5027e..4838e5aec 100644 --- a/src/main/riddl/Order/Order.riddl +++ b/src/main/riddl/Order/Order.riddl @@ -53,7 +53,7 @@ context OrderContext is { event LineItemCancelled {orderId: OrderId, productId: SKU, forMemberId: MemberId} entity Order is { - options (event-sourced) + option event-sourced handler DefaultOrderHandler is { on command CreateOrder { diff --git a/src/main/riddl/Organization/organization.riddl b/src/main/riddl/Organization/organization.riddl index 94dfaf8a4..4c4c77b50 100644 --- a/src/main/riddl/Organization/organization.riddl +++ b/src/main/riddl/Organization/organization.riddl @@ -8,7 +8,8 @@ context OrganizationContext is { include "organizationSources" entity Organization is { - options (event-sourced, available) + option event-sourced + option available by author Reid handler OrganizationHandler is { diff --git a/src/main/riddl/Product/product.riddl b/src/main/riddl/Product/product.riddl index 476270233..b99ad502b 100644 --- a/src/main/riddl/Product/product.riddl +++ b/src/main/riddl/Product/product.riddl @@ -69,7 +69,7 @@ context ProductContext is { result TicketsForEvent is {event: EventId, tickets: SKU*} entity Product is { - options (event-sourced) + option event-sourced handler ProductHandler is { on command CreateProduct { morph entity Product to state DraftProductState with record DraftProduct diff --git a/src/main/riddl/Store/Store.riddl b/src/main/riddl/Store/Store.riddl index 10a61c6c0..0c7b1914d 100644 --- a/src/main/riddl/Store/Store.riddl +++ b/src/main/riddl/Store/Store.riddl @@ -23,7 +23,7 @@ context StoreContext is { products: SKU+ briefly "Required", event: EventId?, venue: VenueId briefly "Required", - location: LocationId briefly "Required", + location: Venues.LocationId briefly "Required", sponsoringOrg: OrganizationId briefly "Required" } @@ -41,7 +41,7 @@ context StoreContext is { products: SKU*, event: EventId?, venue: VenueId?, - location: LocationId?, + location: Venues.LocationId?, sponsoringOrg: OrganizationId? } @@ -71,7 +71,8 @@ context StoreContext is { result ProductsInStore is {products: SKU*} entity Store is { - options (event-sourced, available) + option event-sourced + option available handler DefaultStoreHandler is { on command CreateStore { @@ -185,39 +186,13 @@ context StoreContext is { } on command OpenStore { set field CreatedStoreState.meta to "StoreContext.MetaInfo" -// ( -// createdOn = @CreatedStoreState.meta.createdOn, -// createdBy = @CreatedStoreState.meta.createdBy, -// lastUpdated = now(), -// lastUpdatedBy = @OpenStore.openingMember, -// currentState = @StoreStates.Open -// ) - send event StoreOpened -// ( -// storeId = @CreatedStoreState.id, -// info = @CreatedStoreState.info, -// meta = @CreatedStoreState.meta -// ) - to outlet StoreEvents.Events + send event StoreOpened to outlet StoreEvents.Events become entity Store to handler OpenStoreHandler } on command CloseStore { "ensure all orders associated with store are Delivered or Cancelled before closing store" set field CreatedStoreState.meta to "StoreContext.MetaInfo" -// ( -// createdOn = @CreatedStoreState.meta, -// createdBy = @CreatedStoreState.meta, -// lastUpdated = now(), -// lastUpdatedBy = @CloseStore.closingMember, -// currentState = @StoreStates.Closed -// ) - send event StoreClosed -// ( -// storeId = @CreatedStoreState.id, -// info = @CreatedStoreState.info, -// meta = @CreatedStoreState.meta -// ) - to outlet StoreEvents.Events + send event StoreClosed to outlet StoreEvents.Events become entity Store to handler ClosedStoreHandler } on command AddProductsToStore { @@ -234,13 +209,6 @@ context StoreContext is { } on command TerminateStore { set field CreatedStoreState.meta to "StoreContext.MetaInfo" -// ( -// createdOn = @CreatedStoreState.meta.createdOn, -// createdBy = @CreatedStoreState.meta.createdBy, -// lastUpdatedOn = now(), -// lastUpdatedBy = @TerminateStore.terminatingMember, -// currentState = @CreatedStoreState.meta -// ) morph entity Store to state TerminatedStore with record TerminatedStoreState // (lastMeta = @CreatedStoreState.meta) } @@ -267,20 +235,7 @@ context StoreContext is { on command CloseStore { "ensure all orders associated with store are Delivered or Cancelled before closing store" set field CreatedStoreState.meta to "StoreContext.MetaInfo" -// ( -// createdOn = @CreatedStoreState.meta.createdOn, -// createdBy = @CreatedStoreState.meta.createdBy, -// lastUpdated = now(), -// lastUpdatedBy = @CloseStore.closingMember, -// currentState = @StoreStates.Closed -// ) - send event StoreClosed -// ( -// storeId = @CreatedStoreState.id, -// info = @CreatedStoreState.info, -// meta = @CreatedStoreState.meta -// ) - to outlet StoreEvents.Events + send event StoreClosed to outlet StoreEvents.Events become entity Store to handler ClosedStoreHandler } on command AddProductsToStore { @@ -297,13 +252,6 @@ context StoreContext is { } on command TerminateStore { set field CreatedStoreState.meta to "StoreContext.MetaInfo" -// ( -// createdOn = @CreatedStoreState.meta.createdOn, -// createdBy = @CreatedStoreState.meta.createdBy, -// lastUpdatedOn = now(), -// lastUpdatedBy = @TerminateStore.terminatingMember, -// currentState = @CreatedStoreState.meta -// ) morph entity Store to state TerminatedStore with record TerminatedStoreState // (lastMeta = @CreatedStoreState.meta) } @@ -323,46 +271,12 @@ context StoreContext is { } on command DeleteStore { set field CreatedStoreState.meta to "StoreContext.MetaInfo" -// ( -// createdOn = @CreatedStoreState.meta.createdOn, -// createdBy = @CreatedStoreState.meta.createdBy, -// lastUpdated = now(), -// lastUpdatedBy = @DeleteStore.deletingMember, -// currentState = @StoreStates.Deleted -// ) - send event StoreDeleted -// ( -// storeId = @CreatedStoreState.id, -// info = @CreatedStoreState.info, -// meta = @CreatedStoreState.meta -// ) - to outlet StoreEvents.Events + send event StoreDeleted to outlet StoreEvents.Events morph entity Store to state DeletedStore with record DeletedStoreState -// ( -// storeName = @CreatedStoreState.info.storeName, -// event = @CreatedStoreState.info.event, -// venue = @CreatedStoreState.info.venue, -// location = @CreatedStoreState.info.location, -// sponsoringOrg = @CreatedStoreState.info.sponsoringOrg, -// meta = @CreatedStoreState.meta -// ) } on command OpenStore { set field CreatedStoreState.meta to "StoreContext.MetaInfo" -// ( -// createdOn = @CreatedStoreState.meta.createdOn, -// createdBy = @CreatedStoreState.meta.createdBy, -// lastUpdated = now(), -// lastUpdatedBy = @OpenStore.openingMember, -// currentState = @StoreStates.Open -// ) - send event StoreOpened -// ( -// storeId = @CreatedStoreState.id, -// info = @CreatedStoreState.info, -// meta = @CreatedStoreState.meta -// ) - to outlet StoreEvents.Events + send event StoreOpened to outlet StoreEvents.Events become entity Store to handler OpenStoreHandler } on command CloseStore { @@ -382,13 +296,6 @@ context StoreContext is { } on command TerminateStore { set field CreatedStoreState.meta to "StoreContext.MetaInfo" -// ( -// createdOn = @CreatedStoreState.meta.createdOn, -// createdBy = @CreatedStoreState.meta.createdBy, -// lastUpdatedOn = now(), -// lastUpdatedBy = @TerminateStore.terminatingMember, -// currentState = @CreatedStoreState.meta -// ) morph entity Store to state TerminatedStore with record TerminatedStoreState // (lastMeta = @CreatedStoreState.meta) } @@ -399,7 +306,7 @@ context StoreContext is { storeName: String, event: EventId?, venue: VenueId, - location: LocationId, + location: Venues.LocationId, sponsoringOrg: OrganizationId, meta: StoreContext.MetaInfo } @@ -407,13 +314,6 @@ context StoreContext is { handler DeletedStoreHandler is { on command TerminateStore { set field DeletedStoreState.meta to "StoreContext.MetaInfo" -// ( -// createdOn = @DeletedStoreState.meta.createdOn, -// createdBy = @DeletedStoreState.meta.createdBy, -// lastUpdatedOn = now(), -// lastUpdatedBy = @TerminateStore.terminatingMember, -// currentState = @DeletedStoreState.meta -// ) morph entity Store to state TerminatedStore with record TerminatedStoreState // (lastMeta = @DeletedStoreState.meta) } diff --git a/src/main/riddl/Tenant/tenant.riddl b/src/main/riddl/Tenant/tenant.riddl index e93c771ad..bdf09820b 100644 --- a/src/main/riddl/Tenant/tenant.riddl +++ b/src/main/riddl/Tenant/tenant.riddl @@ -8,7 +8,8 @@ context TenantContext is { include "tenantSources" entity Tenant is { - options (event-sourced, available) + option event-sourced + option available handler TenantHandler is { on command EstablishTenant { diff --git a/src/main/riddl/Venues/Locations/location.riddl b/src/main/riddl/Venues/Locations/location.riddl index 88d6e3f39..d1d06529b 100644 --- a/src/main/riddl/Venues/Locations/location.riddl +++ b/src/main/riddl/Venues/Locations/location.riddl @@ -6,7 +6,8 @@ context LocationContext is { include "locationMessages" entity Location is { - options (event-sourced, available) + option event-sourced + option available handler LocationHandler is { on command EstablishLocation { diff --git a/src/main/riddl/Venues/Locations/locationMessages.riddl b/src/main/riddl/Venues/Locations/locationMessages.riddl index bc7136a54..2d60283e6 100644 --- a/src/main/riddl/Venues/Locations/locationMessages.riddl +++ b/src/main/riddl/Venues/Locations/locationMessages.riddl @@ -1,5 +1,5 @@ command EstablishLocation is { - locationId: LocationId, + locationId: Venues.LocationId, name: String, description: String, directions: String, @@ -13,75 +13,75 @@ command EstablishLocation is { } briefly "Creates a Location with all top-level fields, potentially without Locations" event LocationEstablished is { - locationId: LocationId, + locationId: Venues.LocationId, locationInfo: LocationContext.Info, reservations: ReservationId*, meta: LocationContext.MetaInfo } command AddLocationReservations is { - locationId: LocationId, + locationId: Venues.LocationId, reservations: ReservationId+ } event LocationReservationsAdded is { - locationId: LocationId, + locationId: Venues.LocationId, allReservations: ReservationId+ } command UpdateLocationStatus is { - locationId: LocationId, + locationId: Venues.LocationId, status: LocationContext.Status, updatingMember: MemberId } event LocationStatusUpdated is { - locationId: LocationId, + locationId: Venues.LocationId, newStatus: LocationContext.Status } command EditLocationInfo is { - locationId: LocationId briefly "The unique Id of the location to create", + locationId: Venues.LocationId briefly "The unique Id of the location to create", newInfo: LocationContext.UpdateInfo briefly "The information about the location", editingMember: MemberId briefly "Id of the member who is creating the location" } briefly "A command to edit the values of an Reservation's Info " event LocationInfoUpdated is { - locationId: LocationId, + locationId: Venues.LocationId, info: LocationContext.Info, meta: LocationContext.MetaInfo } query GetNextLocationReservations is { - locationId: LocationId, + locationId: Venues.LocationId, maxCount: Integer, startDate: DateTime? briefly "Used as start date of query when present instead of now()" } query GetLocationReservations is { - venueId: LocationId, + venueId: Venues.LocationId, ranges: TimeRange+ } result LocationReservations is { - venueId: LocationId, + venueId: Venues.LocationId, schedule: ReservationId* briefly "All reservation that take place in the location within the time range (for GetNextLocationReservations) or maxCount+startDate (for GetLocationReservations) provided" } query GetNextLocationAvailability is { - locationId: LocationId, + locationId: Venues.LocationId, maxCount: Integer, startDate: DateTime? briefly "Used as start date of query when present instead of now()" } result LocationAvailabilityCalendar is { - locationId: LocationId, + locationId: Venues.LocationId, schedule: TimeRange* briefly "A list of time ranges indicating availability" } -query FindAvailableLocationsInRange is {locationId: LocationId, start: Date, end: Date} -query FindAvailableLocationsInRangeWithAmenities is {locationId: LocationId, start: Date, end: Date, desiredAmenities: String*} +query FindAvailableLocationsInRange is {locationId: Venues.LocationId, start: Date, end: Date} +query FindAvailableLocationsInRangeWithAmenities is {locationId: Venues.LocationId, start: Date, end: Date, desiredAmenities: String*} query GetLocationVenue is { - locationId: LocationId + locationId: Venues.LocationId } result LocationVenue is { - locationId: LocationId, + locationId: Venues.LocationId, venueId: VenueId } \ No newline at end of file diff --git a/src/main/riddl/Venues/Locations/locationTypeDefinitions.riddl b/src/main/riddl/Venues/Locations/locationTypeDefinitions.riddl index e58609b78..fb27b70af 100644 --- a/src/main/riddl/Venues/Locations/locationTypeDefinitions.riddl +++ b/src/main/riddl/Venues/Locations/locationTypeDefinitions.riddl @@ -1,7 +1,7 @@ type Status is any of {Draft, Open, Closed} briefly "Internal status of a Location." type Info is { - id: LocationId, + id: type Venues.LocationId, venueId: VenueId, name: String, description: String, diff --git a/src/main/riddl/Venues/venueContext.riddl b/src/main/riddl/Venues/venueContext.riddl index 0413f6205..1d27ecef9 100644 --- a/src/main/riddl/Venues/venueContext.riddl +++ b/src/main/riddl/Venues/venueContext.riddl @@ -7,7 +7,8 @@ context VenueContext is { include "venueProjections" entity Venue is { - options (event-sourced, available) + option event-sourced + option available handler VenueHandler is { on command EstablishVenue { @@ -23,7 +24,7 @@ context VenueContext is { record DraftState is { venueInfo: VenueContext.Info, - locations: LocationId*, + locations: Venues.LocationId*, venueMeta: VenueContext.MetaInfo } state Draft of Venue.DraftState is { @@ -50,7 +51,7 @@ context VenueContext is { record OpenState is { venueInfo: VenueContext.Info, - locations: LocationId*, + locations: Venues.LocationId*, venueMeta: VenueContext.MetaInfo } state Open of Venue.OpenState is { @@ -77,7 +78,7 @@ context VenueContext is { record ClosedState is { orgId: OrganizationId, - locations: LocationId*, + locations: Venues.LocationId*, venueMeta: VenueContext.MetaInfo } state Closed of Venue.ClosedState is { diff --git a/src/main/riddl/Venues/venueLocationsMessages.riddl b/src/main/riddl/Venues/venueLocationsMessages.riddl index 879b4469b..61eda3c7f 100644 --- a/src/main/riddl/Venues/venueLocationsMessages.riddl +++ b/src/main/riddl/Venues/venueLocationsMessages.riddl @@ -4,5 +4,5 @@ query GetLocationsForVenue { } result LocationsForVenue { venueId: VenueId, - location: LocationId+ + location: Venues.LocationId+ } diff --git a/src/main/riddl/Venues/venueLocationsProjections.riddl b/src/main/riddl/Venues/venueLocationsProjections.riddl index ea93d4256..5b4a52589 100644 --- a/src/main/riddl/Venues/venueLocationsProjections.riddl +++ b/src/main/riddl/Venues/venueLocationsProjections.riddl @@ -1,7 +1,7 @@ projector VenueLocationsReservationsView is { record Fields { venueId: VenueId, - locationId: LocationId + locationId: Venues.LocationId } handler VenueLocationsViewHandler is { on event VenueEstablished { diff --git a/src/main/riddl/Venues/venueLocationsReservationsMessages.riddl b/src/main/riddl/Venues/venueLocationsReservationsMessages.riddl index 5172f42cc..13196abee 100644 --- a/src/main/riddl/Venues/venueLocationsReservationsMessages.riddl +++ b/src/main/riddl/Venues/venueLocationsReservationsMessages.riddl @@ -27,30 +27,30 @@ result VenueAvailabilityCalendar is { //based on LocationId query GetNextLocationReservations is { - locationId: LocationId, + locationId: Venues.LocationId, maxCount: Integer, startDate: TimeStamp? briefly "Used as start date of query when present instead of now()" } query GetLocationReservations is { - venueId: LocationId, + venueId: Venues.LocationId, ranges: TimeRange+ } result LocationReservations is { - venueId: LocationId, + venueId: Venues.LocationId, schedule: ReservationId* briefly "All reservation that take place in the location within the time range (for GetNextLocationReservations) or maxCount+startDate (for GetLocationReservations) provided" } query GetNextLocationAvailability is { - locationId: LocationId, + locationId: Venues.LocationId, maxCount: Integer, startDate: TimeStamp? briefly "Used as start date of query when present instead of now()" } result LocationAvailabilityCalendar is { - locationId: LocationId, + locationId: Venues.LocationId, schedule: TimeRange* briefly "A list of time ranges indicating availability" } -query FindAvailableLocationsInDateRange is {locationId: LocationId, start: Date, end: Date} -query FindAvailableLocationsInDateRangeWithAmenities is {locationId: LocationId, start: Date, end: Date, desiredAmenities: String*} +query FindAvailableLocationsInDateRange is {locationId: Venues.LocationId, start: Date, end: Date} +query FindAvailableLocationsInDateRangeWithAmenities is {locationId: Venues.LocationId, start: Date, end: Date, desiredAmenities: String*} diff --git a/src/main/riddl/Venues/venueLocationsReservationsProjections.riddl b/src/main/riddl/Venues/venueLocationsReservationsProjections.riddl index 1f04d47ac..6c4eaae7c 100644 --- a/src/main/riddl/Venues/venueLocationsReservationsProjections.riddl +++ b/src/main/riddl/Venues/venueLocationsReservationsProjections.riddl @@ -1,7 +1,7 @@ projector VenueLocationsReservationsView is { record Fields { venueId: VenueId, - locationId: LocationId, + locationId: Venues.LocationId, reservationId: ReservationId, reservationStart: TimeStamp, reservationEnd: TimeStamp diff --git a/src/main/riddl/Venues/venueMessages.riddl b/src/main/riddl/Venues/venueMessages.riddl index 73c425844..348128f16 100644 --- a/src/main/riddl/Venues/venueMessages.riddl +++ b/src/main/riddl/Venues/venueMessages.riddl @@ -35,11 +35,11 @@ event VenueStatusUpdated is { command AddVenueLocations is { venueId: VenueId, - locations: LocationId+ + locations: Venues.LocationId+ } event VenueLocationsAdded is { venueId: VenueId, - locations: LocationId+ + locations: Venues.LocationId+ } query GetNextVenueReservations is { @@ -93,10 +93,10 @@ result VenueCapacityOverview is { //types type VenueReservationsSchedule is { - locationId: LocationId, + locationId: Venues.LocationId, reservations: ReservationId+ } type VenueAvailabilitySchedule is { - locationId: LocationId, + locationId: Venues.LocationId, schedule: TimeRange+ } diff --git a/src/main/riddl/Venues/venueTypeDefinitions.riddl b/src/main/riddl/Venues/venueTypeDefinitions.riddl index 7178071b2..3d0de0632 100644 --- a/src/main/riddl/Venues/venueTypeDefinitions.riddl +++ b/src/main/riddl/Venues/venueTypeDefinitions.riddl @@ -15,12 +15,12 @@ type UpdateInfo is { } //type VenueReservationsSchedule is { -// locationId: LocationId, +// locationId: Venues.LocationId, // reservations: ReservationId+ //} // //type VenueAvailabilitySchedule is { -// locationId: LocationId, +// locationId: Venues.LocationId, // schedule: TimeRange+ //}