Skip to content

Commit

Permalink
Fix options and LocationId errors
Browse files Browse the repository at this point in the history
  • Loading branch information
reid-spencer committed Mar 7, 2024
1 parent 337b39c commit f24280a
Show file tree
Hide file tree
Showing 26 changed files with 70 additions and 78 deletions.
2 changes: 1 addition & 1 deletion src/main/riddl/Commerce/commerce.riddl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ context Commerce is {
type DeliveryId is Id( Delivery )
type DeliveryInfo is {
orderId: OrderId,
location: LocationId,
location: Venues.LocationId,
specialInstructions: String
} //not part of MVP

Expand Down
3 changes: 2 additions & 1 deletion src/main/riddl/Events/Reservations/reservation.riddl
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ type Info is {
range: Chrono.TimeRange,
title: String,
description: String,
location: LocationId,
location: Venues.LocationId,
forOrg: OrganizationId
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/riddl/Events/eventReservationProjections.riddl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
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 { ??? }
Expand All @@ -10,7 +10,7 @@ context EventReservationProjections is {
projector EventReservationView is {
record EventReservationFields {
event: EventId,
location: LocationId,
location: Venues.LocationId,
reservation: ReservationId
}
handler EventReservationViewHandler is {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
context DemoScenarioGateway is {
options(gateway)
option gateway

type StartScenario is command {
numTenants: Integer,
Expand Down Expand Up @@ -28,4 +28,4 @@ context DemoScenarioGateway is {
productInfo: ProductContext.ProductInfo,
productMeta: ProductContext.ProductMetaInfo
}
}
}
6 changes: 3 additions & 3 deletions src/main/riddl/Gateway/MemberGateway/memberGateway.riddl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
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
type NotificationPreference is any of {email, sms}
Expand Down Expand Up @@ -44,4 +44,4 @@ context MemberGateway is {
type MemberSuspended is event {memberId: MemberContext.MemberId, memberMeta: MemberMetaInfo}
type TerminateMember is command {memberId: MemberContext.MemberId, actingMember: MemberContext.MemberId}
type MemberTerminated is event {memberId: MemberContext.MemberId, memberMeta: MemberMetaInfo}
}
}
4 changes: 1 addition & 3 deletions src/main/riddl/ImprovingApp.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ common = {
verbose = false
quiet = false
dry-run = false
hide-warnings = true
hide-missing-warnings = true
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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,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,
Expand Down
3 changes: 2 additions & 1 deletion src/main/riddl/Members/members.riddl
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/main/riddl/Order/Order.riddl
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion src/main/riddl/Organization/organization.riddl
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ context OrganizationContext is {
include "organizationSources"

entity Organization is {
options (event-sourced, available)
by author Reid
option event-sourced
option available

handler OrganizationHandler is {
on command EstablishOrganization {
Expand Down
2 changes: 1 addition & 1 deletion src/main/riddl/Product/product.riddl
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ context ProductContext is {
result TicketsForEvent is {event: EventId, tickets: SKU*}

entity Product is {
options (event-sourced)
options event-sourced
handler ProductHandler is {
on command CreateProduct {
morph entity Product to state DraftProductState with record DraftProduct
Expand Down
9 changes: 5 additions & 4 deletions src/main/riddl/Store/Store.riddl
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

Expand All @@ -41,7 +41,7 @@ context StoreContext is {
products: SKU*,
event: EventId?,
venue: VenueId?,
location: LocationId?,
location: Venues.LocationId?,
sponsoringOrg: OrganizationId?
}

Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -399,7 +400,7 @@ context StoreContext is {
storeName: String,
event: EventId?,
venue: VenueId,
location: LocationId,
location: Venues.LocationId,
sponsoringOrg: OrganizationId,
meta: StoreContext.MetaInfo
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/riddl/Tenant/tenant.riddl
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion src/main/riddl/Venues/Locations/location.riddl
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
34 changes: 17 additions & 17 deletions src/main/riddl/Venues/Locations/locationMessages.riddl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
command EstablishLocation is {
locationId: LocationId,
locationId: Venues.LocationId,
name: String,
description: String,
directions: String,
Expand All @@ -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
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
type Status is any of {Draft, Open, Closed} briefly "Internal status of a Location."

type Info is {
id: LocationId,
id: Venues.LocationId,
venueId: VenueId,
name: String,
description: String,
Expand Down
9 changes: 5 additions & 4 deletions src/main/riddl/Venues/venueContext.riddl
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand All @@ -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 {
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/main/riddl/Venues/venueLocationsMessages.riddl
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ query GetLocationsForVenue {
}
result LocationsForVenue {
venueId: VenueId,
location: LocationId+
location: Venues.LocationId+
}
2 changes: 1 addition & 1 deletion src/main/riddl/Venues/venueLocationsProjections.riddl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
projector VenueLocationsReservationsView is {
record Fields {
venueId: VenueId,
locationId: LocationId
Venues.locationId: LocationId
}
handler VenueLocationsViewHandler is {
on event VenueEstablished {
Expand Down
Loading

0 comments on commit f24280a

Please sign in to comment.