feat(registratura): atomic numbering, reserved slots, audit trail, API endpoints + theme toggle animation
Registratura module: - Atomic sequence numbering (BTG-2026-IN-00125 format) via PostgreSQL upsert - Reserved monthly slots (2/company/month) for late registrations - Append-only audit trail with diff tracking - REST API: /api/registratura (CRUD), /api/registratura/reserved, /api/registratura/audit - Auth: NextAuth session + Bearer API key support - New "intern" direction type with UI support (form, filters, table, detail panel) - Prisma models: RegistrySequence, RegistryAudit Theme toggle: - SVG mask-based sun/moon morph with 360° spin animation - Inverted logic (sun in dark mode, moon in light mode) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -82,3 +82,33 @@ model GisUat {
|
||||
@@index([name])
|
||||
@@index([county])
|
||||
}
|
||||
|
||||
// ─── Registratura: Atomic Sequences + Audit ────────────────────────
|
||||
|
||||
model RegistrySequence {
|
||||
id String @id @default(uuid())
|
||||
company String // BTG, SDT, USW, GRP
|
||||
year Int
|
||||
type String // IN, OUT, INT
|
||||
lastSeq Int @default(0)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@unique([company, year, type])
|
||||
@@index([company, year])
|
||||
}
|
||||
|
||||
model RegistryAudit {
|
||||
id String @id @default(uuid())
|
||||
entryId String
|
||||
entryNumber String
|
||||
action String // created, updated, reserved_created, reserved_claimed, late_registration, closed, deleted
|
||||
actor String
|
||||
actorName String?
|
||||
company String
|
||||
detail Json?
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
@@index([entryId])
|
||||
@@index([company, createdAt])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user