feat(planning): ship holiday-aware planning and assistant upgrades
This commit is contained in:
@@ -106,6 +106,12 @@ enum VacationStatus {
|
||||
CANCELLED
|
||||
}
|
||||
|
||||
enum HolidayCalendarScope {
|
||||
COUNTRY
|
||||
STATE
|
||||
CITY
|
||||
}
|
||||
|
||||
enum ImportBatchStatus {
|
||||
DRAFT
|
||||
STAGING
|
||||
@@ -194,6 +200,7 @@ model User {
|
||||
broadcasts NotificationBroadcast[] @relation("broadcastSender")
|
||||
comments Comment[]
|
||||
activeSessions ActiveSession[]
|
||||
reportTemplates ReportTemplate[]
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
@@ -201,6 +208,32 @@ model User {
|
||||
@@map("users")
|
||||
}
|
||||
|
||||
enum ReportTemplateEntity {
|
||||
RESOURCE
|
||||
PROJECT
|
||||
ASSIGNMENT
|
||||
RESOURCE_MONTH
|
||||
}
|
||||
|
||||
model ReportTemplate {
|
||||
id String @id @default(cuid())
|
||||
ownerId String
|
||||
name String
|
||||
description String?
|
||||
entity ReportTemplateEntity
|
||||
config Json @db.JsonB
|
||||
isShared Boolean @default(false)
|
||||
|
||||
owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@index([ownerId, updatedAt])
|
||||
@@unique([ownerId, name])
|
||||
@@map("report_templates")
|
||||
}
|
||||
|
||||
model Account {
|
||||
id String @id @default(cuid())
|
||||
userId String
|
||||
@@ -529,6 +562,7 @@ model Country {
|
||||
isActive Boolean @default(true)
|
||||
|
||||
metroCities MetroCity[]
|
||||
holidayCalendars HolidayCalendar[]
|
||||
resources Resource[]
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
@@ -543,7 +577,8 @@ model MetroCity {
|
||||
countryId String
|
||||
country Country @relation(fields: [countryId], references: [id])
|
||||
|
||||
resources Resource[]
|
||||
resources Resource[]
|
||||
holidayCalendars HolidayCalendar[]
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
@@ -552,6 +587,46 @@ model MetroCity {
|
||||
@@map("metro_cities")
|
||||
}
|
||||
|
||||
model HolidayCalendar {
|
||||
id String @id @default(cuid())
|
||||
name String
|
||||
scopeType HolidayCalendarScope
|
||||
countryId String
|
||||
stateCode String?
|
||||
metroCityId String?
|
||||
isActive Boolean @default(true)
|
||||
priority Int @default(0)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
country Country @relation(fields: [countryId], references: [id], onDelete: Cascade)
|
||||
metroCity MetroCity? @relation(fields: [metroCityId], references: [id], onDelete: Cascade)
|
||||
entries HolidayCalendarEntry[]
|
||||
|
||||
@@index([countryId, scopeType])
|
||||
@@index([countryId, stateCode])
|
||||
@@index([metroCityId])
|
||||
// Scope uniqueness is enforced via partial unique indexes in SQL migrations.
|
||||
@@map("holiday_calendars")
|
||||
}
|
||||
|
||||
model HolidayCalendarEntry {
|
||||
id String @id @default(cuid())
|
||||
holidayCalendarId String
|
||||
date DateTime @db.Date
|
||||
name String
|
||||
isRecurringAnnual Boolean @default(false)
|
||||
source String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
holidayCalendar HolidayCalendar @relation(fields: [holidayCalendarId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@unique([holidayCalendarId, date])
|
||||
@@index([date])
|
||||
@@map("holiday_calendar_entries")
|
||||
}
|
||||
|
||||
// ─── Org Unit Hierarchy ─────────────────────────────────────────────────────
|
||||
|
||||
model OrgUnit {
|
||||
|
||||
Reference in New Issue
Block a user