OpenApp Command
Origin Splash Screen
no fields
openedAt : datetime
OpenApp
Given Unit
When OpenApp
Then AppOpened
No prior state needed. App opened.
SetLocation Command
PNG
get-location-screen.png
location : string
location : string
SetLocation
Given [AppOpened]
When SetLocation
Then LocationSet
App has been opened, driver provides location.
CurrentLocation View
Origin NoScreen
location : string
LocationSet
LocationAvailable
Given [LocationSet]
Then CurrentLocation
Location has been set, provide it for expense entry.
LogExpense Command
PNG
expense-entry-screen.png
machineType: string
quantity: int
pricePerMachine: decimal
paymentMethod: string
location: string
expenseId: guid
machineType: string
quantity: int
pricePerMachine: decimal
totalCost: decimal
paymentMethod: string
location: string
loggedAt: datetime
LogNewExpense
Given [LocationSet]
When LogExpense
Then LaundryExpenseLogged
Location must be established. Driver logs expense details.
RecentExpenses View
Origin NoScreen
expenses: list
totalSpent: decimal
expenseCount: int
location: string
LaundryExpenseLogged
RecentExpensesWithinWindow
Given [LaundryExpenseLogged]
When loggedAt within 3 hours
Then RecentExpenses
Shows all expenses logged within the last 3 hours.
OpenApp C
originSplash Screen
commandOpenApp
eventAppOpened

G Unit W OpenApp T AppOpened
SetLocation C
originGet Location Screen
commandSetLocation
eventLocationSet

G [AppOpened] W SetLocation T LocationSet
CurrentLocation V
viewCurrentLocation
readsLocationSet

G [LocationSet] T CurrentLocation
LogExpense C
originExpense Entry
commandLogExpense
eventLaundryExpenseLogged

G [LocationSet] W LogExpense T LaundryExpenseLogged
RecentExpenses V
viewRecentExpenses
readsLaundryExpenseLogged

G [LaundryExpenseLogged] W within 3hrs T RecentExpenses