rename(phase 1): CapaKraken → Nexus across code, UI, docs, CI (#61)
CI / Architecture Guardrails (push) Successful in 2m38s
CI / Assistant Split Regression (push) Successful in 3m33s
CI / Typecheck (push) Successful in 3m51s
CI / Lint (push) Successful in 5m2s
CI / E2E Tests (push) Has been cancelled
CI / Fresh-Linux Docker Deploy (push) Has been cancelled
CI / Release Images (push) Has been cancelled
CI / Build (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Architecture Guardrails (push) Successful in 2m38s
CI / Assistant Split Regression (push) Successful in 3m33s
CI / Typecheck (push) Successful in 3m51s
CI / Lint (push) Successful in 5m2s
CI / E2E Tests (push) Has been cancelled
CI / Fresh-Linux Docker Deploy (push) Has been cancelled
CI / Release Images (push) Has been cancelled
CI / Build (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
rename(phase 1): CapaKraken → Nexus across code, UI, docs, CI (#61) Co-authored-by: Hartmut Nörenberg <hn@hartmut-noerenberg.com> Co-committed-by: Hartmut Nörenberg <hn@hartmut-noerenberg.com>
This commit was merged in pull request #61.
This commit is contained in:
@@ -4,10 +4,7 @@
|
||||
*
|
||||
* Run: npx tsx src/seed-dispo-v2.ts
|
||||
*/
|
||||
import {
|
||||
DISPO_REQUIRED_ROLE_SEEDS,
|
||||
DISPO_UTILIZATION_CATEGORIES,
|
||||
} from "@capakraken/shared";
|
||||
import { DISPO_REQUIRED_ROLE_SEEDS, DISPO_UTILIZATION_CATEGORIES } from "@nexus/shared";
|
||||
import { PrismaClient } from "@prisma/client";
|
||||
import { loadWorkspaceEnv } from "./load-workspace-env.js";
|
||||
import { assertSafeSeedTarget } from "./safe-destructive-env.js";
|
||||
@@ -24,7 +21,21 @@ async function main() {
|
||||
|
||||
const countries = [
|
||||
{ code: "CR", name: "Costa Rica", dailyWorkingHours: 8, cities: ["Costa Rica"] },
|
||||
{ code: "DE", name: "Germany", dailyWorkingHours: 8, cities: ["Augsburg", "Berlin", "Bonn", "Frankfurt", "Hamburg", "Koeln", "Muenchen", "Stuttgart"] },
|
||||
{
|
||||
code: "DE",
|
||||
name: "Germany",
|
||||
dailyWorkingHours: 8,
|
||||
cities: [
|
||||
"Augsburg",
|
||||
"Berlin",
|
||||
"Bonn",
|
||||
"Frankfurt",
|
||||
"Hamburg",
|
||||
"Koeln",
|
||||
"Muenchen",
|
||||
"Stuttgart",
|
||||
],
|
||||
},
|
||||
{ code: "HU", name: "Hungary", dailyWorkingHours: 8, cities: ["Hungary"] },
|
||||
{ code: "IN", name: "India", dailyWorkingHours: 9, cities: ["India"] },
|
||||
{ code: "IT", name: "Italy", dailyWorkingHours: 8, cities: ["Italy"] },
|
||||
@@ -68,16 +79,22 @@ async function main() {
|
||||
|
||||
// ─── Org Unit Hierarchy ───────────────────────────────────────────────────
|
||||
|
||||
const l5 = await prisma.orgUnit.upsert({
|
||||
where: { parentId_name: { parentId: null as unknown as string, name: "Content Production" } },
|
||||
update: {},
|
||||
create: { name: "Content Production", level: 5, sortOrder: 1 },
|
||||
}).catch(async () => {
|
||||
// parentId_name unique doesn't work with null parentId in all Prisma versions
|
||||
const existing = await prisma.orgUnit.findFirst({ where: { name: "Content Production", level: 5, parentId: null } });
|
||||
if (existing) return existing;
|
||||
return prisma.orgUnit.create({ data: { name: "Content Production", level: 5, sortOrder: 1 } });
|
||||
});
|
||||
const l5 = await prisma.orgUnit
|
||||
.upsert({
|
||||
where: { parentId_name: { parentId: null as unknown as string, name: "Content Production" } },
|
||||
update: {},
|
||||
create: { name: "Content Production", level: 5, sortOrder: 1 },
|
||||
})
|
||||
.catch(async () => {
|
||||
// parentId_name unique doesn't work with null parentId in all Prisma versions
|
||||
const existing = await prisma.orgUnit.findFirst({
|
||||
where: { name: "Content Production", level: 5, parentId: null },
|
||||
});
|
||||
if (existing) return existing;
|
||||
return prisma.orgUnit.create({
|
||||
data: { name: "Content Production", level: 5, sortOrder: 1 },
|
||||
});
|
||||
});
|
||||
|
||||
const l6Data = [
|
||||
{ name: "CGI Content", sortOrder: 1 },
|
||||
@@ -98,10 +115,8 @@ async function main() {
|
||||
{ name: "CGI Development", sortOrder: 1 },
|
||||
{ name: "IT Development", sortOrder: 2 },
|
||||
],
|
||||
"Creative Content Production": [
|
||||
{ name: "Creative Content Production", sortOrder: 1 },
|
||||
],
|
||||
"VFX": [
|
||||
"Creative Content Production": [{ name: "Creative Content Production", sortOrder: 1 }],
|
||||
VFX: [
|
||||
{ name: "2D & Art Direction", sortOrder: 1 },
|
||||
{ name: "3D", sortOrder: 2 },
|
||||
{ name: "Program/Delivery Mgmt & Other", sortOrder: 3 },
|
||||
@@ -109,14 +124,18 @@ async function main() {
|
||||
};
|
||||
|
||||
for (const l6Item of l6Data) {
|
||||
let l6 = await prisma.orgUnit.findFirst({ where: { name: l6Item.name, level: 6, parentId: l5.id } });
|
||||
let l6 = await prisma.orgUnit.findFirst({
|
||||
where: { name: l6Item.name, level: 6, parentId: l5.id },
|
||||
});
|
||||
if (!l6) {
|
||||
l6 = await prisma.orgUnit.create({
|
||||
data: { name: l6Item.name, level: 6, parentId: l5.id, sortOrder: l6Item.sortOrder },
|
||||
});
|
||||
}
|
||||
for (const l7Item of l7Data[l6Item.name] ?? []) {
|
||||
const existing = await prisma.orgUnit.findFirst({ where: { name: l7Item.name, level: 7, parentId: l6.id } });
|
||||
const existing = await prisma.orgUnit.findFirst({
|
||||
where: { name: l7Item.name, level: 7, parentId: l6.id },
|
||||
});
|
||||
if (!existing) {
|
||||
await prisma.orgUnit.create({
|
||||
data: { name: l7Item.name, level: 7, parentId: l6.id, sortOrder: l7Item.sortOrder },
|
||||
@@ -152,11 +171,31 @@ async function main() {
|
||||
|
||||
const mgmtGroups = [
|
||||
{ name: "Accenture Leadership", targetPercentage: 0.365, sortOrder: 1, levels: [] as string[] },
|
||||
{ name: "Senior Manager", targetPercentage: 0.546, sortOrder: 2, levels: ["5-Associate Director", "6-Senior Manager"] },
|
||||
{
|
||||
name: "Senior Manager",
|
||||
targetPercentage: 0.546,
|
||||
sortOrder: 2,
|
||||
levels: ["5-Associate Director", "6-Senior Manager"],
|
||||
},
|
||||
{ name: "Manager", targetPercentage: 0.747, sortOrder: 3, levels: ["7-Manager"] },
|
||||
{ name: "Consultant", targetPercentage: 0.808, sortOrder: 4, levels: ["8-Associate Manager", "9-Team Lead/Consultant"] },
|
||||
{ name: "Analyst", targetPercentage: 0.805, sortOrder: 5, levels: ["10-Senior Analyst", "11-Analyst"] },
|
||||
{ name: "Associate", targetPercentage: 0.770, sortOrder: 6, levels: ["12-Associate", "13-New Associate"] },
|
||||
{
|
||||
name: "Consultant",
|
||||
targetPercentage: 0.808,
|
||||
sortOrder: 4,
|
||||
levels: ["8-Associate Manager", "9-Team Lead/Consultant"],
|
||||
},
|
||||
{
|
||||
name: "Analyst",
|
||||
targetPercentage: 0.805,
|
||||
sortOrder: 5,
|
||||
levels: ["10-Senior Analyst", "11-Analyst"],
|
||||
},
|
||||
{
|
||||
name: "Associate",
|
||||
targetPercentage: 0.77,
|
||||
sortOrder: 6,
|
||||
levels: ["12-Associate", "13-New Associate"],
|
||||
},
|
||||
];
|
||||
|
||||
for (const grp of mgmtGroups) {
|
||||
@@ -179,14 +218,39 @@ async function main() {
|
||||
|
||||
const clients: { name: string; code?: string; children: string[] }[] = [
|
||||
{ name: "BMW", code: "BMW", children: ["BMW AG"] },
|
||||
{ name: "VOLKSWAGEN", code: "VW", children: ["Audi Business Innovation GmbH", "Dr. Ing. h.c. F. Porsche AG", "MAN Truck & Bus SE", "Volkswagen AG"] },
|
||||
{ name: "DAIMLER", code: "DAIMLER", children: ["antoni garage GmbH & Co. KG", "Mercedes-Benz AG"] },
|
||||
{ name: "EXOR-STELLANTIS", code: "STELLANTIS", children: ["AUTOMOBILES PEUGEOT", "FCA Italy S.p.A.", "Ferrari S.p.A", "MASERATI SPA A SOCIO UNICO"] },
|
||||
{
|
||||
name: "VOLKSWAGEN",
|
||||
code: "VW",
|
||||
children: [
|
||||
"Audi Business Innovation GmbH",
|
||||
"Dr. Ing. h.c. F. Porsche AG",
|
||||
"MAN Truck & Bus SE",
|
||||
"Volkswagen AG",
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "DAIMLER",
|
||||
code: "DAIMLER",
|
||||
children: ["antoni garage GmbH & Co. KG", "Mercedes-Benz AG"],
|
||||
},
|
||||
{
|
||||
name: "EXOR-STELLANTIS",
|
||||
code: "STELLANTIS",
|
||||
children: [
|
||||
"AUTOMOBILES PEUGEOT",
|
||||
"FCA Italy S.p.A.",
|
||||
"Ferrari S.p.A",
|
||||
"MASERATI SPA A SOCIO UNICO",
|
||||
],
|
||||
},
|
||||
{ name: "TATA MOTORS GROUP", code: "JLR", children: ["Jaguar Land Rover"] },
|
||||
{ name: "SCHWARZ GROUP", code: "LIDL", children: ["Lidl Stiftung & Co. KG"] },
|
||||
{ name: "INA-HOLDING SCHAEFFLER GMBH & CO KG", children: ["Schaeffler Technologies"] },
|
||||
{ name: "AIRBUS GROUP", children: ["Airbus SAS"] },
|
||||
{ name: "ALDI EINKAUF GMBH & CO. OHG", children: ["ALDI Einkauf SE & co. oHG", "ALDI SUED Dienstleistungs-SE & Co.oH"] },
|
||||
{
|
||||
name: "ALDI EINKAUF GMBH & CO. OHG",
|
||||
children: ["ALDI Einkauf SE & co. oHG", "ALDI SUED Dienstleistungs-SE & Co.oH"],
|
||||
},
|
||||
{ name: "ARLA", children: ["Arla Foods amba"] },
|
||||
{ name: "BLANC & FISCHER FAMILIENHOLDING", children: ["BLANCO GmbH + Co KG"] },
|
||||
{ name: "BMDS & ITZBUND ASG", children: ["Bundesministerium der Finanzen"] },
|
||||
@@ -229,7 +293,9 @@ async function main() {
|
||||
});
|
||||
}
|
||||
for (const childName of c.children) {
|
||||
const existing = await prisma.client.findFirst({ where: { name: childName, parentId: master.id } });
|
||||
const existing = await prisma.client.findFirst({
|
||||
where: { name: childName, parentId: master.id },
|
||||
});
|
||||
if (!existing) {
|
||||
await prisma.client.create({
|
||||
data: { name: childName, parentId: master.id },
|
||||
|
||||
Reference in New Issue
Block a user