parent
a8869e5fdd
commit
8b62801f8c
2 changed files with 67 additions and 0 deletions
@ -0,0 +1,3 @@ |
|||||||
|
{ |
||||||
|
"semi": false |
||||||
|
} |
@ -0,0 +1,64 @@ |
|||||||
|
# User |
||||||
|
|
||||||
|
```ts |
||||||
|
type User = { |
||||||
|
id: uuid |
||||||
|
name: string |
||||||
|
email: string |
||||||
|
password: string |
||||||
|
} |
||||||
|
``` |
||||||
|
|
||||||
|
# UserAccount |
||||||
|
|
||||||
|
```ts |
||||||
|
type UserAcccount = { |
||||||
|
user_id: uuid |
||||||
|
account_id: uuid |
||||||
|
} |
||||||
|
``` |
||||||
|
|
||||||
|
- join table between User <-> Account. |
||||||
|
- use case: account belongs to more than 1 person |
||||||
|
|
||||||
|
# Account |
||||||
|
|
||||||
|
```ts |
||||||
|
type Account = { |
||||||
|
id: uuid |
||||||
|
name: string // example: Household Expenses |
||||||
|
details: string |
||||||
|
income: integer // cents // total income |
||||||
|
expenses: integer // cents // total expenses |
||||||
|
} |
||||||
|
``` |
||||||
|
|
||||||
|
- belongs to User |
||||||
|
- has many transactions |
||||||
|
|
||||||
|
# Stack |
||||||
|
|
||||||
|
- belongs to account |
||||||
|
|
||||||
|
```ts |
||||||
|
type Stack = { |
||||||
|
id: uuid |
||||||
|
account_id: uuid |
||||||
|
name: string |
||||||
|
details: string |
||||||
|
amount: integer |
||||||
|
} |
||||||
|
``` |
||||||
|
|
||||||
|
# Transaction |
||||||
|
|
||||||
|
- belongs to Stack |
||||||
|
|
||||||
|
```ts |
||||||
|
type Transaction = { |
||||||
|
id: uuid |
||||||
|
stack_id: string |
||||||
|
amount: integer // cents |
||||||
|
details: string |
||||||
|
} |
||||||
|
``` |
Loading…
Reference in new issue