feat(platform): checkpoint current implementation state
This commit is contained in:
@@ -13,14 +13,14 @@
|
||||
"db:migrate": "node ../../scripts/prisma-with-env.mjs migrate dev --schema ./prisma/schema.prisma",
|
||||
"db:migrate:deploy": "node ../../scripts/prisma-with-env.mjs migrate deploy --schema ./prisma/schema.prisma",
|
||||
"db:validate": "node ../../scripts/prisma-with-env.mjs validate --schema ./prisma/schema.prisma",
|
||||
"db:seed": "node ../../scripts/with-env.mjs tsx src/seed.ts",
|
||||
"db:seed:holiday-demo-resources": "node ../../scripts/with-env.mjs tsx src/seed-holiday-demo-resources.ts",
|
||||
"db:seed:holidays": "node ../../scripts/with-env.mjs tsx src/seed-holiday-calendars.ts",
|
||||
"db:seed:dispo-v2": "node ../../scripts/with-env.mjs tsx src/seed-dispo-v2.ts",
|
||||
"db:seed:vacations": "node ../../scripts/with-env.mjs tsx src/seed-vacations.ts",
|
||||
"db:reset:dispo": "node ../../scripts/with-env.mjs tsx src/reset-dispo-import.ts",
|
||||
"db:import:dispo": "node ../../scripts/with-env.mjs tsx src/import-dispo-batch.ts",
|
||||
"db:excel": "node ../../scripts/with-env.mjs tsx src/generate-excel.ts",
|
||||
"db:seed": "node ../../scripts/with-env.mjs tsx packages/db/src/seed.ts",
|
||||
"db:seed:holiday-demo-resources": "node ../../scripts/with-env.mjs tsx packages/db/src/seed-holiday-demo-resources.ts",
|
||||
"db:seed:holidays": "node ../../scripts/with-env.mjs tsx packages/db/src/seed-holiday-calendars.ts",
|
||||
"db:seed:dispo-v2": "node ../../scripts/with-env.mjs tsx packages/db/src/seed-dispo-v2.ts",
|
||||
"db:seed:vacations": "node ../../scripts/with-env.mjs tsx packages/db/src/seed-vacations.ts",
|
||||
"db:reset:dispo": "node ../../scripts/with-env.mjs tsx packages/db/src/reset-dispo-import.ts",
|
||||
"db:import:dispo": "node ../../scripts/with-env.mjs tsx packages/db/src/import-dispo-batch.ts",
|
||||
"db:excel": "node ../../scripts/with-env.mjs tsx packages/db/src/generate-excel.ts",
|
||||
"db:studio": "node ../../scripts/prisma-with-env.mjs studio --schema ./prisma/schema.prisma",
|
||||
"db:generate": "node ../../scripts/prisma-with-env.mjs generate --schema ./prisma/schema.prisma",
|
||||
"test:unit": "tsx --test src/*.test.ts",
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
ALTER TABLE "vacations"
|
||||
ADD COLUMN "deductedDays" DOUBLE PRECISION,
|
||||
ADD COLUMN "holidayCountryCode" TEXT,
|
||||
ADD COLUMN "holidayCountryName" TEXT,
|
||||
ADD COLUMN "holidayFederalState" TEXT,
|
||||
ADD COLUMN "holidayMetroCityName" TEXT,
|
||||
ADD COLUMN "holidayCalendarDates" JSONB,
|
||||
ADD COLUMN "holidayLegacyPublicHolidayDates" JSONB;
|
||||
@@ -1363,6 +1363,13 @@ model Vacation {
|
||||
rejectionReason String?
|
||||
isHalfDay Boolean @default(false)
|
||||
halfDayPart String? // "MORNING" | "AFTERNOON"
|
||||
deductedDays Float?
|
||||
holidayCountryCode String?
|
||||
holidayCountryName String?
|
||||
holidayFederalState String?
|
||||
holidayMetroCityName String?
|
||||
holidayCalendarDates Json? @db.JsonB
|
||||
holidayLegacyPublicHolidayDates Json? @db.JsonB
|
||||
requestedById String
|
||||
approvedById String?
|
||||
approvedAt DateTime?
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { PrismaClient, type HolidayCalendarEntry } from "@prisma/client";
|
||||
import { buildHolidayCalendarSeedDefinitions } from "./holiday-calendar-seed-data.js";
|
||||
import { loadWorkspaceEnv } from "./load-workspace-env.js";
|
||||
import { assertCapaKrakenDbTarget } from "./safe-destructive-env.js";
|
||||
|
||||
loadWorkspaceEnv();
|
||||
|
||||
@@ -49,6 +50,7 @@ async function findScopedCalendar(input: {
|
||||
}
|
||||
|
||||
async function main() {
|
||||
assertCapaKrakenDbTarget("db:seed:holidays");
|
||||
console.log("Seeding holiday calendars for 2026-2027...");
|
||||
|
||||
const countries = await prisma.country.findMany({
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { PrismaClient, type Prisma } from "@prisma/client";
|
||||
import { getHolidayDemoCityNamesByCountry, getHolidayDemoProfileForIndex } from "./holiday-demo-profiles.js";
|
||||
import { loadWorkspaceEnv } from "./load-workspace-env.js";
|
||||
import { assertCapaKrakenDbTarget } from "./safe-destructive-env.js";
|
||||
|
||||
loadWorkspaceEnv();
|
||||
|
||||
@@ -52,6 +53,7 @@ async function ensureCities(countryByCode: Map<string, CountryRecord>) {
|
||||
}
|
||||
|
||||
async function main() {
|
||||
assertCapaKrakenDbTarget("db:seed:holiday-demo-resources");
|
||||
console.log("Normalizing active resources for holiday demo profiles...");
|
||||
|
||||
const countrySeeds = [
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
import { BlueprintTarget, FieldType } from "@capakraken/shared";
|
||||
import { PrismaClient } from "@prisma/client";
|
||||
import { loadWorkspaceEnv } from "./load-workspace-env.js";
|
||||
import { assertCapaKrakenDbTarget } from "./safe-destructive-env.js";
|
||||
|
||||
loadWorkspaceEnv();
|
||||
|
||||
const prisma = new PrismaClient();
|
||||
|
||||
@@ -1174,6 +1178,7 @@ const rolePresetsMotion = [
|
||||
// ─── Main ───────────────────────────────────────────────────────────────────
|
||||
|
||||
async function main() {
|
||||
assertCapaKrakenDbTarget("db:update:blueprints");
|
||||
console.log("Starting blueprint update...\n");
|
||||
|
||||
// Blueprints to update in-place (by name — preserves PKs and FKs)
|
||||
|
||||
Reference in New Issue
Block a user