Models in App - nuthanc/microservice GitHub Wiki

User Model

  • email
  • password

While storing

  • id
  • password is hashed(While sending back the Response, password is deleted from it)

Ticket Model in tickets service

  • title
  • price
  • userId
While storing
  • id
  • version
  • orderId (optional)

Order Model

  • ticket(ref feature)
    • Only ticketId could have been passed, but the whole ticket document was passed for Type Checking
    • But internally, Order model stores only the ticketId
  • status
  • expiresAt
  • userId
While storing
  • orderId
  • version

Ticket Model in orders service

  • title
  • price
  • id (derived from tickets service's ticket id)
While storing
  • version
  • isReserved (created using ticketSchema.methods)

Order Model in payments service

  • id(order)
  • price(ticket)
  • status
  • userId
  • version

Payments Model in payments service

  • orderId
  • stripeId(charge.id)
While storing
  • id(payments)