Skip to content

Commit

Permalink
feat: first pass at fixing compilation for updated riddl
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexWeinstein92 committed Mar 5, 2024
1 parent 7e18157 commit f1458f1
Show file tree
Hide file tree
Showing 43 changed files with 237 additions and 560 deletions.
18 changes: 10 additions & 8 deletions src/main/riddl/AllIdsProjections/allIdsProjections.riddl
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
//all comments to be implemented post kalix-study
//all comments to be implemented post kalix-study

query GetAllTenantIds is {}
query GetAllTenantIds is { ??? }
result AllTenantIds is {tenants: TenantId*}

query GetAllOrgIds is {}
query GetAllOrgIds is { ??? }
result AllOrgIds is {orgs: OrganizationId*}

query GetAllEventIds is {}
query GetAllEventIds is { ??? }
result AllEventIds {events: EventId*}

query GetAllMemberIds is {}
query GetAllMemberIds is { ??? }
result AllMemberIds is {members: MemberId*}

query GetAllStoreIds is {}
query GetAllStoreIds is { ??? }
result AllStoreIds is {stores: StoreId*}

query GetAllSkus is {}
query GetAllSkus is { ??? }
result AllSkus is {skus: SKU*}

context AllIdsProjections is {
Expand All @@ -25,14 +26,15 @@ context AllIdsProjections is {
//tenantStatus: TenantContext.Status
}
handler AllTenantIdsViewHandler is {

on event TenantEstablished {
"create row with tenant set to TenantEstablished.tenantId"// and tenantStatus to Draft"
"create row with tenant set to TenantEstablished.tenantId and tenantStatus to Draft"
}
//on event TenantContext.StatusUpdated {
// then "update row with tenant set to StatusUpdated.tenantId to tenantStatus with StatusUpdated.newStatus"
//}
on query GetAllTenantIds {
"reply with AllTenantIds packed with entire table filtered by tenantStatus == Active"
"reply with AllTenantIds packed with entire table filtered by tenantStatus == Active"=
}
}
}
Expand Down
33 changes: 9 additions & 24 deletions src/main/riddl/Applications/application.riddl
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,9 @@ application UserInterface is {
}

group Organization is {
input EstablishOrganization is {
acquires command UserInterface.EstablishOrganization
}
output DisplayOrganization is {
presents result OrganizationEstablished
}
input EstablishOrganization acquires command UserInterface.EstablishOrganization

output DisplayOrganization presents result OrganizationEstablished
}

