/teste-cumbuca

Repo for Cumbuca test for Software Developer

Primary LanguageTypeScriptMIT LicenseMIT

teste-cumbuca

Repo for Cumbuca test for Software Developer
Run in Postman

Features

  • Register
  • Authentication
  • Authorization
  • Deposit
  • Transfer
  • Withdraw
  • Refund
  • Snapshot of wallet funds
  • List snapshots
  • Rollback Wallets based on a snapshot
  • List Transactions

Tech stack

  • Fastify
  • MongoDB
  • Redis
  • Bull
  • TypeScript
  • NodeJS

Business rules

  • Register:
    • full name, email, password and taxId are required
    • email or taxId cannot be used by another user
  • Authentication:
    • the credentials must be right
    • a token is generated and can't be forged
  • Transfer:
    • can't transfer if the amount is larger than the wallet funds or wallet does not exists
  • Withdraw:
    • can't withdraw if the amount is larger than the wallet funds
  • List Transactions:
    • startDate and endDate should be valid dates
    • startDate should come first than endDate
  • Refund:
    • transaction should be a transaction of type transfer and not have a status of refunded
  • Rollback Transactions:
    • snapshot should exist and all wallets that where snapshotted will be reversed to that point in time