This commit is contained in:
s871077
2026-09-11 10:11:09 +08:00
parent e25c995560
commit 58587d19a8
25 changed files with 1643 additions and 54 deletions
+149
View File
@@ -0,0 +1,149 @@
// Emits prisma/seed.sql — the plain-SQL twin of prisma/seed.ts, for baking into
// the MySQL image (see Dockerfile.db). 275 SubCostItem rows are not hand-
// writable, and the container has no Node/Prisma to run seed.ts with.
//
// node prisma/generate-seed-sql.mjs > prisma/seed.sql
//
// The constants and arithmetic below mirror prisma/seed.ts verbatim. If seed.ts
// changes, change them here too and regenerate.
const REGIONS = ["AMEA IT", "EMEA IT", "NABU IT", "PH IT", "JP IT"];
const YEARS = [2022, 2023, 2024, 2025, 2026];
const ITEMS = [
{
name: "Cloud Hosting",
subs: [
{ name: "Compute (VMs)", base: 40000 },
{ name: "Storage", base: 18000 },
{ name: "Networking / Egress", base: 9000 },
],
},
{
name: "Software Licenses",
subs: [
{ name: "Productivity Suite", base: 22000 },
{ name: "Design Tools", base: 8000 },
],
},
{
name: "Security Tools",
subs: [
{ name: "Endpoint Protection", base: 15000 },
{ name: "SIEM", base: 20000 },
{ name: "Vulnerability Scanning", base: 6000 },
],
},
{
name: "Support & Maintenance",
subs: [{ name: "Vendor Support Contract", base: 30000 }],
},
{
name: "Network Infra",
subs: [
{ name: "Circuits / Bandwidth", base: 25000 },
{ name: "Hardware Refresh", base: 12000 },
],
},
];
const REGION_WEIGHT = {
"NABU IT": 1.4,
"EMEA IT": 1.2,
"AMEA IT": 1.0,
"JP IT": 0.9,
"PH IT": 0.7,
};
const REGION_AI = {
"NABU IT": { base: 12, step: 6 },
"EMEA IT": { base: 10, step: 5 },
"AMEA IT": { base: 8, step: 5 },
"JP IT": { base: 15, step: 4 },
"PH IT": { base: 6, step: 4 },
};
function yearFactor(year) {
return Math.pow(1.08, year - 2022);
}
// Fixed so regenerating yields a byte-identical file (empty diff).
const TS = "2026-01-01 00:00:00.000";
function q(s) {
return `'${String(s).replace(/\\/g, "\\\\").replace(/'/g, "''")}'`;
}
const yearRows = YEARS.map((y) => ` (${y})`);
const costRows = [];
const subRows = [];
const pctRows = [];
let costId = 0;
let subId = 0;
let pctId = 0;
for (const region of REGIONS) {
const weight = REGION_WEIGHT[region];
for (const year of YEARS) {
const yf = yearFactor(year);
for (const item of ITEMS) {
costId += 1;
costRows.push(
` (${costId},${q(item.name)},${q(region)},${year},${q(TS)},${q(TS)})`
);
for (const s of item.subs) {
subId += 1;
const subCost = Math.round((s.base * weight * yf) / 100) * 100;
subRows.push(` (${subId},${q(s.name)},${subCost},${costId})`);
}
}
}
}
for (const region of REGIONS) {
const ai = REGION_AI[region];
for (const year of YEARS) {
pctId += 1;
const pct = Math.min(60, ai.base + (year - 2022) * ai.step);
pctRows.push(` (${pctId},${q(region)},${year},${pct})`);
}
}
const out = [];
out.push("-- GENERATED FILE — do not edit by hand.");
out.push("-- Regenerate with: node prisma/generate-seed-sql.mjs > prisma/seed.sql");
out.push(
`-- Rows: CostItem=${costId}, SubCostItem=${subId}, TrendAiPercentage=${pctId}, Year=${YEARS.length}`
);
out.push("");
// Explicit IDs mean the FK targets are known up front; disabling the check lets
// the inserts run in any order and keeps the file order-independent.
out.push("SET FOREIGN_KEY_CHECKS=0;");
out.push("");
out.push("INSERT INTO `Year` (`year`) VALUES");
out.push(yearRows.join(",\n") + ";");
out.push("");
out.push(
"INSERT INTO `CostItem` (`id`,`name`,`region`,`year`,`createdAt`,`updatedAt`) VALUES"
);
out.push(costRows.join(",\n") + ";");
out.push("");
out.push("INSERT INTO `SubCostItem` (`id`,`name`,`subCost`,`costItemId`) VALUES");
out.push(subRows.join(",\n") + ";");
out.push("");
out.push(
"INSERT INTO `TrendAiPercentage` (`id`,`region`,`year`,`percentage`) VALUES"
);
out.push(pctRows.join(",\n") + ";");
out.push("");
// Explicit IDs leave AUTO_INCREMENT at 1 in some engines/versions; reset it or
// the first app-side insert collides with a seeded row.
out.push(`ALTER TABLE \`CostItem\` AUTO_INCREMENT = ${costId + 1};`);
out.push(`ALTER TABLE \`SubCostItem\` AUTO_INCREMENT = ${subId + 1};`);
out.push(`ALTER TABLE \`TrendAiPercentage\` AUTO_INCREMENT = ${pctId + 1};`);
out.push("");
out.push("SET FOREIGN_KEY_CHECKS=1;");
out.push("");
process.stdout.write(out.join("\n"));
+75
View File
@@ -0,0 +1,75 @@
-- Schema bootstrap for the containerized MySQL 8 pod (see Dockerfile.db).
-- Runs as /docker-entrypoint-initdb.d/01-schema.sql, i.e. ONLY on a first boot
-- against an empty datadir.
--
-- Body below is verbatim from:
-- prisma/prod/migrations/20260729000000_init/migration.sql
-- Do not edit that file — it stays the source of truth.
-- ---------------------------------------------------------------------------
-- Prisma migration bookkeeping.
-- The raw migration SQL creates no _prisma_migrations table, so a later
-- `npm run prod:migrate` would try to re-apply 20260729000000_init and fail
-- with "table already exists". Recording it as applied up front keeps future
-- migrations working against this volume.
-- ---------------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `_prisma_migrations` (
`id` VARCHAR(36) NOT NULL,
`checksum` VARCHAR(64) NOT NULL,
`finished_at` DATETIME(3) NULL,
`migration_name` VARCHAR(255) NOT NULL,
`logs` TEXT NULL,
`rolled_back_at` DATETIME(3) NULL,
`started_at` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
`applied_steps_count` INT UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
INSERT INTO `_prisma_migrations`
(`id`,`checksum`,`finished_at`,`migration_name`,`started_at`,`applied_steps_count`)
VALUES (UUID(),'bootstrapped-by-dockerfile-db',NOW(3),'20260729000000_init',NOW(3),1);
-- CreateTable
CREATE TABLE `CostItem` (
`id` INTEGER NOT NULL AUTO_INCREMENT,
`name` VARCHAR(191) NOT NULL,
`region` VARCHAR(191) NOT NULL,
`year` INTEGER NOT NULL,
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
`updatedAt` DATETIME(3) NOT NULL,
INDEX `CostItem_region_year_idx`(`region`, `year`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `SubCostItem` (
`id` INTEGER NOT NULL AUTO_INCREMENT,
`name` VARCHAR(191) NOT NULL,
`subCost` DOUBLE NOT NULL,
`costItemId` INTEGER NOT NULL,
INDEX `SubCostItem_costItemId_idx`(`costItemId`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `TrendAiPercentage` (
`id` INTEGER NOT NULL AUTO_INCREMENT,
`region` VARCHAR(191) NOT NULL,
`year` INTEGER NOT NULL,
`percentage` DOUBLE NOT NULL,
UNIQUE INDEX `TrendAiPercentage_region_year_key`(`region`, `year`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Year` (
`year` INTEGER NOT NULL,
PRIMARY KEY (`year`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- AddForeignKey
ALTER TABLE `SubCostItem` ADD CONSTRAINT `SubCostItem_costItemId_fkey` FOREIGN KEY (`costItemId`) REFERENCES `CostItem`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
+449
View File
@@ -0,0 +1,449 @@
-- GENERATED FILE — do not edit by hand.
-- Regenerate with: node prisma/generate-seed-sql.mjs > prisma/seed.sql
-- Rows: CostItem=125, SubCostItem=275, TrendAiPercentage=25, Year=5
SET FOREIGN_KEY_CHECKS=0;
INSERT INTO `Year` (`year`) VALUES
(2022),
(2023),
(2024),
(2025),
(2026);
INSERT INTO `CostItem` (`id`,`name`,`region`,`year`,`createdAt`,`updatedAt`) VALUES
(1,'Cloud Hosting','AMEA IT',2022,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(2,'Software Licenses','AMEA IT',2022,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(3,'Security Tools','AMEA IT',2022,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(4,'Support & Maintenance','AMEA IT',2022,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(5,'Network Infra','AMEA IT',2022,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(6,'Cloud Hosting','AMEA IT',2023,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(7,'Software Licenses','AMEA IT',2023,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(8,'Security Tools','AMEA IT',2023,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(9,'Support & Maintenance','AMEA IT',2023,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(10,'Network Infra','AMEA IT',2023,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(11,'Cloud Hosting','AMEA IT',2024,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(12,'Software Licenses','AMEA IT',2024,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(13,'Security Tools','AMEA IT',2024,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(14,'Support & Maintenance','AMEA IT',2024,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(15,'Network Infra','AMEA IT',2024,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(16,'Cloud Hosting','AMEA IT',2025,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(17,'Software Licenses','AMEA IT',2025,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(18,'Security Tools','AMEA IT',2025,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(19,'Support & Maintenance','AMEA IT',2025,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(20,'Network Infra','AMEA IT',2025,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(21,'Cloud Hosting','AMEA IT',2026,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(22,'Software Licenses','AMEA IT',2026,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(23,'Security Tools','AMEA IT',2026,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(24,'Support & Maintenance','AMEA IT',2026,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(25,'Network Infra','AMEA IT',2026,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(26,'Cloud Hosting','EMEA IT',2022,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(27,'Software Licenses','EMEA IT',2022,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(28,'Security Tools','EMEA IT',2022,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(29,'Support & Maintenance','EMEA IT',2022,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(30,'Network Infra','EMEA IT',2022,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(31,'Cloud Hosting','EMEA IT',2023,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(32,'Software Licenses','EMEA IT',2023,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(33,'Security Tools','EMEA IT',2023,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(34,'Support & Maintenance','EMEA IT',2023,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(35,'Network Infra','EMEA IT',2023,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(36,'Cloud Hosting','EMEA IT',2024,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(37,'Software Licenses','EMEA IT',2024,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(38,'Security Tools','EMEA IT',2024,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(39,'Support & Maintenance','EMEA IT',2024,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(40,'Network Infra','EMEA IT',2024,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(41,'Cloud Hosting','EMEA IT',2025,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(42,'Software Licenses','EMEA IT',2025,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(43,'Security Tools','EMEA IT',2025,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(44,'Support & Maintenance','EMEA IT',2025,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(45,'Network Infra','EMEA IT',2025,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(46,'Cloud Hosting','EMEA IT',2026,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(47,'Software Licenses','EMEA IT',2026,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(48,'Security Tools','EMEA IT',2026,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(49,'Support & Maintenance','EMEA IT',2026,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(50,'Network Infra','EMEA IT',2026,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(51,'Cloud Hosting','NABU IT',2022,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(52,'Software Licenses','NABU IT',2022,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(53,'Security Tools','NABU IT',2022,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(54,'Support & Maintenance','NABU IT',2022,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(55,'Network Infra','NABU IT',2022,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(56,'Cloud Hosting','NABU IT',2023,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(57,'Software Licenses','NABU IT',2023,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(58,'Security Tools','NABU IT',2023,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(59,'Support & Maintenance','NABU IT',2023,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(60,'Network Infra','NABU IT',2023,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(61,'Cloud Hosting','NABU IT',2024,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(62,'Software Licenses','NABU IT',2024,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(63,'Security Tools','NABU IT',2024,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(64,'Support & Maintenance','NABU IT',2024,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(65,'Network Infra','NABU IT',2024,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(66,'Cloud Hosting','NABU IT',2025,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(67,'Software Licenses','NABU IT',2025,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(68,'Security Tools','NABU IT',2025,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(69,'Support & Maintenance','NABU IT',2025,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(70,'Network Infra','NABU IT',2025,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(71,'Cloud Hosting','NABU IT',2026,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(72,'Software Licenses','NABU IT',2026,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(73,'Security Tools','NABU IT',2026,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(74,'Support & Maintenance','NABU IT',2026,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(75,'Network Infra','NABU IT',2026,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(76,'Cloud Hosting','PH IT',2022,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(77,'Software Licenses','PH IT',2022,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(78,'Security Tools','PH IT',2022,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(79,'Support & Maintenance','PH IT',2022,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(80,'Network Infra','PH IT',2022,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(81,'Cloud Hosting','PH IT',2023,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(82,'Software Licenses','PH IT',2023,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(83,'Security Tools','PH IT',2023,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(84,'Support & Maintenance','PH IT',2023,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(85,'Network Infra','PH IT',2023,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(86,'Cloud Hosting','PH IT',2024,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(87,'Software Licenses','PH IT',2024,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(88,'Security Tools','PH IT',2024,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(89,'Support & Maintenance','PH IT',2024,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(90,'Network Infra','PH IT',2024,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(91,'Cloud Hosting','PH IT',2025,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(92,'Software Licenses','PH IT',2025,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(93,'Security Tools','PH IT',2025,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(94,'Support & Maintenance','PH IT',2025,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(95,'Network Infra','PH IT',2025,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(96,'Cloud Hosting','PH IT',2026,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(97,'Software Licenses','PH IT',2026,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(98,'Security Tools','PH IT',2026,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(99,'Support & Maintenance','PH IT',2026,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(100,'Network Infra','PH IT',2026,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(101,'Cloud Hosting','JP IT',2022,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(102,'Software Licenses','JP IT',2022,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(103,'Security Tools','JP IT',2022,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(104,'Support & Maintenance','JP IT',2022,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(105,'Network Infra','JP IT',2022,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(106,'Cloud Hosting','JP IT',2023,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(107,'Software Licenses','JP IT',2023,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(108,'Security Tools','JP IT',2023,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(109,'Support & Maintenance','JP IT',2023,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(110,'Network Infra','JP IT',2023,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(111,'Cloud Hosting','JP IT',2024,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(112,'Software Licenses','JP IT',2024,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(113,'Security Tools','JP IT',2024,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(114,'Support & Maintenance','JP IT',2024,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(115,'Network Infra','JP IT',2024,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(116,'Cloud Hosting','JP IT',2025,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(117,'Software Licenses','JP IT',2025,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(118,'Security Tools','JP IT',2025,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(119,'Support & Maintenance','JP IT',2025,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(120,'Network Infra','JP IT',2025,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(121,'Cloud Hosting','JP IT',2026,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(122,'Software Licenses','JP IT',2026,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(123,'Security Tools','JP IT',2026,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(124,'Support & Maintenance','JP IT',2026,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000'),
(125,'Network Infra','JP IT',2026,'2026-01-01 00:00:00.000','2026-01-01 00:00:00.000');
INSERT INTO `SubCostItem` (`id`,`name`,`subCost`,`costItemId`) VALUES
(1,'Compute (VMs)',40000,1),
(2,'Storage',18000,1),
(3,'Networking / Egress',9000,1),
(4,'Productivity Suite',22000,2),
(5,'Design Tools',8000,2),
(6,'Endpoint Protection',15000,3),
(7,'SIEM',20000,3),
(8,'Vulnerability Scanning',6000,3),
(9,'Vendor Support Contract',30000,4),
(10,'Circuits / Bandwidth',25000,5),
(11,'Hardware Refresh',12000,5),
(12,'Compute (VMs)',43200,6),
(13,'Storage',19400,6),
(14,'Networking / Egress',9700,6),
(15,'Productivity Suite',23800,7),
(16,'Design Tools',8600,7),
(17,'Endpoint Protection',16200,8),
(18,'SIEM',21600,8),
(19,'Vulnerability Scanning',6500,8),
(20,'Vendor Support Contract',32400,9),
(21,'Circuits / Bandwidth',27000,10),
(22,'Hardware Refresh',13000,10),
(23,'Compute (VMs)',46700,11),
(24,'Storage',21000,11),
(25,'Networking / Egress',10500,11),
(26,'Productivity Suite',25700,12),
(27,'Design Tools',9300,12),
(28,'Endpoint Protection',17500,13),
(29,'SIEM',23300,13),
(30,'Vulnerability Scanning',7000,13),
(31,'Vendor Support Contract',35000,14),
(32,'Circuits / Bandwidth',29200,15),
(33,'Hardware Refresh',14000,15),
(34,'Compute (VMs)',50400,16),
(35,'Storage',22700,16),
(36,'Networking / Egress',11300,16),
(37,'Productivity Suite',27700,17),
(38,'Design Tools',10100,17),
(39,'Endpoint Protection',18900,18),
(40,'SIEM',25200,18),
(41,'Vulnerability Scanning',7600,18),
(42,'Vendor Support Contract',37800,19),
(43,'Circuits / Bandwidth',31500,20),
(44,'Hardware Refresh',15100,20),
(45,'Compute (VMs)',54400,21),
(46,'Storage',24500,21),
(47,'Networking / Egress',12200,21),
(48,'Productivity Suite',29900,22),
(49,'Design Tools',10900,22),
(50,'Endpoint Protection',20400,23),
(51,'SIEM',27200,23),
(52,'Vulnerability Scanning',8200,23),
(53,'Vendor Support Contract',40800,24),
(54,'Circuits / Bandwidth',34000,25),
(55,'Hardware Refresh',16300,25),
(56,'Compute (VMs)',48000,26),
(57,'Storage',21600,26),
(58,'Networking / Egress',10800,26),
(59,'Productivity Suite',26400,27),
(60,'Design Tools',9600,27),
(61,'Endpoint Protection',18000,28),
(62,'SIEM',24000,28),
(63,'Vulnerability Scanning',7200,28),
(64,'Vendor Support Contract',36000,29),
(65,'Circuits / Bandwidth',30000,30),
(66,'Hardware Refresh',14400,30),
(67,'Compute (VMs)',51800,31),
(68,'Storage',23300,31),
(69,'Networking / Egress',11700,31),
(70,'Productivity Suite',28500,32),
(71,'Design Tools',10400,32),
(72,'Endpoint Protection',19400,33),
(73,'SIEM',25900,33),
(74,'Vulnerability Scanning',7800,33),
(75,'Vendor Support Contract',38900,34),
(76,'Circuits / Bandwidth',32400,35),
(77,'Hardware Refresh',15600,35),
(78,'Compute (VMs)',56000,36),
(79,'Storage',25200,36),
(80,'Networking / Egress',12600,36),
(81,'Productivity Suite',30800,37),
(82,'Design Tools',11200,37),
(83,'Endpoint Protection',21000,38),
(84,'SIEM',28000,38),
(85,'Vulnerability Scanning',8400,38),
(86,'Vendor Support Contract',42000,39),
(87,'Circuits / Bandwidth',35000,40),
(88,'Hardware Refresh',16800,40),
(89,'Compute (VMs)',60500,41),
(90,'Storage',27200,41),
(91,'Networking / Egress',13600,41),
(92,'Productivity Suite',33300,42),
(93,'Design Tools',12100,42),
(94,'Endpoint Protection',22700,43),
(95,'SIEM',30200,43),
(96,'Vulnerability Scanning',9100,43),
(97,'Vendor Support Contract',45300,44),
(98,'Circuits / Bandwidth',37800,45),
(99,'Hardware Refresh',18100,45),
(100,'Compute (VMs)',65300,46),
(101,'Storage',29400,46),
(102,'Networking / Egress',14700,46),
(103,'Productivity Suite',35900,47),
(104,'Design Tools',13100,47),
(105,'Endpoint Protection',24500,48),
(106,'SIEM',32700,48),
(107,'Vulnerability Scanning',9800,48),
(108,'Vendor Support Contract',49000,49),
(109,'Circuits / Bandwidth',40800,50),
(110,'Hardware Refresh',19600,50),
(111,'Compute (VMs)',56000,51),
(112,'Storage',25200,51),
(113,'Networking / Egress',12600,51),
(114,'Productivity Suite',30800,52),
(115,'Design Tools',11200,52),
(116,'Endpoint Protection',21000,53),
(117,'SIEM',28000,53),
(118,'Vulnerability Scanning',8400,53),
(119,'Vendor Support Contract',42000,54),
(120,'Circuits / Bandwidth',35000,55),
(121,'Hardware Refresh',16800,55),
(122,'Compute (VMs)',60500,56),
(123,'Storage',27200,56),
(124,'Networking / Egress',13600,56),
(125,'Productivity Suite',33300,57),
(126,'Design Tools',12100,57),
(127,'Endpoint Protection',22700,58),
(128,'SIEM',30200,58),
(129,'Vulnerability Scanning',9100,58),
(130,'Vendor Support Contract',45400,59),
(131,'Circuits / Bandwidth',37800,60),
(132,'Hardware Refresh',18100,60),
(133,'Compute (VMs)',65300,61),
(134,'Storage',29400,61),
(135,'Networking / Egress',14700,61),
(136,'Productivity Suite',35900,62),
(137,'Design Tools',13100,62),
(138,'Endpoint Protection',24500,63),
(139,'SIEM',32700,63),
(140,'Vulnerability Scanning',9800,63),
(141,'Vendor Support Contract',49000,64),
(142,'Circuits / Bandwidth',40800,65),
(143,'Hardware Refresh',19600,65),
(144,'Compute (VMs)',70500,66),
(145,'Storage',31700,66),
(146,'Networking / Egress',15900,66),
(147,'Productivity Suite',38800,67),
(148,'Design Tools',14100,67),
(149,'Endpoint Protection',26500,68),
(150,'SIEM',35300,68),
(151,'Vulnerability Scanning',10600,68),
(152,'Vendor Support Contract',52900,69),
(153,'Circuits / Bandwidth',44100,70),
(154,'Hardware Refresh',21200,70),
(155,'Compute (VMs)',76200,71),
(156,'Storage',34300,71),
(157,'Networking / Egress',17100,71),
(158,'Productivity Suite',41900,72),
(159,'Design Tools',15200,72),
(160,'Endpoint Protection',28600,73),
(161,'SIEM',38100,73),
(162,'Vulnerability Scanning',11400,73),
(163,'Vendor Support Contract',57100,74),
(164,'Circuits / Bandwidth',47600,75),
(165,'Hardware Refresh',22900,75),
(166,'Compute (VMs)',28000,76),
(167,'Storage',12600,76),
(168,'Networking / Egress',6300,76),
(169,'Productivity Suite',15400,77),
(170,'Design Tools',5600,77),
(171,'Endpoint Protection',10500,78),
(172,'SIEM',14000,78),
(173,'Vulnerability Scanning',4200,78),
(174,'Vendor Support Contract',21000,79),
(175,'Circuits / Bandwidth',17500,80),
(176,'Hardware Refresh',8400,80),
(177,'Compute (VMs)',30200,81),
(178,'Storage',13600,81),
(179,'Networking / Egress',6800,81),
(180,'Productivity Suite',16600,82),
(181,'Design Tools',6000,82),
(182,'Endpoint Protection',11300,83),
(183,'SIEM',15100,83),
(184,'Vulnerability Scanning',4500,83),
(185,'Vendor Support Contract',22700,84),
(186,'Circuits / Bandwidth',18900,85),
(187,'Hardware Refresh',9100,85),
(188,'Compute (VMs)',32700,86),
(189,'Storage',14700,86),
(190,'Networking / Egress',7300,86),
(191,'Productivity Suite',18000,87),
(192,'Design Tools',6500,87),
(193,'Endpoint Protection',12200,88),
(194,'SIEM',16300,88),
(195,'Vulnerability Scanning',4900,88),
(196,'Vendor Support Contract',24500,89),
(197,'Circuits / Bandwidth',20400,90),
(198,'Hardware Refresh',9800,90),
(199,'Compute (VMs)',35300,91),
(200,'Storage',15900,91),
(201,'Networking / Egress',7900,91),
(202,'Productivity Suite',19400,92),
(203,'Design Tools',7100,92),
(204,'Endpoint Protection',13200,93),
(205,'SIEM',17600,93),
(206,'Vulnerability Scanning',5300,93),
(207,'Vendor Support Contract',26500,94),
(208,'Circuits / Bandwidth',22000,95),
(209,'Hardware Refresh',10600,95),
(210,'Compute (VMs)',38100,96),
(211,'Storage',17100,96),
(212,'Networking / Egress',8600,96),
(213,'Productivity Suite',21000,97),
(214,'Design Tools',7600,97),
(215,'Endpoint Protection',14300,98),
(216,'SIEM',19000,98),
(217,'Vulnerability Scanning',5700,98),
(218,'Vendor Support Contract',28600,99),
(219,'Circuits / Bandwidth',23800,100),
(220,'Hardware Refresh',11400,100),
(221,'Compute (VMs)',36000,101),
(222,'Storage',16200,101),
(223,'Networking / Egress',8100,101),
(224,'Productivity Suite',19800,102),
(225,'Design Tools',7200,102),
(226,'Endpoint Protection',13500,103),
(227,'SIEM',18000,103),
(228,'Vulnerability Scanning',5400,103),
(229,'Vendor Support Contract',27000,104),
(230,'Circuits / Bandwidth',22500,105),
(231,'Hardware Refresh',10800,105),
(232,'Compute (VMs)',38900,106),
(233,'Storage',17500,106),
(234,'Networking / Egress',8700,106),
(235,'Productivity Suite',21400,107),
(236,'Design Tools',7800,107),
(237,'Endpoint Protection',14600,108),
(238,'SIEM',19400,108),
(239,'Vulnerability Scanning',5800,108),
(240,'Vendor Support Contract',29200,109),
(241,'Circuits / Bandwidth',24300,110),
(242,'Hardware Refresh',11700,110),
(243,'Compute (VMs)',42000,111),
(244,'Storage',18900,111),
(245,'Networking / Egress',9400,111),
(246,'Productivity Suite',23100,112),
(247,'Design Tools',8400,112),
(248,'Endpoint Protection',15700,113),
(249,'SIEM',21000,113),
(250,'Vulnerability Scanning',6300,113),
(251,'Vendor Support Contract',31500,114),
(252,'Circuits / Bandwidth',26200,115),
(253,'Hardware Refresh',12600,115),
(254,'Compute (VMs)',45300,116),
(255,'Storage',20400,116),
(256,'Networking / Egress',10200,116),
(257,'Productivity Suite',24900,117),
(258,'Design Tools',9100,117),
(259,'Endpoint Protection',17000,118),
(260,'SIEM',22700,118),
(261,'Vulnerability Scanning',6800,118),
(262,'Vendor Support Contract',34000,119),
(263,'Circuits / Bandwidth',28300,120),
(264,'Hardware Refresh',13600,120),
(265,'Compute (VMs)',49000,121),
(266,'Storage',22000,121),
(267,'Networking / Egress',11000,121),
(268,'Productivity Suite',26900,122),
(269,'Design Tools',9800,122),
(270,'Endpoint Protection',18400,123),
(271,'SIEM',24500,123),
(272,'Vulnerability Scanning',7300,123),
(273,'Vendor Support Contract',36700,124),
(274,'Circuits / Bandwidth',30600,125),
(275,'Hardware Refresh',14700,125);
INSERT INTO `TrendAiPercentage` (`id`,`region`,`year`,`percentage`) VALUES
(1,'AMEA IT',2022,8),
(2,'AMEA IT',2023,13),
(3,'AMEA IT',2024,18),
(4,'AMEA IT',2025,23),
(5,'AMEA IT',2026,28),
(6,'EMEA IT',2022,10),
(7,'EMEA IT',2023,15),
(8,'EMEA IT',2024,20),
(9,'EMEA IT',2025,25),
(10,'EMEA IT',2026,30),
(11,'NABU IT',2022,12),
(12,'NABU IT',2023,18),
(13,'NABU IT',2024,24),
(14,'NABU IT',2025,30),
(15,'NABU IT',2026,36),
(16,'PH IT',2022,6),
(17,'PH IT',2023,10),
(18,'PH IT',2024,14),
(19,'PH IT',2025,18),
(20,'PH IT',2026,22),
(21,'JP IT',2022,15),
(22,'JP IT',2023,19),
(23,'JP IT',2024,23),
(24,'JP IT',2025,27),
(25,'JP IT',2026,31);
ALTER TABLE `CostItem` AUTO_INCREMENT = 126;
ALTER TABLE `SubCostItem` AUTO_INCREMENT = 276;
ALTER TABLE `TrendAiPercentage` AUTO_INCREMENT = 26;
SET FOREIGN_KEY_CHECKS=1;