prisma: modelo Client + migração 20260527225728_add_client + seed dev (10 clientes)
api: GET /clients (list, busca, filtro atividade/financeiro, paginação) + GET /clients/:id
rep vê carteira própria; supervisor/admin vê tudo; activityStatus calculado de lastOrderAt
@sar/api-interface: ClientSummarySchema, ClientDetailSchema, ClientListResponseSchema
web: ClientsPage (tabela AntD, busca, filtro), DevLogin (token dev), authStore, Bearer no apiFetch
oq-4 resolvida: creditLimit gerenciado no SAR
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
21 lines
776 B
TypeScript
21 lines
776 B
TypeScript
// Prisma 7 config — usado pelo CLI (migrate, generate, studio).
|
|
// Conexão de runtime fica no WorkspacePrismaPool (adapter por workspace).
|
|
// CODING-RULES PGD-DB-001: DATABASE_URL aponta direto ao PG na porta 5432 (sem PgBouncer).
|
|
|
|
import path from 'node:path';
|
|
import { defineConfig } from 'prisma/config';
|
|
|
|
export default defineConfig({
|
|
schema: path.join(import.meta.dirname, 'prisma/schema.prisma'),
|
|
datasource: {
|
|
// Prisma 7: url aqui serve apenas para o CLI (migrate/generate/studio).
|
|
// Runtime usa WorkspacePrismaPool → PrismaClient({ adapter: new PrismaPg(pool) }).
|
|
url:
|
|
process.env['DATABASE_URL'] ??
|
|
'postgresql://sar:sar_dev_password@localhost:5432/sar_workspace_dev',
|
|
},
|
|
migrations: {
|
|
seed: 'tsx prisma/seed.ts',
|
|
},
|
|
});
|