Files
psp_api/prisma/schema/shared/customers.prisma
T
ahasani a350ec7990 feat: add consumer accounts and business activities management
- Implemented AccountsService for managing consumer accounts including create, update, delete, and find operations.
- Created DTOs for account creation and updates.
- Developed BusinessActivitiesController and BusinessActivitiesService for handling business activities related to consumers.
- Added complexes management with ComplexesController and ComplexesService.
- Introduced POS management with ComplexPosesController and ComplexPosesService.
- Created necessary DTOs for business activities and POS.
- Established Licenses management with LicensesController and LicensesService.
- Integrated consumer management with PartnerConsumersController and PartnerConsumersService.
- Added Prisma module imports and service connections across modules.
2026-04-23 20:59:39 +03:30

52 lines
1.5 KiB
Plaintext

model Customer {
id String @id @default(ulid())
is_favorite Boolean? @default(false)
created_at DateTime @default(now()) @db.Timestamp(0)
updated_at DateTime @updatedAt @db.Timestamp(0)
deleted_at DateTime? @db.Timestamp(0)
type CustomerType
unknown_customer Json?
customer_individual CustomerIndividual?
customer_legal CustomerLegal?
sales_invoices SalesInvoice[]
@@map("customers")
}
model CustomerIndividual {
first_name String @db.VarChar(255)
last_name String @db.VarChar(255)
national_id String @db.Char(10)
postal_code String @db.Char(10)
economic_code String? @db.Char(10)
customer_id String @id
customer Customer @relation(fields: [customer_id], references: [id], onDelete: Cascade)
complex_id String
complex Complex @relation(fields: [complex_id], references: [id])
@@unique([complex_id, national_id])
@@index([complex_id])
@@map("customer_individuals")
}
model CustomerLegal {
company_name String @db.VarChar(255)
economic_code String @db.Char(10)
registration_number String @db.Char(20)
postal_code String @db.Char(10)
customer_id String @id
customer Customer @relation(fields: [customer_id], references: [id], onDelete: Cascade)
complex_id String
complex Complex @relation(fields: [complex_id], references: [id])
@@unique([complex_id, registration_number])
@@index([complex_id])
@@map("customer_legal")
}