contractnumber provider added, old provider number field only if no previous contact exist

This commit is contained in:
2026-02-08 14:34:56 +01:00
parent 55f257fffd
commit 4f588015a4
30 changed files with 2046 additions and 744 deletions
+58 -6
View File
@@ -119,8 +119,12 @@ export declare function getAllContracts(filters: ContractFilters): Promise<{
cancellationPeriodId: number | null;
contractDurationId: number | null;
previousContractId: number | null;
previousProviderId: number | null;
previousCustomerNumber: string | null;
previousContractNumber: string | null;
providerId: number | null;
tariffId: number | null;
contractNumberAtProvider: string | null;
priceFirst12Months: string | null;
priceFrom13Months: string | null;
priceAfter24Months: string | null;
@@ -256,6 +260,7 @@ export declare function getContractById(id: number, decryptPassword?: boolean):
} & {
id: number;
meterId: number | null;
previousCustomerNumber: string | null;
contractId: number;
maloId: string | null;
annualConsumption: number | null;
@@ -264,7 +269,6 @@ export declare function getContractById(id: number, decryptPassword?: boolean):
unitPrice: number | null;
bonus: number | null;
previousProviderName: string | null;
previousCustomerNumber: string | null;
}) | null;
stressfreiEmail: {
id: number;
@@ -445,6 +449,7 @@ export declare function getContractById(id: number, decryptPassword?: boolean):
} & {
id: number;
meterId: number | null;
previousCustomerNumber: string | null;
contractId: number;
maloId: string | null;
annualConsumption: number | null;
@@ -453,7 +458,6 @@ export declare function getContractById(id: number, decryptPassword?: boolean):
unitPrice: number | null;
bonus: number | null;
previousProviderName: string | null;
previousCustomerNumber: string | null;
}) | null;
carInsuranceDetails: {
id: number;
@@ -549,8 +553,12 @@ export declare function getContractById(id: number, decryptPassword?: boolean):
cancellationPeriodId: number | null;
contractDurationId: number | null;
previousContractId: number | null;
previousProviderId: number | null;
previousCustomerNumber: string | null;
previousContractNumber: string | null;
providerId: number | null;
tariffId: number | null;
contractNumberAtProvider: string | null;
priceFirst12Months: string | null;
priceFrom13Months: string | null;
priceAfter24Months: string | null;
@@ -572,6 +580,16 @@ export declare function getContractById(id: number, decryptPassword?: boolean):
status: import(".prisma/client").$Enums.ContractStatus;
contractNumber: string;
} | null;
previousProvider: {
id: number;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
name: string;
portalUrl: string | null;
usernameFieldName: string | null;
passwordFieldName: string | null;
} | null;
} & {
id: number;
customerId: number;
@@ -595,8 +613,12 @@ export declare function getContractById(id: number, decryptPassword?: boolean):
cancellationPeriodId: number | null;
contractDurationId: number | null;
previousContractId: number | null;
previousProviderId: number | null;
previousCustomerNumber: string | null;
previousContractNumber: string | null;
providerId: number | null;
tariffId: number | null;
contractNumberAtProvider: string | null;
priceFirst12Months: string | null;
priceFrom13Months: string | null;
priceAfter24Months: string | null;
@@ -764,6 +786,7 @@ export declare function createContract(data: ContractCreateData): Promise<{
energyDetails: {
id: number;
meterId: number | null;
previousCustomerNumber: string | null;
contractId: number;
maloId: string | null;
annualConsumption: number | null;
@@ -772,7 +795,6 @@ export declare function createContract(data: ContractCreateData): Promise<{
unitPrice: number | null;
bonus: number | null;
previousProviderName: string | null;
previousCustomerNumber: string | null;
} | null;
carInsuranceDetails: {
id: number;
@@ -881,8 +903,12 @@ export declare function createContract(data: ContractCreateData): Promise<{
cancellationPeriodId: number | null;
contractDurationId: number | null;
previousContractId: number | null;
previousProviderId: number | null;
previousCustomerNumber: string | null;
previousContractNumber: string | null;
providerId: number | null;
tariffId: number | null;
contractNumberAtProvider: string | null;
priceFirst12Months: string | null;
priceFrom13Months: string | null;
priceAfter24Months: string | null;
@@ -1011,6 +1037,7 @@ export declare function updateContract(id: number, data: Partial<ContractCreateD
} & {
id: number;
meterId: number | null;
previousCustomerNumber: string | null;
contractId: number;
maloId: string | null;
annualConsumption: number | null;
@@ -1019,7 +1046,6 @@ export declare function updateContract(id: number, data: Partial<ContractCreateD
unitPrice: number | null;
bonus: number | null;
previousProviderName: string | null;
previousCustomerNumber: string | null;
}) | null;
stressfreiEmail: {
id: number;
@@ -1200,6 +1226,7 @@ export declare function updateContract(id: number, data: Partial<ContractCreateD
} & {
id: number;
meterId: number | null;
previousCustomerNumber: string | null;
contractId: number;
maloId: string | null;
annualConsumption: number | null;
@@ -1208,7 +1235,6 @@ export declare function updateContract(id: number, data: Partial<ContractCreateD
unitPrice: number | null;
bonus: number | null;
previousProviderName: string | null;
previousCustomerNumber: string | null;
}) | null;
carInsuranceDetails: {
id: number;
@@ -1304,8 +1330,12 @@ export declare function updateContract(id: number, data: Partial<ContractCreateD
cancellationPeriodId: number | null;
contractDurationId: number | null;
previousContractId: number | null;
previousProviderId: number | null;
previousCustomerNumber: string | null;
previousContractNumber: string | null;
providerId: number | null;
tariffId: number | null;
contractNumberAtProvider: string | null;
priceFirst12Months: string | null;
priceFrom13Months: string | null;
priceAfter24Months: string | null;
@@ -1327,6 +1357,16 @@ export declare function updateContract(id: number, data: Partial<ContractCreateD
status: import(".prisma/client").$Enums.ContractStatus;
contractNumber: string;
} | null;
previousProvider: {
id: number;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
name: string;
portalUrl: string | null;
usernameFieldName: string | null;
passwordFieldName: string | null;
} | null;
} & {
id: number;
customerId: number;
@@ -1350,8 +1390,12 @@ export declare function updateContract(id: number, data: Partial<ContractCreateD
cancellationPeriodId: number | null;
contractDurationId: number | null;
previousContractId: number | null;
previousProviderId: number | null;
previousCustomerNumber: string | null;
previousContractNumber: string | null;
providerId: number | null;
tariffId: number | null;
contractNumberAtProvider: string | null;
priceFirst12Months: string | null;
priceFrom13Months: string | null;
priceAfter24Months: string | null;
@@ -1391,8 +1435,12 @@ export declare function deleteContract(id: number): Promise<{
cancellationPeriodId: number | null;
contractDurationId: number | null;
previousContractId: number | null;
previousProviderId: number | null;
previousCustomerNumber: string | null;
previousContractNumber: string | null;
providerId: number | null;
tariffId: number | null;
contractNumberAtProvider: string | null;
priceFirst12Months: string | null;
priceFrom13Months: string | null;
priceAfter24Months: string | null;
@@ -1462,6 +1510,7 @@ export declare function createFollowUpContract(previousContractId: number): Prom
energyDetails: {
id: number;
meterId: number | null;
previousCustomerNumber: string | null;
contractId: number;
maloId: string | null;
annualConsumption: number | null;
@@ -1470,7 +1519,6 @@ export declare function createFollowUpContract(previousContractId: number): Prom
unitPrice: number | null;
bonus: number | null;
previousProviderName: string | null;
previousCustomerNumber: string | null;
} | null;
carInsuranceDetails: {
id: number;
@@ -1579,8 +1627,12 @@ export declare function createFollowUpContract(previousContractId: number): Prom
cancellationPeriodId: number | null;
contractDurationId: number | null;
previousContractId: number | null;
previousProviderId: number | null;
previousCustomerNumber: string | null;
previousContractNumber: string | null;
providerId: number | null;
tariffId: number | null;
contractNumberAtProvider: string | null;
priceFirst12Months: string | null;
priceFrom13Months: string | null;
priceAfter24Months: string | null;
File diff suppressed because one or more lines are too long
+1
View File
@@ -119,6 +119,7 @@ async function getContractById(id, decryptPassword = false) {
provider: true,
tariff: true,
contractCategory: true,
previousProvider: true,
previousContract: {
include: {
energyDetails: { include: { meter: { include: { readings: true } }, invoices: true } },
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"contractCockpit.service.d.ts","sourceRoot":"","sources":["../../src/services/contractCockpit.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,cAAc,EACpC,MAAM,gBAAgB,CAAC;AAMxB,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,CAAC;AAElE,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,YAAY,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,cAAc,CAAC;IACvB,QAAQ,EAAE;QACR,EAAE,EAAE,MAAM,CAAC;QACX,cAAc,EAAE,MAAM,CAAC;QACvB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,QAAQ,CAAC,EAAE;QACT,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,MAAM,CAAC,EAAE;QACP,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,cAAc,EAAE,YAAY,CAAC;CAC9B;AAED,MAAM,WAAW,cAAc;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE;QACV,qBAAqB,EAAE,MAAM,CAAC;QAC9B,cAAc,EAAE,MAAM,CAAC;QACvB,kBAAkB,EAAE,MAAM,CAAC;QAC3B,WAAW,EAAE,MAAM,CAAC;QACpB,eAAe,EAAE,MAAM,CAAC;QACxB,SAAS,EAAE,MAAM,CAAC;QAClB,gBAAgB,EAAE,MAAM,CAAC;QACzB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;CACH;AAED,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,eAAe,EAAE,CAAC;IAC7B,OAAO,EAAE,cAAc,CAAC;IACxB,UAAU,EAAE;QACV,YAAY,EAAE,MAAM,CAAC;QACrB,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AAyED,wBAAsB,cAAc,IAAI,OAAO,CAAC,aAAa,CAAC,CAyc7D"}
{"version":3,"file":"contractCockpit.service.d.ts","sourceRoot":"","sources":["../../src/services/contractCockpit.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,cAAc,EACpC,MAAM,gBAAgB,CAAC;AAMxB,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,CAAC;AAElE,MAAM,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EAAE,eAAe,EAAE,CAAC;IAC7B,OAAO,EAAE,cAAc,CAAC;IACxB,UAAU,EAAE;QACV,YAAY,EAAE,MAAM,CAAC;QACrB,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AAyED,wBAAsB,cAAc,IAAI,OAAO,CAAC,aAAa,CAAC,CAod7D"}
+10
View File
@@ -307,6 +307,16 @@ async function getCockpitData() {
});
summary.byCategory.missingData++;
}
// 4b. KEINE VERTRAGSNUMMER BEIM ANBIETER
if (!contract.contractNumberAtProvider) {
issues.push({
type: 'missing_contract_number',
label: 'Vertragsnummer fehlt',
urgency: 'warning',
details: 'Vertragsnummer beim Anbieter fehlt',
});
summary.byCategory.missingData++;
}
// 5. KEIN ANBIETER/TARIF
if (!contract.providerId && !contract.providerName) {
issues.push({
File diff suppressed because one or more lines are too long
+4
View File
@@ -180,8 +180,12 @@ export declare function getCustomerById(id: number): Promise<({
cancellationPeriodId: number | null;
contractDurationId: number | null;
previousContractId: number | null;
previousProviderId: number | null;
previousCustomerNumber: string | null;
previousContractNumber: string | null;
providerId: number | null;
tariffId: number | null;
contractNumberAtProvider: string | null;
priceFirst12Months: string | null;
priceFrom13Months: string | null;
priceAfter24Months: string | null;
File diff suppressed because one or more lines are too long