Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/Update_For_RIDDL_Udpates' into U…
Browse files Browse the repository at this point in the history
…pdate_For_RIDDL_Udpates
  • Loading branch information
reid-spencer committed Mar 8, 2024
2 parents b393bb0 + 3b66694 commit 7dff9a3
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 131 deletions.
2 changes: 0 additions & 2 deletions src/main/riddl/Events/eventReservationProjections.riddl
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include "../Venues/Locations/location"

query GetLocationForEvent is { event: EventId }
result LocationForEvent is { event: EventId, location: Venues.LocationId }
result EventNotFound is { ??? }
Expand Down
36 changes: 11 additions & 25 deletions src/main/riddl/Gateway/ReservationGateway/reservationStories.riddl
Original file line number Diff line number Diff line change
Expand Up @@ -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: "[email protected]"
}
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 {
Expand Down
1 change: 1 addition & 0 deletions src/main/riddl/KalixStudy.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include "../Venues/Locations/location"

query ScheduleEasyEvent is {
maxAttendance: Integer,
event: EventInfo,
Expand Down
101 changes: 0 additions & 101 deletions src/main/riddl/Store/Store.riddl
Original file line number Diff line number Diff line change
Expand Up @@ -186,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 to outlet StoreEvents.Events
// (
// storeId = @CreatedStoreState.id,
// info = @CreatedStoreState.info,
// meta = @CreatedStoreState.meta
// )

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 to outlet StoreEvents.Events
// (
// storeId = @CreatedStoreState.id,
// info = @CreatedStoreState.info,
// meta = @CreatedStoreState.meta
// )

become entity Store to handler ClosedStoreHandler
}
on command AddProductsToStore {
Expand All @@ -235,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)
}
Expand All @@ -268,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 to outlet StoreEvents.Events
// (
// storeId = @CreatedStoreState.id,
// info = @CreatedStoreState.info,
// meta = @CreatedStoreState.meta
// )

become entity Store to handler ClosedStoreHandler
}
on command AddProductsToStore {
Expand All @@ -298,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)
}
Expand All @@ -324,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 to outlet StoreEvents.Events
// (
// storeId = @CreatedStoreState.id,
// info = @CreatedStoreState.info,
// meta = @CreatedStoreState.meta
// )

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 to outlet StoreEvents.Events
// (
// storeId = @CreatedStoreState.id,
// info = @CreatedStoreState.info,
// meta = @CreatedStoreState.meta
// )

become entity Store to handler OpenStoreHandler
}
on command CloseStore {
Expand All @@ -383,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)
}
Expand All @@ -408,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)
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/riddl/Tenant/tenant.riddl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ context TenantContext is {
include "tenantSources"

entity Tenant is {
option event-sourced
option event-sourced
option available

handler TenantHandler is {
Expand Down

0 comments on commit 7dff9a3

Please sign in to comment.