Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P2117
Test
Active
Public
Actions
Authored by
andytruong
on Jul 9 2019, 10:40 AM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Referenced Files
F6570413: raw.txt
Jul 9 2019, 10:40 AM
2019-07-09 10:40:18 (UTC+0)
Subscribers
None
## database structure
### tadaa_stream
- id < uint, autoincrease
- title < string: Event type
- created < int: UNIX timestamp
- payload < blob
### tadaa_deals
- uuid < string: local ID of curated deal
- title < string: Short description of
- provider_uuid < string
- cateory_uuid < string
- tags < []string
- discount < Discount
- image < url: For deal preview.
### tadaa_deal_categories
- uuid < string
- slug < string
- title < string
### tadaa_users
- uuid < string: If of our system user.
- status < smallint
- -1: Blocked
- 0: Unsubscribed
- 1: Active
- message_pid: Message user PID we can use to send message to.
### tadaa_subscription
- category_uuid < string
- user_uuid < string
## Use cases
### User starts the journey
```
{
"title": "tadaa/messeneger.start:v1",
"created": int,
"data": {
"psid": int,
"text": ?string
}
}
```
### User unsubscribes
```
{
"title": "tadaa/messeneger.end:v1",
"created": int,
"actor": "user",
"data": {
"psid": int,
"text": ?string,
}
}
```
### Failed to delivery message to user > Handle error > Auto unsubscribe if user already delete the thread.
Commit this event to stream:
```
`
{
"title": "tadaa/messeneger.end:v1",
"created": int,
"actor": "system",
"data": {
"psid": int
}
}
```
Event Timeline
andytruong
created this paste.
Jul 9 2019, 10:40 AM
2019-07-09 10:40:18 (UTC+0)
Log In to Comment