Skip to content

trungdq88/do-an-xe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

do-an-xe

Slack App đặt đồ ăn xế ở Silicon Straits Saigon.

Post menu to Slack

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

User create an order

gif1 gif9 gif8

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

Releases

No releases published

Packages

No packages published