Skip to content

Commit f39c7a8

Browse files
committed
better layout
1 parent 8174fb2 commit f39c7a8

File tree

1 file changed

+32
-25
lines changed

1 file changed

+32
-25
lines changed

concept/membership-v2.md

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,42 @@
11
# Membership V2
22

3-
```md
4-
user
5-
----
6-
id
7-
auto_renew, Boolean
8-
current_product, enum(ABO, BENEFACTOR_ABO, MONTHLY_ABO, ABO_GIVE_MONTHS)
3+
## Tables
94

5+
### user
106

11-
subscription credit
12-
-------------------
13-
id
14-
user_id
15-
credit, INT, Amount of days
16-
createdAt
7+
| Field | |
8+
| --- | --- |
9+
| **`id`** | |
10+
| **`auto_renew`** | Boolean |
11+
| **`current_product`** | enum(ABO, BENEFACTOR_ABO, MONTHLY_ABO, ABO_GIVE_MONTHS) |
1712

18-
subscription debit
19-
------------------
20-
user_id
21-
debit
22-
createdAt Date
23-
endedAt NULL | Date
13+
### subscription credit
2414

25-
CONSTRAINT "only one active debit per user" UNIQUE(user.id, endedAt)
15+
| Field | |
16+
| --- | --- |
17+
| **`id`** | |
18+
| **`user_id`** | |
19+
| **`credit`** | INT, Amount of days |
20+
| **`createdAt`** | Date |
2621

27-
payment history
28-
---------------
29-
price
30-
product, enum(ABO, BENEFACTOR_ABO, MONTHLY_ABO, ABO_GIVE_MONTHS)
31-
subscription.id
32-
```
22+
### subscription debit
23+
24+
| Field | |
25+
| --- | --- |
26+
| **`user_id`** | |
27+
| **`debit`** | |
28+
| **`createdAt`** | Date |
29+
| **`endedAt`** | NULL | Date |
30+
31+
`CONSTRAINT "only one active debit per user" UNIQUE(user.id, endedAt)`
32+
33+
### payment history
34+
35+
| Field | |
36+
| --- | --- |
37+
| **`price`** | |
38+
| **`product`** | enum(ABO, BENEFACTOR_ABO, MONTHLY_ABO, ABO_GIVE_MONTHS) |
39+
| **`subscription`.id** | |
3340

3441
## Queries
3542

0 commit comments

Comments
 (0)