enum B2bCustomCandleDecisionKind { APPROVED REJECTED } model B2bCustomCandleRequest { id String @id @default(uuid()) @db.Uuid organizationId String @map("organization_id") @db.Uuid accountId String @map("account_id") @db.Uuid requestedById String @map("requested_by_id") @db.Uuid quantity Int waxType String @map("wax_type") @db.VarChar(100) fragrance String @db.VarChar(160) container String @db.VarChar(160) color String @db.VarChar(100) brandingRequirements String @map("branding_requirements") @db.VarChar(1000) specifications String @db.VarChar(2000) idempotencyKey String @map("idempotency_key") @db.Uuid requestHash String @map("request_hash") @db.Char(64) createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz(3) organization Organization @relation(fields: [organizationId], references: [id], onDelete: Restrict) account BusinessAccount @relation(fields: [accountId, organizationId], references: [id, organizationId], onDelete: Restrict) requestedBy User @relation(fields: [requestedById, organizationId], references: [id, organizationId], onDelete: Restrict) decision B2bCustomCandleDecision? @@unique([id, organizationId]) @@unique([organizationId, idempotencyKey]) @@index([organizationId, accountId, createdAt, id]) @@map("b2b_custom_candle_requests") } model B2bCustomCandleDecision { id String @id @default(uuid()) @db.Uuid organizationId String @map("organization_id") @db.Uuid requestId String @unique @map("request_id") @db.Uuid actorId String @map("actor_id") @db.Uuid kind B2bCustomCandleDecisionKind note String @db.VarChar(1000) idempotencyKey String @map("idempotency_key") @db.Uuid requestHash String @map("request_hash") @db.Char(64) createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz(3) organization Organization @relation(fields: [organizationId], references: [id], onDelete: Restrict) request B2bCustomCandleRequest @relation(fields: [requestId, organizationId], references: [id, organizationId], onDelete: Restrict) actor User @relation(fields: [actorId, organizationId], references: [id, organizationId], onDelete: Restrict) @@unique([requestId, organizationId]) @@unique([organizationId, idempotencyKey]) @@map("b2b_custom_candle_decisions") }