joie / joie-web-app

Joie pairs you with world-class teachers to help you build a healthier and happier life – one step at a time.
https://joie.co
0 stars 0 forks source link

Enrolment functional design #176

Closed yinonov closed 3 years ago

yinonov commented 3 years ago

Is your feature request related to a problem? Please describe. There's no design for sessions - users enrolments data storage

Describe the solution you'd like There should be design for sessions - users enrolments data storage

Additional context

enrolments collection -

should store document relationships between users & sessions purchased.

document model

its id should concatenate the sessionId with userId. e.g. 1pnInIr2t7HQtCUonuC1_7vwvmIaPA0UHQMJ9ZwNF.

price paid
timestamp // should be added on write event trigger on cloud function
uid
sessionId

Session enrolments triggered in web app should produce the following flow

  1. Don't over do design matching and only work with current components. components and design are a different scope
  2. notice the 2 route guards (already implemented in code) for auth & hasPaymentMethod

note: not entirely sure on what end the purchase transaction should be made, client or cloud function. look for also idempotency in firebase.

yinonov commented 3 years ago

closes #167