Skip to content

Commit

Permalink
Update syntax to meet future RIDDL 0.51.0 release
Browse files Browse the repository at this point in the history
* There are still many validation errors
  • Loading branch information
reid-spencer committed Sep 7, 2024
1 parent f9f3748 commit 250ecdd
Show file tree
Hide file tree
Showing 33 changed files with 1,060 additions and 872 deletions.
11 changes: 7 additions & 4 deletions src/main/riddl/AllIdsProjections/allIdsProjections.riddl
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ context AllIdsProjections is {
projector AllTenantIdsView is {
record AllTenantIdsFields {
tenant: TenantId
//tenantStatus: TenantContext.Status
}
} with { briefly "possibly add: tenantStatus: TenantContext.Status" }
handler AllTenantIdsViewHandler is {

on event TenantEstablished {
Expand All @@ -42,7 +41,10 @@ context AllIdsProjections is {
projector AllOrgIdsView is {
record AllOrgIdsFields {
org: OrganizationId
//orgStatus: OrganizationContext.Status
} with {
description as {
"maybe with: orgStatus: OrganizationContext.Status"
}
}
handler AllOrgIdsViewHandler is {
on event ImprovingApp.OrganizationContext.OrganizationEstablished {
Expand All @@ -60,7 +62,8 @@ context AllIdsProjections is {
projector AllEventIdsView is {
record AllEventIdsFields{
event: EventId
//eventStatus: EventContext.Status
} with {
briefly "possibly add: eventStatus: EventContext.Status"
}
handler AllTenantIdsViewHandler is {
on event EventScheduled {
Expand Down
28 changes: 21 additions & 7 deletions src/main/riddl/Applications/application.riddl
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
application UserInterface is {
command EstablishOrganization is {
info: MemberContext.EditableInfo briefly "Details about an organization required for it to exist. See OrganizationContext.Organization.Info for details.",
info: MemberContext.EditableInfo with {
briefly "Details about an organization required for it to exist. See OrganizationContext.Organization.Info for details."
},
tenant: TenantId,
parent: OrganizationContext.Parent?,
members: MemberList,
owners: OwnerList,
contacts: ContactList,
onBehalfOf: MemberContext.MemberId briefly "The Id of the Member who is issuing the command."
} briefly "If parentOrg is not defined you are creating a BaseOrganization. If it is, you are creating a SubOrganization."

onBehalfOf: MemberContext.MemberId with {
briefly "The Id of the Member who is issuing the command."
}
} with {
described as {
|If parentOrg is not defined you are creating a BaseOrganization.
|If it is, you are creating a SubOrganization.
}
}
result OrganizationEstablished is {
organizationId: OrganizationId briefly "Unique identifier returned by EstablishOrganization command",
organizationId: OrganizationId with {
briefly "Unique identifier returned by EstablishOrganization command"
},
info: OrganizationContext.Info,
parent: OrganizationContext.Parent?,
members: MemberList,
Expand All @@ -37,12 +47,16 @@ application UserInterface is {
}

command RegisterMember is {
info: MemberContext.EditableInfo briefly "Details about a member required for it to exist. See MemberContext.Member.MemberInfo for details.",
info: MemberContext.EditableInfo with {
briefly "Details about a member required for it to exist. See MemberContext.Member.MemberInfo for details."
},
onBehalfOf: MemberContext.MemberId
}

result MemberRegistered is {
memberId: MemberContext.MemberId briefly "Unique identifier returned by RegisterMember command",
memberId: MemberContext.MemberId with {
briefly "Unique identifier returned by RegisterMember command"
} ,
info: MemberContext.EditableInfo,
meta: MemberMetaInfo
}
Expand Down
17 changes: 8 additions & 9 deletions src/main/riddl/Commerce/commerce.riddl
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ context Commerce is {
type NullState is Nothing

entity Promotion is {
state Active of Commerce.NullState is {???}
state Active of Commerce.NullState
handler ActivePromotionHandler is {???}
state Expired of Commerce.NullState is {???}
state Expired of Commerce.NullState
handler InactivePromotionHandler is {???}
} //not part of MVP

Expand All @@ -33,20 +33,19 @@ context Commerce is {
amount: Number,
dateProcessed: DateTime
}
state Payment of PaymentState is {
handler PaymentHandler is {???}
}
state Payment of PaymentState
handler PaymentHandler is {???}
}
entity Cart is {???} //develop as a future feature - Persistant Cart - Training exercise

entity Delivery is {
state Pending of Commerce.NullState is {???}
state Pending of Commerce.NullState
handler PendingDeliveryHandler is {???}
state Ready of Commerce.NullState is {???}
state Ready of Commerce.NullState
handler ReadyDeliveryHandler is {???}
state EnRoute of Commerce.NullState is {???}
state EnRoute of Commerce.NullState
handler EnRoutDeliveryHandler is {???}
state Delivered of Commerce.NullState is {???}
state Delivered of Commerce.NullState
handler DeliveredDeliveryHandler is {???}
} //not part of MVP
}
27 changes: 16 additions & 11 deletions src/main/riddl/Epics/epics.riddl
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,33 @@ user Member is "any member (user) of the system"
include "memberEpics"

epic EstablishOrganization is {
by author Reid
user OrgOwner wants "to establish an organization" so that "they can conduct business"
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 with { briefly "fill out form" }
step
from output ImprovingApp.UserInterface.Organization.DisplayOrganization
"organizationAdded"
to user OrgOwner briefly "organization added"
from output ImprovingApp.UserInterface.Organization.DisplayOrganization "organizationAdded"
to user OrgOwner with { briefly "organization added" }
}
} briefly "A story about establishing an organization in Improving.app"
} with {
by author Reid
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 is {
by author Reid
user OrgOwner wants "to register a member" so that "they can fill the roster for their organization"
case primary is {
//user OrgOwner wants "to register a member" so that "they can fill the roster for their organization"
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"
} with {
by author Reid
briefly "A story about registering a member into an organization"
described as "TBD"

epic UpdateOrganizationInfo is {???}
}
// epic UpdateOrganizationInfo is {???}

/* epic
Create X Tenants
Expand Down
4 changes: 3 additions & 1 deletion src/main/riddl/Epics/memberEpics.riddl
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
epic RegisterMember is {
user Member wants "to register as a member" so that "they can perform functions in the app"
???
} with {
by author Alex
term 'member' described as {
term 'member' is {
| 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.
Expand Down
2 changes: 2 additions & 0 deletions src/main/riddl/Events/eventContext.riddl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ type EventId is Id (ImprovingApp.Events.EventContext.Event)
briefly "Unique identifier for Tenant Entity"

context EventContext is {
by author James
by author Alex
include "eventMessages"
include "eventTypeDefinitions"
include "eventSources"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,24 @@ context DemoScenarioGateway is {
maxOrgsDepth: Integer,
maxOrgsWidth: Integer,
numMembersPerOrg: Integer,
numEventsPerOrg: Integer,
//ticketTypesPerEvent: TicketType+
} briefly "contains all parameters for a DemoScenario - all Integers must be > 0 and at least one TicketType must be provided"

numEventsPerOrg: Integer
} with {
briefly "contains all parameters for a DemoScenario"
described by {
"all Integers must be > 0 and at least one TicketType must be provided"
"maybe add: //ticketTypesPerEvent: TicketType+"
}
}
type ScenarioStarted is event {
tenants: TenantId+,
orgsByTenant: mapping from TenantId to OrganizationId+,
membersByOrg: mapping from OrganizationId to MemberId+,
eventsByOrg: mapping from OrganizationId to EventId+,
store: ImprovingApp.StoreContext.StoreId,
ticketsByEvent: mapping from EventId to SKU+
} briefly "contains all data created for a DemoScenario with inter-related references in key mapping provided"

} with {
briefly "contains all data created for a DemoScenario with inter-related references in key mapping provided"
}
type PurchaseProduct is command {
productSku: ProductContext.SKU
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/riddl/Gateway/EventGateway/eventStories.riddl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

epic EventStories is { ??? }
// epic EventStories is { ??? }

// TODO: Convert this file to new style epics and cases
// event stories
Expand Down
61 changes: 52 additions & 9 deletions src/main/riddl/Gateway/MemberGateway/memberGateway.riddl
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,23 @@ context MemberGateway is {
type MemberState is any of {active, inactive, suspended, terminated}
type MemberInfo is {
handle: String,
avatar: URL, //thumbnail image of the user. Need to screen to ensure community guidelines compliance. i.e. no porn or offensive content.
avatar: URL with {
briefly "thumbnail image of the user."
described by {
"Need to screen to ensure community guidelines compliance. i.e. no porn or offensive content."
}
},
firstName: String,
lastName: String,
mobileNumber: MobileNumber?,
emailAddress: EmailAddress?,
notificationPreference: ImprovingApp.MemberContext.NotificationPreference,
notificationOptIn: Boolean, //true indicates they allow notifications
organizations: OrganizationId*, //Members must belong to at least one Organization?
relatedMembers: String, //Primary use case is parent/student. I am sure there are others. Might be a better way to document such a relationship.
notificationOptIn: Boolean with { briefly "true indicates they allow notifications" },
organizations: OrganizationId* with { briefly "Members must belong to at least one Organization?" },
relatedMembers: String with {
briefly "Primary use case is parent/student."
described by "I am sure there are others. Might be a betterway to document such a relationship."
}
memberType: MemberType+
}
type MemberMetaInfo is {
Expand All @@ -30,11 +38,46 @@ context MemberGateway is {
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: ImprovingApp.MemberContext.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: ImprovingApp.MemberContext.MemberData*}
type RegisterMember is command {memberToAdd: ImprovingApp.MemberContext.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: ImprovingApp.MemberContext.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 RegisterMemberList is command {
memberList: ImprovingApp.MemberContext.MemberMap+,
registeringMember: MemberContext.MemberId
} with {
briefly "RegisterMemberList creates multiple members with a single call."
described as {
|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).
}
}
event MemberListRegistered is {memberData: ImprovingApp.MemberContext.MemberData*}
command RegisterMember is {
memberToAdd: ImprovingApp.MemberContext.MemberMap,
registeringMember: MemberContext.MemberId?
} with {
briefly "RegisterMember creates a single new member."
described as {
|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
}
}
event MemberRegistered is {
memberId: MemberContext.MemberId,
memberInfo: MemberInfo,
memberMeta: MemberMetaInfo
} with {
briefly "Event issued after either RegisterMember or RegisterMemberList is called."
described as "In the case of RegisterMemberList one event per member in the list is published."
}
command UpdateMemberInfo is {
memberMap: ImprovingApp.MemberContext.MemberMap,
actingMember: MemberContext.MemberId
} with {
briefly "All member info will be overwritten as provided in this command."
described as {
|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 Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
epic Notifications is { ??? }
// epic Notifications is { ??? }
//Notification Gateway Stories
// TODO: Convert to epics and cases
/*
Expand Down
12 changes: 5 additions & 7 deletions src/main/riddl/Gateway/OrderGateway/orderStories.riddl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
epic OrderGatewayStories is { ??? }
// epic OrderGatewayStories is { ??? }
//Order Gateway Stories
// TODO: Convert this file to epics/cases

Expand All @@ -11,16 +11,15 @@ As a Vendor I would like to notify Inventory about product loss (dropped hamburg
//As a Member I would like to maintain my iAppCoins Account so that I can make purchases (funny money) (member has an iAppCoins Account)
//As a Member I can deposit iAppCoins into my account so I can spend them within the app
epic DepositCoins is {
capability is "Deposit coins in iAppCoin Account"
benefit is "So Member can buy things within ImprovingApp"
user Member wants to "deposit coins in iAppCoin Account" so that "Member can buy things within ImprovingApp"
case HappyPath {
title "Deposit Coin"
scope domain ImprovingApp
interaction is {
step from user Member "Deposit Coin" to user App
briefly "Member clicks Deposit button on the deposit form"
with { briefly "Member clicks Deposit button on the deposit form" }
step from user App send command Member.DepositCoin to user GatewayAPI //ImprovingApp.Gateway.MemberGateway.IAppCoinAccount
briefly "App tells the Gateway to deposit coins to their iAppCoin Account"
with { briefly "App tells the Gateway to deposit coins to their iAppCoin Account" }
}
example "Deposit negative coin" {???}
example "Deposit > 99 coin" {???}
Expand All @@ -30,8 +29,7 @@ epic DepositCoins is {

//As a Member I would like to withdraw coins from my iAppCoinsAccount so that I can purchase products/tickets from a store
epic WithdrawCoins is {
capability is "Withdraw coins from iAppCoin Account"
benefit is "To pay for items a Member purchases"
user Member wants to "Withdraw coins from iAppCoin Account" so that "he can pay for items a Member purchases"
case HappyPath {
title "Withdraw Coin"
scope domain ImprovingApp
Expand Down
Loading

0 comments on commit 250ecdd

Please sign in to comment.