Slack App đặt đồ ăn xế ở Silicon Straits Saigon.
title Send menu to Slack
Admin->Slack: Enter '/do-an' command
Slack->do-an-xe: (Webhook) trigger /order
do-an-xe->AirTable: Get food menu
AirTable->do-an-xe: Return menu
do-an-xe->Slack: (Webhook) post to channel
title Create an order
User->Slack: click order button
Slack->do-an-xe: HTTP request
do-an-xe->AirTable: is order form closed yet?
AirTable->do-an-xe: return order form status
alt order form is closed by admin
do-an-xe->Slack: show error
else order form is available
do-an-xe->AirTable: check user staff ID registered
AirTable->do-an-xe: staff information
alt staff not registered to Slack user id
do-an-xe->Slack: show register dialog
Slack->User: show register dialog
User->Slack: enter register information
Slack->do-an-xe: send register information
do-an-xe->AirTable: update Slack user id to Staff (registered)
end
do-an-xe->AirTable: check remaining coupon
AirTable->do-an-xe: return remaining coupon
alt remaining coupon < order quantity
do-an-xe->Slack: show error to User
else remaining coupon >= order quantity
do-an-xe->AirTable: create order
AirTable->do-an-xe: success
do-an-xe->Slack: show success message
end
end