Skip to content

topcoder-platform/billing-accounts-api-v6

Repository files navigation

Topcoder Billing Accounts & Clients API (NestJS + Prisma)

Project structure:

  • NestJS project
  • Prisma schema for Clients, Billing Accounts, Locked & Consumed amounts
  • Endpoints:
    • GET /billing-accounts
    • POST /billing-accounts
    • GET /billing-accounts/:billingAccountId (includes locked/consumed arrays + budget totals)
    • PATCH /billing-accounts/:billingAccountId
    • PATCH /billing-accounts/:billingAccountId/lock-amount (0 amount = unlock)
    • PATCH /billing-accounts/:billingAccountId/consume-amount (deletes locks for challenge, then upserts consumed)
    • GET /clients (search by name/codeName/status/date range; sort & pagination)
    • GET /clients/:clientId
    • PATCH /clients/:clientId

Authorization

  • JWT middleware via tc-core-library-js attaches req.authUser
  • Guards for Roles (e.g., Administrator) and M2M Scopes are provided.
  • Configure env: AUTH_SECRET or AUTH0_URL/AUDIENCE/ISSUER as needed.

Quickstart

cp .env.example .env
# edit .env and set DATABASE_URL, auth vars, etc.

pnpm i
pnpm run prisma:generate
pnpm run prisma:migrate

pnpm run dev
# or
pnpm run build && pnpm start

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •