feat: add updatedAt field to tour from DL Api

This commit is contained in:
Marcel Arndt 2025-06-30 07:53:53 +02:00
parent 5f37743019
commit b9fd09a79f
10 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,8 @@
-- AlterTable
ALTER TABLE "Tour" ADD COLUMN "updatedAt" TIMESTAMP(3);
-- AlterTable
ALTER TABLE "TourSource" ADD COLUMN "lastUpdate" TEXT;
-- AlterTable
ALTER TABLE "TourStaging" ADD COLUMN "updatedAt" TIMESTAMP(3);

View File

@ -31,6 +31,7 @@ model TourSource {
id String? id String?
check String? check String?
createTime String? // yyyy-MM-dd HH:mm:ss 'Europe/Berlin' createTime String? // yyyy-MM-dd HH:mm:ss 'Europe/Berlin'
lastUpdate String? // yyyy-MM-dd HH:mm:ss 'Europe/Berlin'
empfangenVonId String? empfangenVonId String?
endgen String? // yyyy-MM-dd endgen String? // yyyy-MM-dd
serienId String? serienId String?
@ -256,6 +257,7 @@ model TourStaging {
consumptionCosts Float @default(0) consumptionCosts Float @default(0)
createdAt DateTime? createdAt DateTime?
updatedAt DateTime?
} }
model PatientStaging { model PatientStaging {
@ -394,6 +396,7 @@ model Tour {
revenueDeviation Float @default(0) revenueDeviation Float @default(0)
createdAt DateTime? createdAt DateTime?
updatedAt DateTime?
deletedAt DateTime? deletedAt DateTime?
Ticket Ticket? @relation(fields: [ticketId], references: [id]) Ticket Ticket? @relation(fields: [ticketId], references: [id])
ticketId String? @db.Uuid ticketId String? @db.Uuid

View File

@ -364,6 +364,7 @@ type Tour {
totalKm: Float! totalKm: Float!
transportType: String transportType: String
type: String! type: String!
updatedAt: DateTime
} }
type TourCostBreakdown { type TourCostBreakdown {

View File

@ -337,6 +337,7 @@ export type Tour = {
consumptionCosts: Generated<number>; consumptionCosts: Generated<number>;
revenueDeviation: Generated<number>; revenueDeviation: Generated<number>;
createdAt: Timestamp | null; createdAt: Timestamp | null;
updatedAt: Timestamp | null;
deletedAt: Timestamp | null; deletedAt: Timestamp | null;
ticketId: string | null; ticketId: string | null;
}; };
@ -347,6 +348,7 @@ export type TourSource = {
id: string | null; id: string | null;
check: string | null; check: string | null;
createTime: string | null; createTime: string | null;
lastUpdate: string | null;
empfangenVonId: string | null; empfangenVonId: string | null;
endgen: string | null; endgen: string | null;
serienId: string | null; serienId: string | null;
@ -459,6 +461,7 @@ export type TourStaging = {
revenueDeviation: Generated<number>; revenueDeviation: Generated<number>;
consumptionCosts: Generated<number>; consumptionCosts: Generated<number>;
createdAt: Timestamp | null; createdAt: Timestamp | null;
updatedAt: Timestamp | null;
}; };
export type Trace = { export type Trace = {
id: Generated<string>; id: Generated<string>;

View File

@ -98,6 +98,8 @@ export class TourObjectType implements Tour {
@Field({ nullable: true }) @Field({ nullable: true })
createdAt: Date | null; createdAt: Date | null;
@Field({ nullable: true }) @Field({ nullable: true })
updatedAt: Date | null;
@Field({ nullable: true })
deletedAt: Date | null; deletedAt: Date | null;
@Field(() => Boolean, { nullable: true }) @Field(() => Boolean, { nullable: true })

View File

@ -100,6 +100,7 @@ export class DispoLiveExtractorsService {
_id, _id,
check, check,
createTime, createTime,
lastUpdate,
empfangenVonId, empfangenVonId,
endgen, endgen,
serienId, serienId,
@ -166,6 +167,7 @@ export class DispoLiveExtractorsService {
id: _id ? `${_id}` : undefined, id: _id ? `${_id}` : undefined,
check: check ? `${check}` : undefined, check: check ? `${check}` : undefined,
createTime: createTime ? `${createTime}` : undefined, createTime: createTime ? `${createTime}` : undefined,
lastUpdate: lastUpdate ? `${lastUpdate}` : undefined,
empfangenVonId: empfangenVonId empfangenVonId: empfangenVonId
? `${empfangenVonId}` ? `${empfangenVonId}`
: undefined, : undefined,

View File

@ -2,6 +2,7 @@ export interface TourRaw {
_id?: string; _id?: string;
check?: string; check?: string;
createTime?: string; // yyyy-MM-dd HH:mm:ss 'Europe/Berlin' OR yyyy-MM-dd 'Europe/Berlin' createTime?: string; // yyyy-MM-dd HH:mm:ss 'Europe/Berlin' OR yyyy-MM-dd 'Europe/Berlin'
lastUpdate?: string; // yyyy-MM-dd HH:mm:ss 'Europe/Berlin'
empfangenVonId?: string; empfangenVonId?: string;
endgen?: string; // yyyy-MM-dd endgen?: string; // yyyy-MM-dd
serienId?: string; serienId?: string;
@ -140,3 +141,11 @@ export interface EmployeeDyflexisRaw {
contract_hours_week?: string; // Float string contract_hours_week?: string; // Float string
contract_salary_hour?: string; // Float string contract_salary_hour?: string; // Float string
} }
export interface TourSummaryDto {
_id: string;
date: string; // yyyy-MM-dd
einsatznummer: string;
check: string;
lastUpdate?: string;
}

View File

@ -94,6 +94,7 @@ export class TourLoader {
billDate, billDate,
billNumber, billNumber,
createdAt, createdAt,
updatedAt
} = tour; } = tour;
return { return {
@ -145,6 +146,7 @@ export class TourLoader {
billDate, billDate,
billNumber, billNumber,
createdAt, createdAt,
updatedAt,
...(ticketId ? { ticketId } : {}), ...(ticketId ? { ticketId } : {}),
}; };
} }

View File

@ -57,6 +57,7 @@ export interface TourPreStaging {
consumptionCosts?: number; consumptionCosts?: number;
createdAt?: Date; createdAt?: Date;
updatedAt?: Date;
} }
export interface PatientPreStaging { export interface PatientPreStaging {

View File

@ -57,6 +57,11 @@ export class TourTransformer {
: transformProperties(parseCETDateTime('yyyy-MM-dd'))( : transformProperties(parseCETDateTime('yyyy-MM-dd'))(
pick(['createTime'])(tourSource), pick(['createTime'])(tourSource),
)), )),
...(tourSource.lastUpdate
? transformProperties(parseCETDateTime('yyyy-MM-dd HH:mm:ss'))(
pick(['lastUpdate'])(tourSource),
)
: undefined),
...transformProperties(parseBoolean)( ...transformProperties(parseBoolean)(
pick(['infektion', 'gefahren'])(tourSource), pick(['infektion', 'gefahren'])(tourSource),
), ),
@ -107,6 +112,7 @@ export class TourTransformer {
abrDate, abrDate,
abrNum, abrNum,
createTime, createTime,
lastUpdate,
} = tourParsed; } = tourParsed;
return { return {
@ -155,6 +161,7 @@ export class TourTransformer {
billDate: abrDate, billDate: abrDate,
billNumber: abrNum, billNumber: abrNum,
createdAt: createTime, createdAt: createTime,
updatedAt: lastUpdate,
revenue: 0, revenue: 0,
consumptionCosts: 0, consumptionCosts: 0,
} as unknown as TourPreStaging; } as unknown as TourPreStaging;