opencrm/backend/dist/services/contract.service.d.ts

1478 lines
46 KiB
TypeScript

import { ContractType, ContractStatus } from '@prisma/client';
export interface ContractFilters {
customerId?: number;
customerIds?: number[];
type?: ContractType;
status?: ContractStatus;
search?: string;
page?: number;
limit?: number;
}
export declare function getAllContracts(filters: ContractFilters): Promise<{
contracts: ({
customer: {
id: number;
firstName: string;
lastName: string;
customerNumber: string;
companyName: string | null;
};
address: {
id: number;
customerId: number;
createdAt: Date;
updatedAt: Date;
type: import(".prisma/client").$Enums.AddressType;
isDefault: boolean;
street: string;
houseNumber: string;
postalCode: string;
city: string;
country: string;
} | null;
salesPlatform: {
id: number;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
name: string;
contactInfo: string | null;
} | null;
tariff: {
id: number;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
name: string;
providerId: number;
} | null;
provider: {
id: number;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
name: string;
portalUrl: string | null;
usernameFieldName: string | null;
passwordFieldName: string | null;
} | null;
contractCategory: {
id: number;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
name: string;
code: string;
icon: string | null;
color: string | null;
sortOrder: number;
} | null;
cancellationPeriod: {
id: number;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
description: string;
code: string;
} | null;
contractDuration: {
id: number;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
description: string;
code: string;
} | null;
} & {
id: number;
customerId: number;
createdAt: Date;
updatedAt: Date;
type: import(".prisma/client").$Enums.ContractType;
notes: string | null;
portalPasswordEncrypted: string | null;
startDate: Date | null;
status: import(".prisma/client").$Enums.ContractStatus;
customerNumberAtProvider: string | null;
tariffName: string | null;
providerName: string | null;
contractNumber: string;
contractCategoryId: number | null;
addressId: number | null;
bankCardId: number | null;
identityDocumentId: number | null;
salesPlatformId: number | null;
cancellationPeriodId: number | null;
contractDurationId: number | null;
previousContractId: number | null;
providerId: number | null;
tariffId: number | null;
priceFirst12Months: string | null;
priceFrom13Months: string | null;
priceAfter24Months: string | null;
endDate: Date | null;
commission: number | null;
cancellationLetterPath: string | null;
cancellationConfirmationPath: string | null;
cancellationLetterOptionsPath: string | null;
cancellationConfirmationOptionsPath: string | null;
cancellationConfirmationDate: Date | null;
cancellationConfirmationOptionsDate: Date | null;
wasSpecialCancellation: boolean;
portalUsername: string | null;
stressfreiEmailId: number | null;
})[];
pagination: {
page: number;
limit: number;
total: number;
totalPages: number;
};
}>;
export declare function getContractById(id: number, decryptPassword?: boolean): Promise<({
customer: {
id: number;
email: string | null;
firstName: string;
lastName: string;
createdAt: Date;
updatedAt: Date;
customerNumber: string;
portalEmail: string | null;
type: import(".prisma/client").$Enums.CustomerType;
salutation: string | null;
companyName: string | null;
foundingDate: Date | null;
birthDate: Date | null;
birthPlace: string | null;
phone: string | null;
mobile: string | null;
taxNumber: string | null;
businessRegistrationPath: string | null;
commercialRegisterPath: string | null;
commercialRegisterNumber: string | null;
privacyPolicyPath: string | null;
notes: string | null;
portalEnabled: boolean;
portalPasswordHash: string | null;
portalPasswordEncrypted: string | null;
portalLastLogin: Date | null;
};
address: {
id: number;
customerId: number;
createdAt: Date;
updatedAt: Date;
type: import(".prisma/client").$Enums.AddressType;
isDefault: boolean;
street: string;
houseNumber: string;
postalCode: string;
city: string;
country: string;
} | null;
salesPlatform: {
id: number;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
name: string;
contactInfo: string | null;
} | null;
bankCard: {
id: number;
customerId: number;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
accountHolder: string;
iban: string;
bic: string | null;
bankName: string | null;
expiryDate: Date | null;
documentPath: string | null;
} | null;
identityDocument: {
id: number;
customerId: number;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
type: import(".prisma/client").$Enums.DocumentType;
expiryDate: Date | null;
documentPath: string | null;
documentNumber: string;
issuingAuthority: string | null;
issueDate: Date | null;
licenseClasses: string | null;
licenseIssueDate: Date | null;
} | null;
energyDetails: ({
meter: ({
readings: {
id: number;
createdAt: Date;
notes: string | null;
readingDate: Date;
value: number;
unit: string;
meterId: number;
}[];
} & {
id: number;
customerId: number;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
type: import(".prisma/client").$Enums.MeterType;
meterNumber: string;
location: string | null;
}) | null;
} & {
id: number;
meterId: number | null;
contractId: number;
annualConsumption: number | null;
basePrice: number | null;
unitPrice: number | null;
bonus: number | null;
previousProviderName: string | null;
previousCustomerNumber: string | null;
}) | null;
stressfreiEmail: {
id: number;
email: string;
customerId: number;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
notes: string | null;
hasMailbox: boolean;
platform: string | null;
isProvisioned: boolean;
provisionedAt: Date | null;
provisionError: string | null;
emailPasswordEncrypted: string | null;
} | null;
carInsuranceDetails: {
id: number;
policyNumber: string | null;
vin: string | null;
licensePlate: string | null;
contractId: number;
hsn: string | null;
tsn: string | null;
vehicleType: string | null;
firstRegistration: Date | null;
noClaimsClass: string | null;
insuranceType: import(".prisma/client").$Enums.InsuranceType;
deductiblePartial: number | null;
deductibleFull: number | null;
previousInsurer: string | null;
} | null;
tvDetails: {
id: number;
contractId: number;
receiverModel: string | null;
smartcardNumber: string | null;
package: string | null;
} | null;
mobileDetails: ({
simCards: {
id: number;
createdAt: Date;
updatedAt: Date;
simCardNumber: string | null;
phoneNumber: string | null;
isMain: boolean;
pin: string | null;
puk: string | null;
isMultisim: boolean;
mobileDetailsId: number;
}[];
} & {
id: number;
simCardNumber: string | null;
phoneNumber: string | null;
deviceImei: string | null;
contractId: number;
requiresMultisim: boolean;
dataVolume: number | null;
includedMinutes: number | null;
includedSMS: number | null;
deviceModel: string | null;
}) | null;
internetDetails: ({
phoneNumbers: {
id: number;
phoneNumber: string;
isMain: boolean;
sipUsername: string | null;
sipPasswordEncrypted: string | null;
sipServer: string | null;
internetContractDetailsId: number;
}[];
} & {
id: number;
activationCode: string | null;
homeId: string | null;
routerSerialNumber: string | null;
contractId: number;
downloadSpeed: number | null;
uploadSpeed: number | null;
routerModel: string | null;
installationDate: Date | null;
internetUsername: string | null;
internetPasswordEncrypted: string | null;
}) | null;
tariff: {
id: number;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
name: string;
providerId: number;
} | null;
provider: {
id: number;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
name: string;
portalUrl: string | null;
usernameFieldName: string | null;
passwordFieldName: string | null;
} | null;
contractCategory: {
id: number;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
name: string;
code: string;
icon: string | null;
color: string | null;
sortOrder: number;
} | null;
cancellationPeriod: {
id: number;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
description: string;
code: string;
} | null;
contractDuration: {
id: number;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
description: string;
code: string;
} | null;
previousContract: ({
energyDetails: ({
meter: ({
readings: {
id: number;
createdAt: Date;
notes: string | null;
readingDate: Date;
value: number;
unit: string;
meterId: number;
}[];
} & {
id: number;
customerId: number;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
type: import(".prisma/client").$Enums.MeterType;
meterNumber: string;
location: string | null;
}) | null;
} & {
id: number;
meterId: number | null;
contractId: number;
annualConsumption: number | null;
basePrice: number | null;
unitPrice: number | null;
bonus: number | null;
previousProviderName: string | null;
previousCustomerNumber: string | null;
}) | null;
carInsuranceDetails: {
id: number;
policyNumber: string | null;
vin: string | null;
licensePlate: string | null;
contractId: number;
hsn: string | null;
tsn: string | null;
vehicleType: string | null;
firstRegistration: Date | null;
noClaimsClass: string | null;
insuranceType: import(".prisma/client").$Enums.InsuranceType;
deductiblePartial: number | null;
deductibleFull: number | null;
previousInsurer: string | null;
} | null;
tvDetails: {
id: number;
contractId: number;
receiverModel: string | null;
smartcardNumber: string | null;
package: string | null;
} | null;
mobileDetails: ({
simCards: {
id: number;
createdAt: Date;
updatedAt: Date;
simCardNumber: string | null;
phoneNumber: string | null;
isMain: boolean;
pin: string | null;
puk: string | null;
isMultisim: boolean;
mobileDetailsId: number;
}[];
} & {
id: number;
simCardNumber: string | null;
phoneNumber: string | null;
deviceImei: string | null;
contractId: number;
requiresMultisim: boolean;
dataVolume: number | null;
includedMinutes: number | null;
includedSMS: number | null;
deviceModel: string | null;
}) | null;
internetDetails: ({
phoneNumbers: {
id: number;
phoneNumber: string;
isMain: boolean;
sipUsername: string | null;
sipPasswordEncrypted: string | null;
sipServer: string | null;
internetContractDetailsId: number;
}[];
} & {
id: number;
activationCode: string | null;
homeId: string | null;
routerSerialNumber: string | null;
contractId: number;
downloadSpeed: number | null;
uploadSpeed: number | null;
routerModel: string | null;
installationDate: Date | null;
internetUsername: string | null;
internetPasswordEncrypted: string | null;
}) | null;
} & {
id: number;
customerId: number;
createdAt: Date;
updatedAt: Date;
type: import(".prisma/client").$Enums.ContractType;
notes: string | null;
portalPasswordEncrypted: string | null;
startDate: Date | null;
status: import(".prisma/client").$Enums.ContractStatus;
customerNumberAtProvider: string | null;
tariffName: string | null;
providerName: string | null;
contractNumber: string;
contractCategoryId: number | null;
addressId: number | null;
bankCardId: number | null;
identityDocumentId: number | null;
salesPlatformId: number | null;
cancellationPeriodId: number | null;
contractDurationId: number | null;
previousContractId: number | null;
providerId: number | null;
tariffId: number | null;
priceFirst12Months: string | null;
priceFrom13Months: string | null;
priceAfter24Months: string | null;
endDate: Date | null;
commission: number | null;
cancellationLetterPath: string | null;
cancellationConfirmationPath: string | null;
cancellationLetterOptionsPath: string | null;
cancellationConfirmationOptionsPath: string | null;
cancellationConfirmationDate: Date | null;
cancellationConfirmationOptionsDate: Date | null;
wasSpecialCancellation: boolean;
portalUsername: string | null;
stressfreiEmailId: number | null;
}) | null;
followUpContract: {
id: number;
status: import(".prisma/client").$Enums.ContractStatus;
contractNumber: string;
} | null;
} & {
id: number;
customerId: number;
createdAt: Date;
updatedAt: Date;
type: import(".prisma/client").$Enums.ContractType;
notes: string | null;
portalPasswordEncrypted: string | null;
startDate: Date | null;
status: import(".prisma/client").$Enums.ContractStatus;
customerNumberAtProvider: string | null;
tariffName: string | null;
providerName: string | null;
contractNumber: string;
contractCategoryId: number | null;
addressId: number | null;
bankCardId: number | null;
identityDocumentId: number | null;
salesPlatformId: number | null;
cancellationPeriodId: number | null;
contractDurationId: number | null;
previousContractId: number | null;
providerId: number | null;
tariffId: number | null;
priceFirst12Months: string | null;
priceFrom13Months: string | null;
priceAfter24Months: string | null;
endDate: Date | null;
commission: number | null;
cancellationLetterPath: string | null;
cancellationConfirmationPath: string | null;
cancellationLetterOptionsPath: string | null;
cancellationConfirmationOptionsPath: string | null;
cancellationConfirmationDate: Date | null;
cancellationConfirmationOptionsDate: Date | null;
wasSpecialCancellation: boolean;
portalUsername: string | null;
stressfreiEmailId: number | null;
}) | null>;
interface ContractCreateData {
customerId: number;
type: ContractType;
contractCategoryId?: number;
status?: ContractStatus;
addressId?: number;
bankCardId?: number;
identityDocumentId?: number;
salesPlatformId?: number;
previousContractId?: number;
providerId?: number;
tariffId?: number;
providerName?: string;
tariffName?: string;
customerNumberAtProvider?: string;
priceFirst12Months?: string;
priceFrom13Months?: string;
priceAfter24Months?: string;
startDate?: Date;
endDate?: Date;
cancellationPeriodId?: number;
contractDurationId?: number;
commission?: number;
portalUsername?: string;
portalPassword?: string;
stressfreiEmailId?: number;
notes?: string;
cancellationConfirmationDate?: Date;
cancellationConfirmationOptionsDate?: Date;
wasSpecialCancellation?: boolean;
energyDetails?: {
meterId?: number;
annualConsumption?: number;
basePrice?: number;
unitPrice?: number;
bonus?: number;
previousProviderName?: string;
previousCustomerNumber?: string;
};
internetDetails?: {
downloadSpeed?: number;
uploadSpeed?: number;
routerModel?: string;
routerSerialNumber?: string;
installationDate?: Date;
internetUsername?: string;
internetPassword?: string;
homeId?: string;
activationCode?: string;
phoneNumbers?: {
id?: number;
phoneNumber: string;
isMain?: boolean;
sipUsername?: string;
sipPassword?: string;
sipServer?: string;
}[];
};
mobileDetails?: {
requiresMultisim?: boolean;
dataVolume?: number;
includedMinutes?: number;
includedSMS?: number;
deviceModel?: string;
deviceImei?: string;
phoneNumber?: string;
simCardNumber?: string;
simCards?: {
id?: number;
phoneNumber?: string;
simCardNumber?: string;
pin?: string;
puk?: string;
isMultisim?: boolean;
isMain?: boolean;
}[];
};
tvDetails?: {
receiverModel?: string;
smartcardNumber?: string;
package?: string;
};
carInsuranceDetails?: {
licensePlate?: string;
hsn?: string;
tsn?: string;
vin?: string;
vehicleType?: string;
firstRegistration?: Date;
noClaimsClass?: string;
insuranceType?: 'LIABILITY' | 'PARTIAL' | 'FULL';
deductiblePartial?: number;
deductibleFull?: number;
policyNumber?: string;
previousInsurer?: string;
};
}
export declare function createContract(data: ContractCreateData): Promise<{
customer: {
id: number;
email: string | null;
firstName: string;
lastName: string;
createdAt: Date;
updatedAt: Date;
customerNumber: string;
portalEmail: string | null;
type: import(".prisma/client").$Enums.CustomerType;
salutation: string | null;
companyName: string | null;
foundingDate: Date | null;
birthDate: Date | null;
birthPlace: string | null;
phone: string | null;
mobile: string | null;
taxNumber: string | null;
businessRegistrationPath: string | null;
commercialRegisterPath: string | null;
commercialRegisterNumber: string | null;
privacyPolicyPath: string | null;
notes: string | null;
portalEnabled: boolean;
portalPasswordHash: string | null;
portalPasswordEncrypted: string | null;
portalLastLogin: Date | null;
};
address: {
id: number;
customerId: number;
createdAt: Date;
updatedAt: Date;
type: import(".prisma/client").$Enums.AddressType;
isDefault: boolean;
street: string;
houseNumber: string;
postalCode: string;
city: string;
country: string;
} | null;
salesPlatform: {
id: number;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
name: string;
contactInfo: string | null;
} | null;
energyDetails: {
id: number;
meterId: number | null;
contractId: number;
annualConsumption: number | null;
basePrice: number | null;
unitPrice: number | null;
bonus: number | null;
previousProviderName: string | null;
previousCustomerNumber: string | null;
} | null;
carInsuranceDetails: {
id: number;
policyNumber: string | null;
vin: string | null;
licensePlate: string | null;
contractId: number;
hsn: string | null;
tsn: string | null;
vehicleType: string | null;
firstRegistration: Date | null;
noClaimsClass: string | null;
insuranceType: import(".prisma/client").$Enums.InsuranceType;
deductiblePartial: number | null;
deductibleFull: number | null;
previousInsurer: string | null;
} | null;
tvDetails: {
id: number;
contractId: number;
receiverModel: string | null;
smartcardNumber: string | null;
package: string | null;
} | null;
mobileDetails: ({
simCards: {
id: number;
createdAt: Date;
updatedAt: Date;
simCardNumber: string | null;
phoneNumber: string | null;
isMain: boolean;
pin: string | null;
puk: string | null;
isMultisim: boolean;
mobileDetailsId: number;
}[];
} & {
id: number;
simCardNumber: string | null;
phoneNumber: string | null;
deviceImei: string | null;
contractId: number;
requiresMultisim: boolean;
dataVolume: number | null;
includedMinutes: number | null;
includedSMS: number | null;
deviceModel: string | null;
}) | null;
internetDetails: ({
phoneNumbers: {
id: number;
phoneNumber: string;
isMain: boolean;
sipUsername: string | null;
sipPasswordEncrypted: string | null;
sipServer: string | null;
internetContractDetailsId: number;
}[];
} & {
id: number;
activationCode: string | null;
homeId: string | null;
routerSerialNumber: string | null;
contractId: number;
downloadSpeed: number | null;
uploadSpeed: number | null;
routerModel: string | null;
installationDate: Date | null;
internetUsername: string | null;
internetPasswordEncrypted: string | null;
}) | null;
} & {
id: number;
customerId: number;
createdAt: Date;
updatedAt: Date;
type: import(".prisma/client").$Enums.ContractType;
notes: string | null;
portalPasswordEncrypted: string | null;
startDate: Date | null;
status: import(".prisma/client").$Enums.ContractStatus;
customerNumberAtProvider: string | null;
tariffName: string | null;
providerName: string | null;
contractNumber: string;
contractCategoryId: number | null;
addressId: number | null;
bankCardId: number | null;
identityDocumentId: number | null;
salesPlatformId: number | null;
cancellationPeriodId: number | null;
contractDurationId: number | null;
previousContractId: number | null;
providerId: number | null;
tariffId: number | null;
priceFirst12Months: string | null;
priceFrom13Months: string | null;
priceAfter24Months: string | null;
endDate: Date | null;
commission: number | null;
cancellationLetterPath: string | null;
cancellationConfirmationPath: string | null;
cancellationLetterOptionsPath: string | null;
cancellationConfirmationOptionsPath: string | null;
cancellationConfirmationDate: Date | null;
cancellationConfirmationOptionsDate: Date | null;
wasSpecialCancellation: boolean;
portalUsername: string | null;
stressfreiEmailId: number | null;
}>;
export declare function updateContract(id: number, data: Partial<ContractCreateData>): Promise<({
customer: {
id: number;
email: string | null;
firstName: string;
lastName: string;
createdAt: Date;
updatedAt: Date;
customerNumber: string;
portalEmail: string | null;
type: import(".prisma/client").$Enums.CustomerType;
salutation: string | null;
companyName: string | null;
foundingDate: Date | null;
birthDate: Date | null;
birthPlace: string | null;
phone: string | null;
mobile: string | null;
taxNumber: string | null;
businessRegistrationPath: string | null;
commercialRegisterPath: string | null;
commercialRegisterNumber: string | null;
privacyPolicyPath: string | null;
notes: string | null;
portalEnabled: boolean;
portalPasswordHash: string | null;
portalPasswordEncrypted: string | null;
portalLastLogin: Date | null;
};
address: {
id: number;
customerId: number;
createdAt: Date;
updatedAt: Date;
type: import(".prisma/client").$Enums.AddressType;
isDefault: boolean;
street: string;
houseNumber: string;
postalCode: string;
city: string;
country: string;
} | null;
salesPlatform: {
id: number;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
name: string;
contactInfo: string | null;
} | null;
bankCard: {
id: number;
customerId: number;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
accountHolder: string;
iban: string;
bic: string | null;
bankName: string | null;
expiryDate: Date | null;
documentPath: string | null;
} | null;
identityDocument: {
id: number;
customerId: number;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
type: import(".prisma/client").$Enums.DocumentType;
expiryDate: Date | null;
documentPath: string | null;
documentNumber: string;
issuingAuthority: string | null;
issueDate: Date | null;
licenseClasses: string | null;
licenseIssueDate: Date | null;
} | null;
energyDetails: ({
meter: ({
readings: {
id: number;
createdAt: Date;
notes: string | null;
readingDate: Date;
value: number;
unit: string;
meterId: number;
}[];
} & {
id: number;
customerId: number;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
type: import(".prisma/client").$Enums.MeterType;
meterNumber: string;
location: string | null;
}) | null;
} & {
id: number;
meterId: number | null;
contractId: number;
annualConsumption: number | null;
basePrice: number | null;
unitPrice: number | null;
bonus: number | null;
previousProviderName: string | null;
previousCustomerNumber: string | null;
}) | null;
stressfreiEmail: {
id: number;
email: string;
customerId: number;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
notes: string | null;
hasMailbox: boolean;
platform: string | null;
isProvisioned: boolean;
provisionedAt: Date | null;
provisionError: string | null;
emailPasswordEncrypted: string | null;
} | null;
carInsuranceDetails: {
id: number;
policyNumber: string | null;
vin: string | null;
licensePlate: string | null;
contractId: number;
hsn: string | null;
tsn: string | null;
vehicleType: string | null;
firstRegistration: Date | null;
noClaimsClass: string | null;
insuranceType: import(".prisma/client").$Enums.InsuranceType;
deductiblePartial: number | null;
deductibleFull: number | null;
previousInsurer: string | null;
} | null;
tvDetails: {
id: number;
contractId: number;
receiverModel: string | null;
smartcardNumber: string | null;
package: string | null;
} | null;
mobileDetails: ({
simCards: {
id: number;
createdAt: Date;
updatedAt: Date;
simCardNumber: string | null;
phoneNumber: string | null;
isMain: boolean;
pin: string | null;
puk: string | null;
isMultisim: boolean;
mobileDetailsId: number;
}[];
} & {
id: number;
simCardNumber: string | null;
phoneNumber: string | null;
deviceImei: string | null;
contractId: number;
requiresMultisim: boolean;
dataVolume: number | null;
includedMinutes: number | null;
includedSMS: number | null;
deviceModel: string | null;
}) | null;
internetDetails: ({
phoneNumbers: {
id: number;
phoneNumber: string;
isMain: boolean;
sipUsername: string | null;
sipPasswordEncrypted: string | null;
sipServer: string | null;
internetContractDetailsId: number;
}[];
} & {
id: number;
activationCode: string | null;
homeId: string | null;
routerSerialNumber: string | null;
contractId: number;
downloadSpeed: number | null;
uploadSpeed: number | null;
routerModel: string | null;
installationDate: Date | null;
internetUsername: string | null;
internetPasswordEncrypted: string | null;
}) | null;
tariff: {
id: number;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
name: string;
providerId: number;
} | null;
provider: {
id: number;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
name: string;
portalUrl: string | null;
usernameFieldName: string | null;
passwordFieldName: string | null;
} | null;
contractCategory: {
id: number;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
name: string;
code: string;
icon: string | null;
color: string | null;
sortOrder: number;
} | null;
cancellationPeriod: {
id: number;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
description: string;
code: string;
} | null;
contractDuration: {
id: number;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
description: string;
code: string;
} | null;
previousContract: ({
energyDetails: ({
meter: ({
readings: {
id: number;
createdAt: Date;
notes: string | null;
readingDate: Date;
value: number;
unit: string;
meterId: number;
}[];
} & {
id: number;
customerId: number;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
type: import(".prisma/client").$Enums.MeterType;
meterNumber: string;
location: string | null;
}) | null;
} & {
id: number;
meterId: number | null;
contractId: number;
annualConsumption: number | null;
basePrice: number | null;
unitPrice: number | null;
bonus: number | null;
previousProviderName: string | null;
previousCustomerNumber: string | null;
}) | null;
carInsuranceDetails: {
id: number;
policyNumber: string | null;
vin: string | null;
licensePlate: string | null;
contractId: number;
hsn: string | null;
tsn: string | null;
vehicleType: string | null;
firstRegistration: Date | null;
noClaimsClass: string | null;
insuranceType: import(".prisma/client").$Enums.InsuranceType;
deductiblePartial: number | null;
deductibleFull: number | null;
previousInsurer: string | null;
} | null;
tvDetails: {
id: number;
contractId: number;
receiverModel: string | null;
smartcardNumber: string | null;
package: string | null;
} | null;
mobileDetails: ({
simCards: {
id: number;
createdAt: Date;
updatedAt: Date;
simCardNumber: string | null;
phoneNumber: string | null;
isMain: boolean;
pin: string | null;
puk: string | null;
isMultisim: boolean;
mobileDetailsId: number;
}[];
} & {
id: number;
simCardNumber: string | null;
phoneNumber: string | null;
deviceImei: string | null;
contractId: number;
requiresMultisim: boolean;
dataVolume: number | null;
includedMinutes: number | null;
includedSMS: number | null;
deviceModel: string | null;
}) | null;
internetDetails: ({
phoneNumbers: {
id: number;
phoneNumber: string;
isMain: boolean;
sipUsername: string | null;
sipPasswordEncrypted: string | null;
sipServer: string | null;
internetContractDetailsId: number;
}[];
} & {
id: number;
activationCode: string | null;
homeId: string | null;
routerSerialNumber: string | null;
contractId: number;
downloadSpeed: number | null;
uploadSpeed: number | null;
routerModel: string | null;
installationDate: Date | null;
internetUsername: string | null;
internetPasswordEncrypted: string | null;
}) | null;
} & {
id: number;
customerId: number;
createdAt: Date;
updatedAt: Date;
type: import(".prisma/client").$Enums.ContractType;
notes: string | null;
portalPasswordEncrypted: string | null;
startDate: Date | null;
status: import(".prisma/client").$Enums.ContractStatus;
customerNumberAtProvider: string | null;
tariffName: string | null;
providerName: string | null;
contractNumber: string;
contractCategoryId: number | null;
addressId: number | null;
bankCardId: number | null;
identityDocumentId: number | null;
salesPlatformId: number | null;
cancellationPeriodId: number | null;
contractDurationId: number | null;
previousContractId: number | null;
providerId: number | null;
tariffId: number | null;
priceFirst12Months: string | null;
priceFrom13Months: string | null;
priceAfter24Months: string | null;
endDate: Date | null;
commission: number | null;
cancellationLetterPath: string | null;
cancellationConfirmationPath: string | null;
cancellationLetterOptionsPath: string | null;
cancellationConfirmationOptionsPath: string | null;
cancellationConfirmationDate: Date | null;
cancellationConfirmationOptionsDate: Date | null;
wasSpecialCancellation: boolean;
portalUsername: string | null;
stressfreiEmailId: number | null;
}) | null;
followUpContract: {
id: number;
status: import(".prisma/client").$Enums.ContractStatus;
contractNumber: string;
} | null;
} & {
id: number;
customerId: number;
createdAt: Date;
updatedAt: Date;
type: import(".prisma/client").$Enums.ContractType;
notes: string | null;
portalPasswordEncrypted: string | null;
startDate: Date | null;
status: import(".prisma/client").$Enums.ContractStatus;
customerNumberAtProvider: string | null;
tariffName: string | null;
providerName: string | null;
contractNumber: string;
contractCategoryId: number | null;
addressId: number | null;
bankCardId: number | null;
identityDocumentId: number | null;
salesPlatformId: number | null;
cancellationPeriodId: number | null;
contractDurationId: number | null;
previousContractId: number | null;
providerId: number | null;
tariffId: number | null;
priceFirst12Months: string | null;
priceFrom13Months: string | null;
priceAfter24Months: string | null;
endDate: Date | null;
commission: number | null;
cancellationLetterPath: string | null;
cancellationConfirmationPath: string | null;
cancellationLetterOptionsPath: string | null;
cancellationConfirmationOptionsPath: string | null;
cancellationConfirmationDate: Date | null;
cancellationConfirmationOptionsDate: Date | null;
wasSpecialCancellation: boolean;
portalUsername: string | null;
stressfreiEmailId: number | null;
}) | null>;
export declare function deleteContract(id: number): Promise<{
id: number;
customerId: number;
createdAt: Date;
updatedAt: Date;
type: import(".prisma/client").$Enums.ContractType;
notes: string | null;
portalPasswordEncrypted: string | null;
startDate: Date | null;
status: import(".prisma/client").$Enums.ContractStatus;
customerNumberAtProvider: string | null;
tariffName: string | null;
providerName: string | null;
contractNumber: string;
contractCategoryId: number | null;
addressId: number | null;
bankCardId: number | null;
identityDocumentId: number | null;
salesPlatformId: number | null;
cancellationPeriodId: number | null;
contractDurationId: number | null;
previousContractId: number | null;
providerId: number | null;
tariffId: number | null;
priceFirst12Months: string | null;
priceFrom13Months: string | null;
priceAfter24Months: string | null;
endDate: Date | null;
commission: number | null;
cancellationLetterPath: string | null;
cancellationConfirmationPath: string | null;
cancellationLetterOptionsPath: string | null;
cancellationConfirmationOptionsPath: string | null;
cancellationConfirmationDate: Date | null;
cancellationConfirmationOptionsDate: Date | null;
wasSpecialCancellation: boolean;
portalUsername: string | null;
stressfreiEmailId: number | null;
}>;
export declare function createFollowUpContract(previousContractId: number): Promise<{
customer: {
id: number;
email: string | null;
firstName: string;
lastName: string;
createdAt: Date;
updatedAt: Date;
customerNumber: string;
portalEmail: string | null;
type: import(".prisma/client").$Enums.CustomerType;
salutation: string | null;
companyName: string | null;
foundingDate: Date | null;
birthDate: Date | null;
birthPlace: string | null;
phone: string | null;
mobile: string | null;
taxNumber: string | null;
businessRegistrationPath: string | null;
commercialRegisterPath: string | null;
commercialRegisterNumber: string | null;
privacyPolicyPath: string | null;
notes: string | null;
portalEnabled: boolean;
portalPasswordHash: string | null;
portalPasswordEncrypted: string | null;
portalLastLogin: Date | null;
};
address: {
id: number;
customerId: number;
createdAt: Date;
updatedAt: Date;
type: import(".prisma/client").$Enums.AddressType;
isDefault: boolean;
street: string;
houseNumber: string;
postalCode: string;
city: string;
country: string;
} | null;
salesPlatform: {
id: number;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
name: string;
contactInfo: string | null;
} | null;
energyDetails: {
id: number;
meterId: number | null;
contractId: number;
annualConsumption: number | null;
basePrice: number | null;
unitPrice: number | null;
bonus: number | null;
previousProviderName: string | null;
previousCustomerNumber: string | null;
} | null;
carInsuranceDetails: {
id: number;
policyNumber: string | null;
vin: string | null;
licensePlate: string | null;
contractId: number;
hsn: string | null;
tsn: string | null;
vehicleType: string | null;
firstRegistration: Date | null;
noClaimsClass: string | null;
insuranceType: import(".prisma/client").$Enums.InsuranceType;
deductiblePartial: number | null;
deductibleFull: number | null;
previousInsurer: string | null;
} | null;
tvDetails: {
id: number;
contractId: number;
receiverModel: string | null;
smartcardNumber: string | null;
package: string | null;
} | null;
mobileDetails: ({
simCards: {
id: number;
createdAt: Date;
updatedAt: Date;
simCardNumber: string | null;
phoneNumber: string | null;
isMain: boolean;
pin: string | null;
puk: string | null;
isMultisim: boolean;
mobileDetailsId: number;
}[];
} & {
id: number;
simCardNumber: string | null;
phoneNumber: string | null;
deviceImei: string | null;
contractId: number;
requiresMultisim: boolean;
dataVolume: number | null;
includedMinutes: number | null;
includedSMS: number | null;
deviceModel: string | null;
}) | null;
internetDetails: ({
phoneNumbers: {
id: number;
phoneNumber: string;
isMain: boolean;
sipUsername: string | null;
sipPasswordEncrypted: string | null;
sipServer: string | null;
internetContractDetailsId: number;
}[];
} & {
id: number;
activationCode: string | null;
homeId: string | null;
routerSerialNumber: string | null;
contractId: number;
downloadSpeed: number | null;
uploadSpeed: number | null;
routerModel: string | null;
installationDate: Date | null;
internetUsername: string | null;
internetPasswordEncrypted: string | null;
}) | null;
} & {
id: number;
customerId: number;
createdAt: Date;
updatedAt: Date;
type: import(".prisma/client").$Enums.ContractType;
notes: string | null;
portalPasswordEncrypted: string | null;
startDate: Date | null;
status: import(".prisma/client").$Enums.ContractStatus;
customerNumberAtProvider: string | null;
tariffName: string | null;
providerName: string | null;
contractNumber: string;
contractCategoryId: number | null;
addressId: number | null;
bankCardId: number | null;
identityDocumentId: number | null;
salesPlatformId: number | null;
cancellationPeriodId: number | null;
contractDurationId: number | null;
previousContractId: number | null;
providerId: number | null;
tariffId: number | null;
priceFirst12Months: string | null;
priceFrom13Months: string | null;
priceAfter24Months: string | null;
endDate: Date | null;
commission: number | null;
cancellationLetterPath: string | null;
cancellationConfirmationPath: string | null;
cancellationLetterOptionsPath: string | null;
cancellationConfirmationOptionsPath: string | null;
cancellationConfirmationDate: Date | null;
cancellationConfirmationOptionsDate: Date | null;
wasSpecialCancellation: boolean;
portalUsername: string | null;
stressfreiEmailId: number | null;
}>;
export declare function getContractPassword(id: number): Promise<string | null>;
export declare function getSimCardCredentials(simCardId: number): Promise<{
pin: string | null;
puk: string | null;
}>;
export declare function getInternetCredentials(contractId: number): Promise<{
password: string | null;
}>;
export declare function getSipCredentials(phoneNumberId: number): Promise<{
password: string | null;
}>;
export {};
//# sourceMappingURL=contract.service.d.ts.map