refactor: complete v2 refactoring plan (Phases 1-5)
Phase 1 — Quick Wins: centralize formatMoney/formatCents, extract findUniqueOrThrow helper (19 routers), shared Prisma select constants, useInvalidatePlanningViews hook, status badge consolidation, composite DB indexes. Phase 2 — Timeline Split: extract TimelineContext, TimelineResourcePanel, TimelineProjectPanel; split 28-dep useMemo into 3 focused memos. TimelineView.tsx reduced from 1,903 to 538 lines. Phase 3 — Query Performance: server-side filtering for getEntriesView, remove availability from timeline resource select, SSE event debouncing (50ms batch window). Phase 4 — Estimate Workspace: extract 7 tab components and 3 editor components. EstimateWorkspaceClient 1,298→306 lines, EstimateWorkspaceDraftEditor 1,205→581 lines. Phase 5 — Package Cleanup: split commit-dispo-import-batch (1,112→573 lines), extract shared pagination helper with 11 tests. All tests pass: 209 API, 254 engine, 67 application. Co-Authored-By: claude-flow <ruv@ruv.net>
This commit is contained in:
@@ -848,6 +848,7 @@ model EstimateVersion {
|
||||
notes String?
|
||||
lockedAt DateTime?
|
||||
projectSnapshot Json @db.JsonB @default("{}")
|
||||
commercialTerms Json? @db.JsonB
|
||||
|
||||
estimate Estimate @relation(fields: [estimateId], references: [id], onDelete: Cascade)
|
||||
assumptions EstimateAssumption[]
|
||||
@@ -1170,6 +1171,7 @@ model DemandRequirement {
|
||||
@@index([projectId])
|
||||
@@index([startDate, endDate])
|
||||
@@index([status])
|
||||
@@index([projectId, status, startDate])
|
||||
@@map("demand_requirements")
|
||||
}
|
||||
|
||||
@@ -1202,6 +1204,8 @@ model Assignment {
|
||||
@@index([projectId])
|
||||
@@index([startDate, endDate])
|
||||
@@index([status])
|
||||
@@index([resourceId, status, startDate])
|
||||
@@index([projectId, startDate, endDate])
|
||||
@@map("assignments")
|
||||
}
|
||||
|
||||
@@ -1233,6 +1237,7 @@ model Vacation {
|
||||
@@index([resourceId])
|
||||
@@index([startDate, endDate])
|
||||
@@index([status])
|
||||
@@index([resourceId, status, startDate, endDate])
|
||||
@@map("vacations")
|
||||
}
|
||||
|
||||
@@ -1297,6 +1302,12 @@ model SystemSettings {
|
||||
smtpPassword String?
|
||||
smtpFrom String?
|
||||
smtpTls Boolean? @default(true)
|
||||
// Global viewer-side anonymization
|
||||
anonymizationEnabled Boolean? @default(false)
|
||||
anonymizationDomain String? @default("superhartmut.de")
|
||||
anonymizationSeed String?
|
||||
anonymizationMode String? @default("global")
|
||||
anonymizationAliases Json? @db.JsonB
|
||||
// Vacation defaults
|
||||
vacationDefaultDays Int? @default(28) // default annual entitlement
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
Reference in New Issue
Block a user