Skip to content

Rental Approval Flow

(click to open at actual size)


Rental Approval Flow Diagram
Rental Approval Flow Diagram Source
rental-approval-flow.sd
-- render at https://sequencediagram.org
entryspacing 0.7
frame #lightblue Rental Approval Flow 9/3/2024
participantspacing 2
entryspacing 0.5
bottomparticipants
actor "Customer" as customer #orange
lifelinestyle customer #lightgray:1:solid
participant "Louvelle Backend" as backend #D35DC5
lifelinestyle backend #lightgray:1:solid
participant "Stripe" as stripe #lightgreen
lifelinestyle stripe #lightgray:1:solid
database "Rentals Table" as rentals #lightgreen
lifelinestyle rentals #lightgray:1:solid
database "Items Table" as items #lightblue
lifelinestyle items #lightgray:1:solid
participant "Rentals Logs" as rlogs #lightgreen
lifelinestyle rlogs #lightgray:1:solid
actor "Owner" as owner #orange
lifelinestyle owner #lightgray:1:solid
participant "Event Bus" as bus #lightblue
lifelinestyle bus #lightgray:1:solid
customer -> backend:Request Rental
<color #gray>Item ID, Dates, Price</color>
backend -> stripe:Request Authorization
# FAILURE
alt FAILURE
stripe --#red> backend:<color #red>Denied</color>
parallel
backend --> rlogs:Log Authorization Failure
backend --#red> customer:<color #red>Denied</color>
parallel end
activate rlogs
deactivateafter rlogs
box over customer:<color #red>Error Message</color>
# SUCCESS
else SUCCESS
stripe --#green> backend:<color #green>Success</color>
parallel
backend --> rlogs:Log Authorization Success
parallel end
backend -> rentals: Store Transaction Authorization
activate rentals
deactivateafter rentals
backend -> items:Request Item Details
activate items
items --> backend: Item Details
deactivateafter items
alt CONCIERGE ITEM
box over backend:<color #0273bb>CONCIERGE ITEM
backend -> rentals:Create Rental Record <color #gray>status: approved, NOT settled
activate rentals
deactivateafter rentals
backend --> rlogs:Log Rental Record
backend -> stripe:Settle Payment
# settle payment
alt Settled
parallel
box over stripe:<color #green>SETTLED</color>
stripe -> backend:
parallel end
backend -> rentals:Update Rental Record <color #gray>status: approved, settled
activate rentals
deactivateafter rentals
backend --> rlogs:Log Payment Settled
backend --#green> customer:<color #green>Rental Approved</color>
box over customer:<color #green>Rental Approved</color>
backend -> bus:Create Timed Rental Event <color #gray>( Date / Time, item ID, rental ID )
aboxright over bus:<color #0273bb>NEW RENTAL:<color #gray>
Start Date, Rental ID,
Item ID, Destination
backend --> rlogs:Log Rental Event Created
else Not Settled
parallel
box over stripe:<color #red>NOT SETTLED</color>
stripe -> backend:
parallel end
backend --> rlogs:Log Payment Not Settled
backend -#red> customer:<color #red>Payment Issue</color>
rbox over customer:<color #red>Payment Issue</color>
end
else PEER TO PEER ITEM
box over backend:<color #0273bb>PEER-TO-PEER ITEM
backend -> rentals:Create Rental Record <color #gray>status: pending
activate rentals
deactivateafter rentals
backend --#gray> customer:<color #gray>Rental Pending</color>
box over customer:<color #gray>Rental Waiting
For Approval</color>
backend -> owner:NOTIFICATION: Pending Rentals
note over owner:<color #0273bb>"You have rentals
waiting for approval!"
alt APPROVED
parallel
rbox over owner:<color #green>APPROVED</color>
owner -> backend:
parallel end
backend --> rlogs:Log Rental Approved
backend -> rentals:Request Rental Record
activate rentals
rentals --> backend: Rental Record
deactivateafter rentals
space
backend -> stripe:Settle Payment <color #gray>Transaction ID, Amount, etc
space
# settle payment
alt SETTLED
parallel
box over stripe:<color #green>SETTLED</color>
stripe -> backend:
parallel end
backend --> rlogs:Log Payment Settled
backend -> rentals:Update Rental Record <color #gray>status: approved, settled
activate rentals
deactivateafter rentals
backend -#green> customer:<color #green>NOTIFICATION: Rental Approved</color>
note over customer:<color #green>"Rental of Item 123
has been approved"</color>
backend -> bus:Create Timed Rental Event <color #gray>( Date / Time, item ID, rental ID )
aboxright over bus:<color #0273bb>NEW RENTAL:<color #gray>
Start Date, Rental ID,
Item ID, Destination
backend --> rlogs:Log Rental Event Created
else NOT SETTLED
parallel
box over stripe:<color #red>NOT SETTLED</color>
stripe -> backend:
parallel end
backend --> rlogs:Log Payment Not Settled
backend -#red> customer:<color #red>NOTIFICATION: Payment Issue</color>
note over customer:<color #red>"Payment Issue"
<color #gray>Link to Support</color>
end
backend -> rentals
else NOT APPROVED
parallel
rbox over owner:<color #red>NOT APPROVED</color>
owner -> backend:
parallel end
backend --> rlogs:Log Rental Not Approved
backend -#red> customer:<color #red>NOTIFICATION: Not Approved</color>
note over customer:<color #red>"Not Approved"
<color #gray>Link to Support</color>
end
end
end