first commit

This commit is contained in:
Stefan Hacker
2026-01-29 01:16:54 +01:00
commit e209e9bbca
12105 changed files with 2480672 additions and 0 deletions
+496
View File
@@ -0,0 +1,496 @@
export interface User {
id: number;
email: string;
firstName: string;
lastName: string;
permissions: string[];
customerId?: number;
roles?: Role[];
isCustomerPortal?: boolean;
representedCustomers?: CustomerSummary[];
}
// Zusammenfassung für Vertreter-Listen
export interface CustomerSummary {
id: number;
customerNumber: string;
firstName: string;
lastName: string;
companyName?: string;
type: 'PRIVATE' | 'BUSINESS';
}
export interface Role {
id: number;
name: string;
description?: string;
}
export interface StressfreiEmail {
id: number;
customerId: number;
email: string;
notes?: string;
isActive: boolean;
createdAt: string;
updatedAt: string;
}
export interface Customer {
id: number;
customerNumber: string;
type: 'PRIVATE' | 'BUSINESS';
salutation?: string;
firstName: string;
lastName: string;
companyName?: string;
foundingDate?: string;
birthDate?: string;
birthPlace?: string;
email?: string;
phone?: string;
mobile?: string;
taxNumber?: string;
businessRegistrationPath?: string;
commercialRegisterPath?: string;
commercialRegisterNumber?: string;
privacyPolicyPath?: string;
notes?: string;
// Portal-Felder
portalEnabled?: boolean;
portalEmail?: string;
portalLastLogin?: string;
addresses?: Address[];
bankCards?: BankCard[];
identityDocuments?: IdentityDocument[];
meters?: Meter[];
stressfreiEmails?: StressfreiEmail[];
contracts?: Contract[];
createdAt: string;
updatedAt: string;
}
// Portal-Einstellungen
export interface PortalSettings {
id: number;
portalEnabled: boolean;
portalEmail?: string;
portalLastLogin?: string;
hasPassword: boolean;
}
// Vertreter-Beziehung
export interface CustomerRepresentative {
id: number;
customerId: number;
customer?: CustomerSummary;
representativeId: number;
representative?: CustomerSummary;
notes?: string;
isActive: boolean;
createdAt: string;
updatedAt: string;
}
export interface Address {
id: number;
customerId: number;
type: 'DELIVERY_RESIDENCE' | 'BILLING';
street: string;
houseNumber: string;
postalCode: string;
city: string;
country: string;
isDefault: boolean;
}
export interface BankCard {
id: number;
customerId: number;
accountHolder: string;
iban: string;
bic?: string;
bankName?: string;
expiryDate?: string;
documentPath?: string;
isActive: boolean;
}
export interface IdentityDocument {
id: number;
customerId: number;
type: 'ID_CARD' | 'PASSPORT' | 'DRIVERS_LICENSE' | 'OTHER';
documentNumber: string;
issuingAuthority?: string;
issueDate?: string;
expiryDate?: string;
documentPath?: string;
isActive: boolean;
// Führerschein-spezifische Felder
licenseClasses?: string;
licenseIssueDate?: string;
}
export interface Meter {
id: number;
customerId: number;
meterNumber: string;
type: 'ELECTRICITY' | 'GAS';
location?: string;
isActive: boolean;
readings?: MeterReading[];
}
export interface MeterReading {
id: number;
meterId: number;
readingDate: string;
value: number;
unit: string;
notes?: string;
}
export type ContractTaskStatus = 'OPEN' | 'COMPLETED';
export interface ContractTaskSubtask {
id: number;
taskId: number;
title: string;
status: ContractTaskStatus;
createdBy?: string;
completedAt?: string;
createdAt: string;
updatedAt: string;
}
export interface ContractTaskContract {
id: number;
contractNumber: string;
customerId: number;
customer?: {
id: number;
firstName: string;
lastName: string;
companyName?: string;
customerNumber: string;
};
provider?: {
id: number;
name: string;
};
tariff?: {
id: number;
name: string;
};
providerName?: string;
tariffName?: string;
}
export interface ContractTask {
id: number;
contractId: number;
title: string;
description?: string;
status: ContractTaskStatus;
visibleInPortal: boolean;
createdBy?: string;
completedAt?: string;
subtasks?: ContractTaskSubtask[];
contract?: ContractTaskContract;
createdAt: string;
updatedAt: string;
}
export interface SalesPlatform {
id: number;
name: string;
contactInfo?: string;
isActive: boolean;
}
export interface CancellationPeriod {
id: number;
code: string;
description: string;
isActive: boolean;
}
export interface ContractDuration {
id: number;
code: string;
description: string;
isActive: boolean;
}
export interface ContractCategory {
id: number;
code: string;
name: string;
icon?: string;
color?: string;
sortOrder: number;
isActive: boolean;
_count?: {
contracts: number;
};
}
export interface Provider {
id: number;
name: string;
portalUrl?: string;
usernameFieldName?: string;
passwordFieldName?: string;
isActive: boolean;
tariffs?: Tariff[];
_count?: {
contracts: number;
tariffs: number;
};
}
export interface Tariff {
id: number;
providerId: number;
provider?: Provider;
name: string;
isActive: boolean;
_count?: {
contracts: number;
};
}
export type ContractType = 'ELECTRICITY' | 'GAS' | 'DSL' | 'CABLE' | 'FIBER' | 'MOBILE' | 'TV' | 'CAR_INSURANCE';
export type ContractStatus = 'DRAFT' | 'PENDING' | 'ACTIVE' | 'CANCELLED' | 'EXPIRED' | 'DEACTIVATED';
export interface Contract {
id: number;
contractNumber: string;
customerId: number;
customer?: Customer;
type: ContractType;
status: ContractStatus;
addressId?: number;
address?: Address;
bankCardId?: number;
bankCard?: BankCard;
identityDocumentId?: number;
identityDocument?: IdentityDocument;
salesPlatformId?: number;
salesPlatform?: SalesPlatform;
previousContractId?: number;
previousContract?: Contract;
providerId?: number;
provider?: Provider;
tariffId?: number;
tariff?: Tariff;
contractCategoryId?: number;
contractCategory?: ContractCategory;
stressfreiEmailId?: number;
stressfreiEmail?: StressfreiEmail;
providerName?: string;
tariffName?: string;
customerNumberAtProvider?: string;
priceFirst12Months?: string;
priceFrom13Months?: string;
priceAfter24Months?: string;
startDate?: string;
endDate?: string;
cancellationPeriodId?: number;
cancellationPeriod?: CancellationPeriod;
contractDurationId?: number;
contractDuration?: ContractDuration;
commission?: number;
portalUsername?: string;
portalPasswordEncrypted?: string;
notes?: string;
// Kündigungsdokumente
cancellationLetterPath?: string;
cancellationConfirmationPath?: string;
cancellationLetterOptionsPath?: string;
cancellationConfirmationOptionsPath?: string;
// Kündigungsdaten
cancellationConfirmationDate?: string;
cancellationConfirmationOptionsDate?: string;
wasSpecialCancellation?: boolean;
energyDetails?: EnergyContractDetails;
internetDetails?: InternetContractDetails;
mobileDetails?: MobileContractDetails;
tvDetails?: TvContractDetails;
carInsuranceDetails?: CarInsuranceDetails;
followUpContract?: {
id: number;
contractNumber: string;
status: ContractStatus;
};
createdAt: string;
updatedAt: string;
}
export interface EnergyContractDetails {
id: number;
contractId: number;
meterId?: number;
meter?: Meter;
annualConsumption?: number;
basePrice?: number;
unitPrice?: number;
bonus?: number;
previousProviderName?: string;
previousCustomerNumber?: string;
}
export interface InternetContractDetails {
id: number;
contractId: number;
downloadSpeed?: number;
uploadSpeed?: number;
routerModel?: string;
routerSerialNumber?: string;
installationDate?: string;
// Internet-Zugangsdaten
internetUsername?: string;
internetPasswordEncrypted?: string;
// Glasfaser-spezifisch
homeId?: string;
// Vodafone DSL/Kabel spezifisch
activationCode?: string;
phoneNumbers?: PhoneNumber[];
}
export interface PhoneNumber {
id: number;
phoneNumber: string;
isMain: boolean;
// SIP-Zugangsdaten
sipUsername?: string;
sipPasswordEncrypted?: string;
sipServer?: string;
}
export interface SimCard {
id: number;
mobileDetailsId: number;
phoneNumber?: string;
simCardNumber?: string;
pin?: string; // verschlüsselt
puk?: string; // verschlüsselt
isMultisim: boolean;
isMain: boolean;
createdAt?: string;
updatedAt?: string;
}
export interface MobileContractDetails {
id: number;
contractId: number;
requiresMultisim?: boolean;
dataVolume?: number;
includedMinutes?: number;
includedSMS?: number;
deviceModel?: string;
deviceImei?: string;
simCards?: SimCard[];
// Legacy-Felder
phoneNumber?: string;
simCardNumber?: string;
}
export interface TvContractDetails {
id: number;
contractId: number;
receiverModel?: string;
smartcardNumber?: string;
package?: string;
}
export interface CarInsuranceDetails {
id: number;
contractId: number;
licensePlate?: string;
hsn?: string;
tsn?: string;
vin?: string;
vehicleType?: string;
firstRegistration?: string;
noClaimsClass?: string;
insuranceType: 'LIABILITY' | 'PARTIAL' | 'FULL';
deductiblePartial?: number;
deductibleFull?: number;
policyNumber?: string;
previousInsurer?: string;
}
export interface ApiResponse<T> {
success: boolean;
data?: T;
message?: string;
error?: string;
pagination?: {
page: number;
limit: number;
total: number;
totalPages: number;
};
}
// ==================== VERTRAGS-COCKPIT ====================
export type CockpitUrgencyLevel = 'critical' | 'warning' | 'ok' | 'none';
export interface CockpitIssue {
type: string;
label: string;
urgency: CockpitUrgencyLevel;
daysRemaining?: number;
details?: string;
}
export interface CockpitContract {
id: number;
contractNumber: string;
type: ContractType;
status: ContractStatus;
customer: {
id: number;
customerNumber: string;
name: string;
};
provider?: {
id: number;
name: string;
};
tariff?: {
id: number;
name: string;
};
providerName?: string;
tariffName?: string;
issues: CockpitIssue[];
highestUrgency: CockpitUrgencyLevel;
}
export interface CockpitSummary {
totalContracts: number;
criticalCount: number;
warningCount: number;
okCount: number;
byCategory: {
cancellationDeadlines: number;
contractEnding: number;
missingCredentials: number;
missingData: number;
openTasks: number;
pendingContracts: number;
};
}
export interface CockpitResult {
contracts: CockpitContract[];
summary: CockpitSummary;
thresholds: {
criticalDays: number;
warningDays: number;
okDays: number;
};
}