Files
billing/prisma/schema.prisma
Ruslan Bakiev 2d96afabec
All checks were successful
Build Docker Image / build (push) Successful in 1m44s
Migrate billing backend from Django to Express + Apollo Server + Prisma
Replace Python/Django/Graphene with TypeScript/Express/Apollo Server.
Same 2 endpoints (team/m2m), same JWT auth, same TigerBeetle integration.
Prisma ORM replaces Django ORM for Account/OperationCode/ServiceAccount.
2026-03-09 09:13:07 +07:00

44 lines
1.0 KiB
Plaintext

generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("BILLING_DATABASE_URL")
}
enum AccountType {
USER
SERVICE
}
model Account {
uuid String @id @default(uuid()) @db.Uuid
name String @db.VarChar(255)
accountType AccountType @default(USER) @map("account_type")
description String?
createdAt DateTime @default(now()) @map("created_at")
serviceInfo ServiceAccount?
@@map("billing_app_account")
}
model OperationCode {
id Int @id @default(autoincrement())
code Int @unique
name String @unique @db.VarChar(255)
description String?
createdAt DateTime @default(now()) @map("created_at")
@@map("billing_app_operationcode")
}
model ServiceAccount {
accountUuid String @id @map("account_id") @db.Uuid
slug String @unique @db.VarChar(50)
account Account @relation(fields: [accountUuid], references: [uuid], onDelete: Cascade)
@@map("billing_app_serviceaccount")
}