commit open changes from previous iterations

This commit is contained in:
Marcel Arndt
2025-11-18 14:11:27 +01:00
parent 4cf79f3094
commit c33ab89354
63 changed files with 1646 additions and 227 deletions
@@ -0,0 +1,16 @@
/*
Warnings:
- Added the required column `duration` to the `PlannedTimeStaging` table without a default value. This is not possible if the table is not empty.
- Added the required column `pause` to the `PlannedTimeStaging` table without a default value. This is not possible if the table is not empty.
- Added the required column `duration` to the `WorkTimeStaging` table without a default value. This is not possible if the table is not empty.
- Added the required column `pause` to the `WorkTimeStaging` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER TABLE "PlannedTimeStaging" ADD COLUMN "duration" INTEGER NOT NULL,
ADD COLUMN "pause" INTEGER NOT NULL;
-- AlterTable
ALTER TABLE "WorkTimeStaging" ADD COLUMN "duration" INTEGER NOT NULL,
ADD COLUMN "pause" INTEGER NOT NULL;
@@ -0,0 +1,9 @@
-- AlterTable
ALTER TABLE "DyflexisEmployee" ADD COLUMN "contractTypeName" TEXT,
ALTER COLUMN "contractSalaryHour" SET DATA TYPE DOUBLE PRECISION;
-- AlterTable
ALTER TABLE "EmployeeDyflexisSource" ADD COLUMN "contract_type_name" TEXT;
-- AlterTable
ALTER TABLE "EmployeeDyflexisStaging" ADD COLUMN "contractTypeName" TEXT;
@@ -0,0 +1,10 @@
/*
Warnings:
- The primary key for the `DyflexisEmployee` table will be changed. If it partially fails, the table could be left without primary key constraint.
*/
-- AlterTable
ALTER TABLE "DyflexisEmployee" DROP CONSTRAINT "DyflexisEmployee_pkey",
ADD COLUMN "internalId" UUID NOT NULL DEFAULT gen_random_uuid(),
ADD CONSTRAINT "DyflexisEmployee_pkey" PRIMARY KEY ("internalId");
@@ -0,0 +1,5 @@
-- AlterTable
ALTER TABLE "AttendanceRegistration" ALTER COLUMN "personnelNumber" DROP NOT NULL;
-- AlterTable
ALTER TABLE "AttendanceRegistrationStaging" ADD COLUMN "personnelNumber" TEXT DEFAULT '';
@@ -0,0 +1,14 @@
-- AlterTable
ALTER TABLE "Tour" ADD COLUMN "companyName" TEXT,
ADD COLUMN "overRTW" BOOLEAN NOT NULL DEFAULT false,
ADD COLUMN "schwerlast" BOOLEAN NOT NULL DEFAULT false;
-- AlterTable
ALTER TABLE "TourSource" ADD COLUMN "companyName" TEXT,
ADD COLUMN "overRTW" TEXT,
ADD COLUMN "schwerlast" TEXT;
-- AlterTable
ALTER TABLE "TourStaging" ADD COLUMN "companyName" TEXT,
ADD COLUMN "overRTW" BOOLEAN NOT NULL DEFAULT false,
ADD COLUMN "schwerlast" BOOLEAN NOT NULL DEFAULT false;
@@ -0,0 +1,24 @@
-- CreateTable
CREATE TABLE "Sickdays" (
"id" UUID NOT NULL DEFAULT gen_random_uuid(),
"start" TIMESTAMP(3) NOT NULL,
"end" TIMESTAMP(3) NOT NULL,
"hours" DOUBLE PRECISION NOT NULL,
"days" INTEGER NOT NULL,
"note" TEXT,
"locked" BOOLEAN NOT NULL,
"employeeId" INTEGER NOT NULL,
CONSTRAINT "Sickdays_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Holiday" (
"id" UUID NOT NULL DEFAULT gen_random_uuid(),
"date" TIMESTAMP(3) NOT NULL,
"locked" BOOLEAN NOT NULL,
"excludedFromPayroll" BOOLEAN NOT NULL,
"employeeId" INTEGER NOT NULL,
CONSTRAINT "Holiday_pkey" PRIMARY KEY ("id")
);
@@ -97,6 +97,10 @@ model TourSource {
fahrer String? // ID
color String? // Hex rgb
overRTW String?
companyName String?
schwerlast String?
}
model EmployeeDispoLiveSource {
@@ -174,6 +178,7 @@ model EmployeeDyflexisSource {
contract_end String? // yyyy-MM-dd
contract_hours_week String? // Float string
contract_salary_hour String? // Float string
contract_type_name String?
}
model PatientSource {
@@ -256,6 +261,10 @@ model TourStaging {
revenueDeviation Float @default(0)
consumptionCosts Float @default(0)
overRTW Boolean @default(false)
companyName String?
schwerlast Boolean @default(false)
createdAt DateTime?
updatedAt DateTime?
}
@@ -285,6 +294,7 @@ model AttendanceRegistrationStaging {
employeeId Int
dateTime DateTime
event String
personnelNumber String? @default("")
}
model PlannedTimeStaging {
@@ -299,6 +309,8 @@ model PlannedTimeStaging {
endDate DateTime
deleted Boolean
mark String?
pause Int
duration Int
}
model WorkTimeStaging {
@@ -311,6 +323,8 @@ model WorkTimeStaging {
departmentName String?
startDate DateTime
endDate DateTime
pause Int
duration Int
}
model EmployeeDyflexisStaging {
@@ -323,6 +337,7 @@ model EmployeeDyflexisStaging {
contractEnd DateTime
contractHoursWeek Float
contractSalaryHour Float
contractTypeName String?
}
model EmployeeDispoLiveStaging {
@@ -395,6 +410,10 @@ model Tour {
consumptionCosts Float @default(0)
revenueDeviation Float @default(0)
overRTW Boolean @default(false)
companyName String?
schwerlast Boolean @default(false)
createdAt DateTime?
updatedAt DateTime?
deletedAt DateTime?
@@ -469,7 +488,7 @@ model TicketStateHistory {
model AttendanceRegistration {
attendanceRegistrationId Int @id
employeeId Int
personnelNumber String
personnelNumber String?
dateTime DateTime
event String
}
@@ -511,13 +530,36 @@ model Employee {
}
model DyflexisEmployee {
id Int @id
internalId String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
id Int
firstname String
surname String
contractStart DateTime
contractEnd DateTime?
contractHoursWeek Float
contractSalaryHour Int
contractSalaryHour Float
contractTypeName String?
}
model Sickdays {
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
start DateTime
end DateTime
hours Float
days Int
note String?
locked Boolean
employeeId Int
}
model Holiday {
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
date DateTime
locked Boolean
excludedFromPayroll Boolean
employeeId Int
}
enum CostTypeVariant {
@@ -179,7 +179,7 @@ export const KTW_AOK_TARIFFS = [
{
description: 'AOK/BKK/IKK/Knappschaft KTW',
validFrom: startOfDay(new Date('2024-01-01')),
validTo: endOfDay(new Date('2024-12-31')),
validTo: endOfDay(new Date('2024-10-31')),
costTypes: [
{
description: 'Grundpauschale je Fahrt',
@@ -200,7 +200,7 @@ export const KTW_AOK_TARIFFS = [
'1/KTW-02',
'1/KTW-03',
'1/KTW-04',
'1/KTW-05-E',
'1/KTW-05',
'1/KTW-06',
],
},
@@ -262,6 +262,84 @@ export const KTW_AOK_TARIFFS = [
},
],
},
{
description: 'AOK/BKK/IKK/Knappschaft KTW',
validFrom: startOfDay(new Date('2024-11-01')),
validTo: endOfDay(new Date('2024-12-31')),
costTypes: [
{
description: 'Grundpauschale je Fahrt',
variant: CostTypeVariant.GRUNDPREIS,
costAmount: 6921,
},
{
description: 'QMS Zuschlag',
variant: CostTypeVariant.GRUNDPREIS,
costAmount: 2829,
},
{
description: 'Modernes Einsatzfahrzeug',
variant: CostTypeVariant.FAHRZEUGZUSCHLAG,
costAmount: 1428
},
{
description: 'Leitstellenmanagement',
variant: CostTypeVariant.GRUNDPREIS,
costAmount: 665,
},
{
description: 'Ausbildungsbetrieb Rettungssanitäter',
variant: CostTypeVariant.GRUNDPREIS,
costAmount: 305,
},
{
description: 'ab dem 17. km',
variant: CostTypeVariant.KILOMETERZUSCHLAG,
costAmount: 359,
kmInclusive: 17,
},
{
description: 'Nachtzuschlag 18:30-06:30',
variant: CostTypeVariant.NACHTZUSCHLAG,
costAmount: 6919,
timeRange: '18:30-06:30',
},
{
description: 'Wochenendzuschlag',
variant: CostTypeVariant.WOCHENENDZUSCHLAG,
costAmount: 6919,
},
{
description: 'Feiertagszuschlag',
variant: CostTypeVariant.FEIERTAGSZUSCHLAG,
costAmount: 6919,
},
{
description: 'Desinfektionszuschlag 2.A',
variant: CostTypeVariant.DESINFEKTIONSZUSCHLAG,
costAmount: 3935,
infectionType: '2.A',
},
{
description: 'Desinfektionszuschlag 2.B',
variant: CostTypeVariant.DESINFEKTIONSZUSCHLAG,
costAmount: 16126,
infectionType: '2.B',
},
{
description: 'Desinfektionszuschlag 3.1',
variant: CostTypeVariant.DESINFEKTIONSZUSCHLAG,
costAmount: 18646,
infectionType: '3.1',
},
{
description: 'Desinfektionszuschlag 3.2',
variant: CostTypeVariant.DESINFEKTIONSZUSCHLAG,
costAmount: 18646,
infectionType: '3.2',
},
],
},
{
description: 'AOK/BKK/IKK/Knappschaft KTW',
validFrom: startOfDay(new Date('2025-01-01')),