zgzgorg / zgthx

A community recognition system
https://thx.zgzggala.org
0 stars 0 forks source link

Eng Service Design #2

Open xinbenlv opened 6 years ago

xinbenlv commented 6 years ago

Model Design (fields and behaviors)

ZgUserProfile
 - id: string UUID
 - role: ENUM
 - email: string
 - fullname: string

ZgWallet:
 - id:string UUID
 - ownerId: string(ZgUserProfile.id) [co-index tokenSimble+ownerId]
 - tokenSimbol: string [co-index tokenSimble+ownerId]
 - currentBalance: amount
 - lastestTxId: string(ZgTransactionEntry.id) # TODO think about it.

ZgUserAuth (TODO use Auth0)

ZgTransactionEntry (each transaction will have 2 entries, a > b 100 will show a - 100 with b, b -100 
 - id: string [UUID]
 - ownerId: string [Index]
 - timestamp: datetime [Index nonunique]
 - counterpartId: string(ZgUser)
 - tokenSimbol: string
 - amount: number(+ for receiving, - for sending) 

ZgBenefit
xinbenlv commented 5 years ago

Design Question

  1. Should we have 1 wallet per token type?
  2. Should ownerId of a ZgTransationEntry print to ZgUserProfile or ZgWallet?