From 8b62801f8cfe8dd0f9a13a6be326c79c09137dbe Mon Sep 17 00:00:00 2001 From: Elijah Lucian Date: Wed, 14 Apr 2021 13:47:53 -0700 Subject: [PATCH] cashstax database docs --- .prettierrc | 3 ++ server/database-docs.md | 64 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 .prettierrc create mode 100644 server/database-docs.md diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..cce9d3c --- /dev/null +++ b/.prettierrc @@ -0,0 +1,3 @@ +{ + "semi": false +} diff --git a/server/database-docs.md b/server/database-docs.md new file mode 100644 index 0000000..9a7e610 --- /dev/null +++ b/server/database-docs.md @@ -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 +} +```