added place to telecommunication, added contract documents, added invoice to other contracts

This commit is contained in:
2026-03-25 16:55:48 +01:00
parent eaa94e766a
commit 3dd4f7b656
30 changed files with 3424 additions and 90 deletions
+71 -4
View File
@@ -297,7 +297,8 @@ export declare function getContractById(id: number, decryptPassword?: boolean):
updatedAt: Date;
notes: string | null;
documentPath: string | null;
energyContractDetailsId: number;
energyContractDetailsId: number | null;
contractId: number | null;
invoiceDate: Date;
invoiceType: import(".prisma/client").$Enums.InvoiceType;
}[];
@@ -426,7 +427,8 @@ export declare function getContractById(id: number, decryptPassword?: boolean):
updatedAt: Date;
notes: string | null;
documentPath: string | null;
energyContractDetailsId: number;
energyContractDetailsId: number | null;
contractId: number | null;
invoiceDate: Date;
invoiceType: import(".prisma/client").$Enums.InvoiceType;
}[];
@@ -466,6 +468,9 @@ export declare function getContractById(id: number, decryptPassword?: boolean):
routerModel: string | null;
installationDate: Date | null;
internetUsername: string | null;
propertyType: string | null;
propertyLocation: string | null;
connectionLocation: string | null;
}) | null;
mobileDetails: ({
simCards: {
@@ -630,6 +635,9 @@ export declare function getContractById(id: number, decryptPassword?: boolean):
routerModel: string | null;
installationDate: Date | null;
internetUsername: string | null;
propertyType: string | null;
propertyLocation: string | null;
connectionLocation: string | null;
}) | null;
mobileDetails: ({
simCards: {
@@ -679,6 +687,27 @@ export declare function getContractById(id: number, decryptPassword?: boolean):
deductibleFull: number | null;
previousInsurer: string | null;
} | null;
documents: {
id: number;
createdAt: Date;
notes: string | null;
documentPath: string;
contractId: number;
documentType: string;
originalName: string;
uploadedBy: string | null;
}[];
invoices: {
id: number;
createdAt: Date;
updatedAt: Date;
notes: string | null;
documentPath: string | null;
energyContractDetailsId: number | null;
contractId: number | null;
invoiceDate: Date;
invoiceType: import(".prisma/client").$Enums.InvoiceType;
}[];
} & {
portalPasswordEncrypted: string | null;
id: number;
@@ -772,6 +801,9 @@ interface ContractCreateData {
installationDate?: Date;
internetUsername?: string;
internetPassword?: string;
propertyType?: string;
propertyLocation?: string;
connectionLocation?: string;
homeId?: string;
activationCode?: string;
phoneNumbers?: {
@@ -922,6 +954,9 @@ export declare function createContract(data: ContractCreateData): Promise<{
routerModel: string | null;
installationDate: Date | null;
internetUsername: string | null;
propertyType: string | null;
propertyLocation: string | null;
connectionLocation: string | null;
}) | null;
mobileDetails: ({
simCards: {
@@ -1165,7 +1200,8 @@ export declare function updateContract(id: number, data: Partial<ContractCreateD
updatedAt: Date;
notes: string | null;
documentPath: string | null;
energyContractDetailsId: number;
energyContractDetailsId: number | null;
contractId: number | null;
invoiceDate: Date;
invoiceType: import(".prisma/client").$Enums.InvoiceType;
}[];
@@ -1294,7 +1330,8 @@ export declare function updateContract(id: number, data: Partial<ContractCreateD
updatedAt: Date;
notes: string | null;
documentPath: string | null;
energyContractDetailsId: number;
energyContractDetailsId: number | null;
contractId: number | null;
invoiceDate: Date;
invoiceType: import(".prisma/client").$Enums.InvoiceType;
}[];
@@ -1334,6 +1371,9 @@ export declare function updateContract(id: number, data: Partial<ContractCreateD
routerModel: string | null;
installationDate: Date | null;
internetUsername: string | null;
propertyType: string | null;
propertyLocation: string | null;
connectionLocation: string | null;
}) | null;
mobileDetails: ({
simCards: {
@@ -1498,6 +1538,9 @@ export declare function updateContract(id: number, data: Partial<ContractCreateD
routerModel: string | null;
installationDate: Date | null;
internetUsername: string | null;
propertyType: string | null;
propertyLocation: string | null;
connectionLocation: string | null;
}) | null;
mobileDetails: ({
simCards: {
@@ -1547,6 +1590,27 @@ export declare function updateContract(id: number, data: Partial<ContractCreateD
deductibleFull: number | null;
previousInsurer: string | null;
} | null;
documents: {
id: number;
createdAt: Date;
notes: string | null;
documentPath: string;
contractId: number;
documentType: string;
originalName: string;
uploadedBy: string | null;
}[];
invoices: {
id: number;
createdAt: Date;
updatedAt: Date;
notes: string | null;
documentPath: string | null;
energyContractDetailsId: number | null;
contractId: number | null;
invoiceDate: Date;
invoiceType: import(".prisma/client").$Enums.InvoiceType;
}[];
} & {
portalPasswordEncrypted: string | null;
id: number;
@@ -1737,6 +1801,9 @@ export declare function createFollowUpContract(previousContractId: number): Prom
routerModel: string | null;
installationDate: Date | null;
internetUsername: string | null;
propertyType: string | null;
propertyLocation: string | null;
connectionLocation: string | null;
}) | null;
mobileDetails: ({
simCards: {
File diff suppressed because one or more lines are too long
+8
View File
@@ -138,6 +138,8 @@ async function getContractById(id, decryptPassword = false) {
tvDetails: true,
carInsuranceDetails: true,
stressfreiEmail: true,
invoices: { orderBy: { invoiceDate: 'desc' } },
documents: { orderBy: { createdAt: 'desc' } },
followUpContract: {
select: { id: true, contractNumber: true, status: true },
},
@@ -183,6 +185,9 @@ async function createContract(data) {
internetPasswordEncrypted: internetDetails.internetPassword
? (0, encryption_js_1.encrypt)(internetDetails.internetPassword)
: undefined,
propertyType: internetDetails.propertyType,
propertyLocation: internetDetails.propertyLocation,
connectionLocation: internetDetails.connectionLocation,
homeId: internetDetails.homeId,
activationCode: internetDetails.activationCode,
phoneNumbers: internetDetails.phoneNumbers && internetDetails.phoneNumbers.length > 0
@@ -321,6 +326,9 @@ async function updateContract(id, data) {
...(internetPassword
? { internetPasswordEncrypted: (0, encryption_js_1.encrypt)(internetPassword) }
: {}),
propertyType: internetData.propertyType,
propertyLocation: internetData.propertyLocation,
connectionLocation: internetData.connectionLocation,
homeId: internetData.homeId,
activationCode: internetData.activationCode,
};
File diff suppressed because one or more lines are too long