Page MenuHomePhabricator
Authored By
andytruong
Jul 9 2019, 10:40 AM
Size
1 KB
Referenced Files
None
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
}
}
```

File Metadata

Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
1699335
Default Alt Text
raw.txt (1 KB)

Event Timeline