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 4442ab08b3
commit 06489299d5
30 changed files with 2046 additions and 744 deletions
+1
View File
@@ -122,6 +122,7 @@ export async function getContractById(id: number, decryptPassword = false) {
provider: true,
tariff: true,
contractCategory: true,
previousProvider: true,
previousContract: {
include: {
energyDetails: { include: { meter: { include: { readings: true } }, invoices: true } },
@@ -361,6 +361,17 @@ export async function getCockpitData(): Promise<CockpitResult> {
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({