contractnumber provider added, old provider number field only if no previous contact exist
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user