handler OrgHandler is {
Expand All @@ -50,12 +47,8 @@ application UserInterface is {
}

group Member is {
input RegisterMember is {
acquires command UserInterface.RegisterMember
}
output DisplayMemberDetails is {
presents result MemberRegistered
}
input RegisterMember acquires command UserInterface.RegisterMember
output DisplayMemberDetails presents result MemberRegistered
}

handler MemberHandler is {
Expand All @@ -81,12 +74,8 @@ application UserInterface is {
}

group Product is {
input PurchaseProduct is {
acquires command UserInterface.PurchaseProduct
}
output DisplayPurchases is {
presents result ProductsPurchased
}
input PurchaseProduct acquires command UserInterface.PurchaseProduct
output DisplayPurchases presents result ProductsPurchased
}

handler ProductHandler is {
Expand All @@ -109,12 +98,8 @@ application CommandLine is {
}

group Scenario is {
input StartScenario is {
acquires command CommandLine.StartScenario
}
output DisplayScenario is {
presents result CommandLine.ScenarioStarted
}
input StartScenario acquires command CommandLine.StartScenario
output DisplayScenario presents result CommandLine.ScenarioStarted
}

handler CurlHandler is {
Expand Down
12 changes: 7 additions & 5 deletions src/main/riddl/Calendars/calendar.riddl
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
context Calendars is {
//Thinking of "outsourcing" this feature to google calendar. As such, this domain is an integration
//to the 3rd party app. It would be a good chance to teach the focuser pattern. There might also be
//some light customization (TBD).
//The google calendar API can be found here: https://developers.google.com/calendar/api
???
???
}

//Thinking of "outsourcing" this feature to google calendar. As such, this domain is an integration
//to the 3rd party app. It would be a good chance to teach the focuser pattern. There might also be
//some light customization (TBD).
//The google calendar API can be found here: https://developers.google.com/calendar/api

4 changes: 2 additions & 2 deletions src/main/riddl/Common/Contact.riddl
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// Copyright (c) 2022 Improving Inc.

// Types for Contact Information
type MobileNumber is Pattern("\\(([0-9]{3})\\)([0-9]{3})-([0-9]{4})")
briefly "North American Phone Number standard"
type EmailAddress is Pattern("(?:[a-z0-9!#$%&'*+/=?^_`{|}~-](?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-])|\"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])\")@(?:(?:[a-z0-9](?:[a-z0-9-][a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-][a-z0-9])?|[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)])")
Expand All @@ -11,6 +9,7 @@ type USPostalCode is Pattern("\\d{5}(-\\d{4})?")
briefly "A USA Postal Code"
type PostalCode is one of { CAPostalCode, USPostalCode }
briefly "Either a USA or Canadian postal code"
// Types for Contact Information

type Address is {
line1: String,
Expand All @@ -29,3 +28,4 @@ type Contact is {
userName: String
} briefly "Contact information for an individual"

// Copyright (c) 2022 Improving Inc.
19 changes: 11 additions & 8 deletions src/main/riddl/Epics/epics.riddl
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
user OrgOwner is "the person that owns the organization"
user Member is "any member (user) of the system"

epic EstablishOrganization by author Reid is {
user ImprovingApp.OrgOwner wants "to establish an organization" so that
"they can conduct business as that organization"
include "memberEpics"

epic EstablishOrganization is {
by author Reid
case primary is {
user OrgOwner wants "to establish an organization" so that "they can conduct business as that organization"
step from user OrgOwner "creates an Organization" to input
ImprovingApp.UserInterface.Organization.EstablishOrganization briefly "fill out form",
ImprovingApp.UserInterface.Organization.EstablishOrganization briefly "fill out form"
step
from output ImprovingApp.UserInterface.Organization.DisplayOrganization
"organizationAdded"
Expand All @@ -15,10 +17,11 @@ epic EstablishOrganization by author Reid is {
} briefly "A story about establishing an organization in Improving.app"
described as "This is the story of how an organization comes to existence"

epic RegisterMemberToOrganization by author Reid is {
user ImprovingApp.OrgOwner wants "to register a member" so that
"they can fill the roster for their organization"
case primary is { ??? }
epic RegisterMemberToOrganization is {
by author Reid
case primary is {
//user OrgOwner wants "to register a member" so that "they can fill the roster for their organization"
}
} briefly "A story about registering a member into an organization"
described as "TBD"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
// TODO: convert every Feature to an epic and every Scenario to a case
// Note: this will involve creating components for application UserInterface for each epic

epic RegisterMember by author Alex is {
epic RegisterMember is {
user Member wants "to register as a member" so that "they can perform functions in the app"
by author Alex
term 'member' described as {
| An entity that is allowed to do queries on other entities or actions on other entities.
| Much of their behaviour will be constrained or permitted be based on ownership, membership, &
| permissions in the future.
}
}
// TODO: convert every Feature to an epic and every Scenario to a case
// Note: this will involve creating components for application UserInterface for each epic

// case RegisterActiveMember is {
// step from user Member "register as a member" to input
// Then the new registration is validated for handle and member id (make sure they are unique in the system(
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 @@ -5,8 +5,9 @@ context ReservationContext is {
include "reservationTypeDefinitions"
include "reservationMessages"

// TODO: List the names of the public reservation events here
type PublicReservationEvent is one of {
// TODO: List the names of the public reservation events here
???
}

outlet Events is type PublicReservationEvent
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
type Status is any of {Draft, OnHold, Reserved, Past, Cancelled} briefly "Internal status of a Reservation."

type Info is {
range: TimeRange,
range: Chrono.TimeRange,
title: String,
description: String,
location: LocationId,
Expand Down
12 changes: 7 additions & 5 deletions src/main/riddl/Events/eventReservationProjections.riddl
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
query GetLocationForEvent is {event: EventId}
result LocationForEvent is {event: EventId, location: LocationId}
result EventNotFound is {}
result NoReservationForEvent is {}
result NoLocationForEventReservation is {}
include "../Venues/Locations/location"

query GetLocationForEvent is { event: EventId }
result LocationForEvent is { event: EventId, location: LocationId }
result EventNotFound is { ??? }
result NoReservationForEvent is { ??? }
result NoLocationForEventReservation is { ??? }

context EventReservationProjections is {
projector EventReservationView is {
Expand Down
10 changes: 5 additions & 5 deletions src/main/riddl/Events/eventSources.riddl
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// plant EventPlant is {
// pipe EventPipe is {???}
// }

source LiveUpdates is {
outlet Updates is type LiveUpdate
} explained as "This is a source for things that happen as an event progresses"

// plant EventPlant is {
// pipe EventPipe is {???}
// }

//ReservationAddedToEvent,
type PublicEventEvent is one of {
EventInfoChanged,
EventCreated,
EventScheduled,
//ReservationAddedToEvent,
EventCancelled,
EventRescheduled,
EventDelayed,
Expand Down
4 changes: 2 additions & 2 deletions src/main/riddl/Events/eventTypeDefinitions.riddl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type EventSpecificDetails is one of {Game, Play, Concert, FundRaiser}

type Game is {info: GameTypeInfo, statusInfo: GameStatusInfo}
type GameStateInfo is one of {ScheduledGameInfo | InProgressGameInfo | DelayedGameInfo | PastGameInfo | CancelledGameInfo}
type ScheduledGameInfo is {}
type ScheduledGameInfo is { ??? }
type InProgressGameInfo is {currentScore: Score}
type DelayedGameInfo is {delayedScore: Score?}
type PastGameInfo is {finalScore: Score}
Expand All @@ -24,7 +24,7 @@ type FootballGame is {
???
}
type FootballGameStateInfo is one of {ScheduledFootballGameInfo | InProgressFootballGameInfo | DelayedFootballGameInfo | PastFootballGameInfo | CancelledFootballGameInfo}
type ScheduledFootballGameInfo is {}
type ScheduledFootballGameInfo is { ??? }
type InProgressFootballGameInfo is {yardsSoFarHome: Integer, yardsSoFarAway: Integer}
type DelayedFootballGameInfo is {yardsSoFarHome: Integer?, yardsSoFarAway: Integer?}
type PastFootballGameInfo is {totalYardsHome: Integer, totalYardsAway: Integer}
Expand Down
4 changes: 3 additions & 1 deletion src/main/riddl/Gateway/EventGateway/eventStories.riddl
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

epic EventStories is { ??? }

// TODO: Convert this file to new style epics and cases
// event stories
epic EventStories is { ??? }
/*
As an Owner of an Organization I would like to schedule an Event that is hosted by my Organization
As an Owner of an Organization I would like to find a Location, Reserve the Location, and schedule my Event using that Reservation (easy button)
Expand Down
14 changes: 6 additions & 8 deletions src/main/riddl/Gateway/MemberGateway/memberGateway.riddl
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,15 @@ context MemberGateway is {
memberState: MemberState
}

type GetMemberInfo is query {memberId: MemberContext.MemberId}
type MemberData is result {memberId: MemberContext.MemberId, memberInfo: MemberInfo, memberMeta: MemberMetaInfo}
type GetMemberForHandle is query {handle: String}
type MemberForHandle is result {memberId: MemberContext.MemberId?}
type RegisterMemberList is command {memberList: MemberMap+, registeringMember: MemberContext.MemberId} briefly "RegisterMemberList creates multiple members with a single call. The limitation is you can only define a single MemberType in each call, and all new Members must be assigned to an Organization (typically a BaseOrg)."
type MemberListRegistered is event {memberData:MemberData*}
type MemberListRegistered is event {memberData: MemberData*}
type RegisterMember is command {memberToAdd: MemberMap, registeringMember: MemberContext.MemberId?} briefly "RegisterMember creates a single new member. As this could be a self-service request the OrganizationType is optional. Also registeringMember is optional - if you are registering yourself then you are the registering member for yourself - you just don't exist yet"
type MemberRegistered is event {memberId: MemberContext.MemberId, memberInfo: MemberInfo, memberMeta: MemberMetaInfo} briefly "Event issued after either RegisterMember or RegisterMemberList is called. In the case of RegisterMemberList one event per member in the list is published."
type UpdateMemberInfo is command {memberMap:MemberMap, actingMember: MemberContext.MemberId} briefly "All member info will be overwritten as provided in this command. Best practice would be to retrieve current values first and modify attributes that you desire to change and submit the full MemberInfo object back."
type UpdateMemberInfo is command {memberMap: MemberMap, actingMember: MemberContext.MemberId} briefly "All member info will be overwritten as provided in this command. Best practice would be to retrieve current values first and modify attributes that you desire to change and submit the full MemberInfo object back."
type MemberInfoUpdated is event {memberId: MemberContext.MemberId, memberInfo: MemberInfo, memberMeta: MemberMetaInfo}
type ActivateMember is command {memberId: MemberContext.MemberId, actingMember: MemberContext.MemberId}
type MemberActivated is event {memberId: MemberContext.MemberId, memberMeta: MemberMetaInfo}
Expand All @@ -40,10 +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}
type GetMemberInfo is query {memberId: MemberContext.MemberId}
type MemberData is result {memberId: MemberContext.MemberId, memberInfo: MemberInfo, memberMeta: MemberMetaInfo}
type GetMemberForHandle is query {handle: String}
type MemberForHandle is result {memberId: MemberContext.MemberId?}


}
19 changes: 10 additions & 9 deletions src/main/riddl/Gateway/MemberGateway/memberStories.riddl
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
// TODO: Convert this file to new style epics and cases
//Member Gateway Stories
//As a person who would like to use the features of ImprovingApp I would like to register a new user account so that I can access those features
user Member is "A member of an organization"
/*
epic RegisterMember is {
user Member wants "to enroll" so that "member can use the Improving App"
Member wants "to enroll" so that "member can use the Improving App"
}
/*
story RegisterMember is {
epic RegisterMember is {
capability is "Enroll the Member"
benefit is "So Member can use ImprovingApp"
author James is {
Expand All @@ -31,9 +29,12 @@ story RegisterMember is {
}
} briefly "A story about registering a new Member in Improving.app"
described as "This is the story of how a Member signs up in Improving.app"
// TODO: Convert this file to new style epics and cases
//Member Gateway Stories
//As a person who would like to use the features of ImprovingApp I would like to register a new user account so that I can access those features

//As a Member I would like to check the balance of my iAppCoins Account to see if I have enough coin to make a purchase
story GetIAppCoinBalance is {
epic GetIAppCoinBalance is {
As user Member wants to "check the balance of my iAppCoins Account" so that "I can check to see if I have enough coin to make a purchase"
// capability is "Check iAppCoinAccount Balance"
// benefit is "To verify there is enough coin to make a purchase"
Expand All @@ -50,7 +51,7 @@ story GetIAppCoinBalance is {
}

//As a Member of ImprovingApp I would like to subscribe to Event Update Stream so I can follow the progress of Events
story GetEventUpdates is {
epic GetEventUpdates is {
capability is "Member would like to receive event updates as notifications in their Inbox"
benefit is "Member can stay up to date regarding the Event"
case HappyPath is {
Expand All @@ -61,7 +62,7 @@ story GetEventUpdates is {
}

//As a Member of ImprovingApp I would like to subscrbe to the Order Stream so I can track the progress of my Orders
story GetOrderUpdates is {
epic GetOrderUpdates is {
capability is "Member would like to recieved notifications about thier Order status in their Inbox"
benefit is "So they can know how their order is progressing toward completion"
case HappyPath is {
Expand All @@ -72,7 +73,7 @@ story GetOrderUpdates is {
}

//As a Member I would like to express interest in an Event that has not been Reserved
story IAmInterestedInAttending is {
epic IAmInterestedInAttending is {
capability is "User Expresses interested in attending an Event that has not opened Ticket sales yet"
beneift is "Get on the list of event notifications (like when tickets go on sale)"
case HappyPath is {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
epic Notifications is { ??? }
//Notification Gateway Stories
// TODO: Convert to epics and cases
epic Notifications is { ??? }
/*
As a Member who made a purchase at a Store I would like to receive purchase receipts and order status details electronically
As a Member I would like to download my Notifications (tickets, receipts, etc.)
Expand Down
Loading

0 comments on commit f1458f1

Please sign in to comment.