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
+1
View File
@@ -0,0 +1 @@
export * from "./index"
+1
View File
@@ -0,0 +1 @@
module.exports = { ...require('.') }
+9
View File
@@ -0,0 +1,9 @@
class PrismaClient {
constructor() {
throw new Error(
'@prisma/client/deno/edge did not initialize yet. Please run "prisma generate" and try to import it again.',
)
}
}
export { PrismaClient }
+1
View File
@@ -0,0 +1 @@
export * from "./default"
+652
View File
File diff suppressed because one or more lines are too long
+644
View File
@@ -0,0 +1,644 @@
Object.defineProperty(exports, "__esModule", { value: true });
const {
Decimal,
objectEnumValues,
makeStrictEnum,
Public,
getRuntime,
skip
} = require('@prisma/client/runtime/index-browser.js')
const Prisma = {}
exports.Prisma = Prisma
exports.$Enums = {}
/**
* Prisma Client JS version: 5.22.0
* Query Engine version: 605197351a3c8bdd595af2d2a9bc3025bca48ea2
*/
Prisma.prismaVersion = {
client: "5.22.0",
engine: "605197351a3c8bdd595af2d2a9bc3025bca48ea2"
}
Prisma.PrismaClientKnownRequestError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`PrismaClientKnownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)};
Prisma.PrismaClientUnknownRequestError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`PrismaClientUnknownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.PrismaClientRustPanicError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`PrismaClientRustPanicError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.PrismaClientInitializationError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`PrismaClientInitializationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.PrismaClientValidationError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`PrismaClientValidationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.NotFoundError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`NotFoundError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.Decimal = Decimal
/**
* Re-export of sql-template-tag
*/
Prisma.sql = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`sqltag is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.empty = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`empty is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.join = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`join is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.raw = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`raw is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.validator = Public.validator
/**
* Extensions
*/
Prisma.getExtensionContext = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`Extensions.getExtensionContext is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.defineExtension = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`Extensions.defineExtension is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
/**
* Shorthand utilities for JSON filtering
*/
Prisma.DbNull = objectEnumValues.instances.DbNull
Prisma.JsonNull = objectEnumValues.instances.JsonNull
Prisma.AnyNull = objectEnumValues.instances.AnyNull
Prisma.NullTypes = {
DbNull: objectEnumValues.classes.DbNull,
JsonNull: objectEnumValues.classes.JsonNull,
AnyNull: objectEnumValues.classes.AnyNull
}
/**
* Enums
*/
exports.Prisma.TransactionIsolationLevel = makeStrictEnum({
ReadUncommitted: 'ReadUncommitted',
ReadCommitted: 'ReadCommitted',
RepeatableRead: 'RepeatableRead',
Serializable: 'Serializable'
});
exports.Prisma.AppSettingScalarFieldEnum = {
id: 'id',
key: 'key',
value: 'value',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.UserScalarFieldEnum = {
id: 'id',
email: 'email',
password: 'password',
firstName: 'firstName',
lastName: 'lastName',
isActive: 'isActive',
customerId: 'customerId',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.RoleScalarFieldEnum = {
id: 'id',
name: 'name',
description: 'description',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.PermissionScalarFieldEnum = {
id: 'id',
resource: 'resource',
action: 'action'
};
exports.Prisma.RolePermissionScalarFieldEnum = {
roleId: 'roleId',
permissionId: 'permissionId'
};
exports.Prisma.UserRoleScalarFieldEnum = {
userId: 'userId',
roleId: 'roleId'
};
exports.Prisma.CustomerScalarFieldEnum = {
id: 'id',
customerNumber: 'customerNumber',
type: 'type',
salutation: 'salutation',
firstName: 'firstName',
lastName: 'lastName',
companyName: 'companyName',
foundingDate: 'foundingDate',
birthDate: 'birthDate',
birthPlace: 'birthPlace',
email: 'email',
phone: 'phone',
mobile: 'mobile',
taxNumber: 'taxNumber',
businessRegistrationPath: 'businessRegistrationPath',
commercialRegisterPath: 'commercialRegisterPath',
commercialRegisterNumber: 'commercialRegisterNumber',
privacyPolicyPath: 'privacyPolicyPath',
notes: 'notes',
portalEnabled: 'portalEnabled',
portalEmail: 'portalEmail',
portalPasswordHash: 'portalPasswordHash',
portalPasswordEncrypted: 'portalPasswordEncrypted',
portalLastLogin: 'portalLastLogin',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.CustomerRepresentativeScalarFieldEnum = {
id: 'id',
customerId: 'customerId',
representativeId: 'representativeId',
notes: 'notes',
isActive: 'isActive',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.AddressScalarFieldEnum = {
id: 'id',
customerId: 'customerId',
type: 'type',
street: 'street',
houseNumber: 'houseNumber',
postalCode: 'postalCode',
city: 'city',
country: 'country',
isDefault: 'isDefault',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.BankCardScalarFieldEnum = {
id: 'id',
customerId: 'customerId',
accountHolder: 'accountHolder',
iban: 'iban',
bic: 'bic',
bankName: 'bankName',
expiryDate: 'expiryDate',
documentPath: 'documentPath',
isActive: 'isActive',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.IdentityDocumentScalarFieldEnum = {
id: 'id',
customerId: 'customerId',
type: 'type',
documentNumber: 'documentNumber',
issuingAuthority: 'issuingAuthority',
issueDate: 'issueDate',
expiryDate: 'expiryDate',
documentPath: 'documentPath',
isActive: 'isActive',
licenseClasses: 'licenseClasses',
licenseIssueDate: 'licenseIssueDate',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.EmailProviderConfigScalarFieldEnum = {
id: 'id',
name: 'name',
type: 'type',
apiUrl: 'apiUrl',
apiKey: 'apiKey',
username: 'username',
passwordEncrypted: 'passwordEncrypted',
domain: 'domain',
defaultForwardEmail: 'defaultForwardEmail',
isActive: 'isActive',
isDefault: 'isDefault',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.StressfreiEmailScalarFieldEnum = {
id: 'id',
customerId: 'customerId',
email: 'email',
platform: 'platform',
notes: 'notes',
isActive: 'isActive',
isProvisioned: 'isProvisioned',
provisionedAt: 'provisionedAt',
provisionError: 'provisionError',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.MeterScalarFieldEnum = {
id: 'id',
customerId: 'customerId',
meterNumber: 'meterNumber',
type: 'type',
location: 'location',
isActive: 'isActive',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.MeterReadingScalarFieldEnum = {
id: 'id',
meterId: 'meterId',
readingDate: 'readingDate',
value: 'value',
unit: 'unit',
notes: 'notes',
createdAt: 'createdAt'
};
exports.Prisma.SalesPlatformScalarFieldEnum = {
id: 'id',
name: 'name',
contactInfo: 'contactInfo',
isActive: 'isActive',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.CancellationPeriodScalarFieldEnum = {
id: 'id',
code: 'code',
description: 'description',
isActive: 'isActive',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.ContractDurationScalarFieldEnum = {
id: 'id',
code: 'code',
description: 'description',
isActive: 'isActive',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.ProviderScalarFieldEnum = {
id: 'id',
name: 'name',
portalUrl: 'portalUrl',
usernameFieldName: 'usernameFieldName',
passwordFieldName: 'passwordFieldName',
isActive: 'isActive',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.TariffScalarFieldEnum = {
id: 'id',
providerId: 'providerId',
name: 'name',
isActive: 'isActive',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.ContractCategoryScalarFieldEnum = {
id: 'id',
code: 'code',
name: 'name',
icon: 'icon',
color: 'color',
sortOrder: 'sortOrder',
isActive: 'isActive',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.ContractScalarFieldEnum = {
id: 'id',
contractNumber: 'contractNumber',
customerId: 'customerId',
type: 'type',
status: 'status',
contractCategoryId: 'contractCategoryId',
addressId: 'addressId',
bankCardId: 'bankCardId',
identityDocumentId: 'identityDocumentId',
salesPlatformId: 'salesPlatformId',
cancellationPeriodId: 'cancellationPeriodId',
contractDurationId: 'contractDurationId',
previousContractId: 'previousContractId',
providerId: 'providerId',
tariffId: 'tariffId',
providerName: 'providerName',
tariffName: 'tariffName',
customerNumberAtProvider: 'customerNumberAtProvider',
priceFirst12Months: 'priceFirst12Months',
priceFrom13Months: 'priceFrom13Months',
priceAfter24Months: 'priceAfter24Months',
startDate: 'startDate',
endDate: 'endDate',
commission: 'commission',
cancellationLetterPath: 'cancellationLetterPath',
cancellationConfirmationPath: 'cancellationConfirmationPath',
cancellationLetterOptionsPath: 'cancellationLetterOptionsPath',
cancellationConfirmationOptionsPath: 'cancellationConfirmationOptionsPath',
cancellationConfirmationDate: 'cancellationConfirmationDate',
cancellationConfirmationOptionsDate: 'cancellationConfirmationOptionsDate',
wasSpecialCancellation: 'wasSpecialCancellation',
portalUsername: 'portalUsername',
portalPasswordEncrypted: 'portalPasswordEncrypted',
stressfreiEmailId: 'stressfreiEmailId',
notes: 'notes',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.ContractTaskScalarFieldEnum = {
id: 'id',
contractId: 'contractId',
title: 'title',
description: 'description',
status: 'status',
visibleInPortal: 'visibleInPortal',
createdBy: 'createdBy',
completedAt: 'completedAt',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.ContractTaskSubtaskScalarFieldEnum = {
id: 'id',
taskId: 'taskId',
title: 'title',
status: 'status',
createdBy: 'createdBy',
completedAt: 'completedAt',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.EnergyContractDetailsScalarFieldEnum = {
id: 'id',
contractId: 'contractId',
meterId: 'meterId',
annualConsumption: 'annualConsumption',
basePrice: 'basePrice',
unitPrice: 'unitPrice',
bonus: 'bonus',
previousProviderName: 'previousProviderName',
previousCustomerNumber: 'previousCustomerNumber'
};
exports.Prisma.InternetContractDetailsScalarFieldEnum = {
id: 'id',
contractId: 'contractId',
downloadSpeed: 'downloadSpeed',
uploadSpeed: 'uploadSpeed',
routerModel: 'routerModel',
routerSerialNumber: 'routerSerialNumber',
installationDate: 'installationDate',
internetUsername: 'internetUsername',
internetPasswordEncrypted: 'internetPasswordEncrypted',
homeId: 'homeId',
activationCode: 'activationCode'
};
exports.Prisma.PhoneNumberScalarFieldEnum = {
id: 'id',
internetContractDetailsId: 'internetContractDetailsId',
phoneNumber: 'phoneNumber',
isMain: 'isMain',
sipUsername: 'sipUsername',
sipPasswordEncrypted: 'sipPasswordEncrypted',
sipServer: 'sipServer'
};
exports.Prisma.MobileContractDetailsScalarFieldEnum = {
id: 'id',
contractId: 'contractId',
requiresMultisim: 'requiresMultisim',
dataVolume: 'dataVolume',
includedMinutes: 'includedMinutes',
includedSMS: 'includedSMS',
deviceModel: 'deviceModel',
deviceImei: 'deviceImei',
phoneNumber: 'phoneNumber',
simCardNumber: 'simCardNumber'
};
exports.Prisma.SimCardScalarFieldEnum = {
id: 'id',
mobileDetailsId: 'mobileDetailsId',
phoneNumber: 'phoneNumber',
simCardNumber: 'simCardNumber',
pin: 'pin',
puk: 'puk',
isMultisim: 'isMultisim',
isMain: 'isMain',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.TvContractDetailsScalarFieldEnum = {
id: 'id',
contractId: 'contractId',
receiverModel: 'receiverModel',
smartcardNumber: 'smartcardNumber',
package: 'package'
};
exports.Prisma.CarInsuranceDetailsScalarFieldEnum = {
id: 'id',
contractId: 'contractId',
licensePlate: 'licensePlate',
hsn: 'hsn',
tsn: 'tsn',
vin: 'vin',
vehicleType: 'vehicleType',
firstRegistration: 'firstRegistration',
noClaimsClass: 'noClaimsClass',
insuranceType: 'insuranceType',
deductiblePartial: 'deductiblePartial',
deductibleFull: 'deductibleFull',
policyNumber: 'policyNumber',
previousInsurer: 'previousInsurer'
};
exports.Prisma.SortOrder = {
asc: 'asc',
desc: 'desc'
};
exports.Prisma.NullsOrder = {
first: 'first',
last: 'last'
};
exports.CustomerType = exports.$Enums.CustomerType = {
PRIVATE: 'PRIVATE',
BUSINESS: 'BUSINESS'
};
exports.AddressType = exports.$Enums.AddressType = {
DELIVERY_RESIDENCE: 'DELIVERY_RESIDENCE',
BILLING: 'BILLING'
};
exports.DocumentType = exports.$Enums.DocumentType = {
ID_CARD: 'ID_CARD',
PASSPORT: 'PASSPORT',
DRIVERS_LICENSE: 'DRIVERS_LICENSE',
OTHER: 'OTHER'
};
exports.EmailProviderType = exports.$Enums.EmailProviderType = {
PLESK: 'PLESK',
CPANEL: 'CPANEL',
DIRECTADMIN: 'DIRECTADMIN'
};
exports.MeterType = exports.$Enums.MeterType = {
ELECTRICITY: 'ELECTRICITY',
GAS: 'GAS'
};
exports.ContractType = exports.$Enums.ContractType = {
ELECTRICITY: 'ELECTRICITY',
GAS: 'GAS',
DSL: 'DSL',
CABLE: 'CABLE',
FIBER: 'FIBER',
MOBILE: 'MOBILE',
TV: 'TV',
CAR_INSURANCE: 'CAR_INSURANCE'
};
exports.ContractStatus = exports.$Enums.ContractStatus = {
DRAFT: 'DRAFT',
PENDING: 'PENDING',
ACTIVE: 'ACTIVE',
CANCELLED: 'CANCELLED',
EXPIRED: 'EXPIRED',
DEACTIVATED: 'DEACTIVATED'
};
exports.ContractTaskStatus = exports.$Enums.ContractTaskStatus = {
OPEN: 'OPEN',
COMPLETED: 'COMPLETED'
};
exports.InsuranceType = exports.$Enums.InsuranceType = {
LIABILITY: 'LIABILITY',
PARTIAL: 'PARTIAL',
FULL: 'FULL'
};
exports.Prisma.ModelName = {
AppSetting: 'AppSetting',
User: 'User',
Role: 'Role',
Permission: 'Permission',
RolePermission: 'RolePermission',
UserRole: 'UserRole',
Customer: 'Customer',
CustomerRepresentative: 'CustomerRepresentative',
Address: 'Address',
BankCard: 'BankCard',
IdentityDocument: 'IdentityDocument',
EmailProviderConfig: 'EmailProviderConfig',
StressfreiEmail: 'StressfreiEmail',
Meter: 'Meter',
MeterReading: 'MeterReading',
SalesPlatform: 'SalesPlatform',
CancellationPeriod: 'CancellationPeriod',
ContractDuration: 'ContractDuration',
Provider: 'Provider',
Tariff: 'Tariff',
ContractCategory: 'ContractCategory',
Contract: 'Contract',
ContractTask: 'ContractTask',
ContractTaskSubtask: 'ContractTaskSubtask',
EnergyContractDetails: 'EnergyContractDetails',
InternetContractDetails: 'InternetContractDetails',
PhoneNumber: 'PhoneNumber',
MobileContractDetails: 'MobileContractDetails',
SimCard: 'SimCard',
TvContractDetails: 'TvContractDetails',
CarInsuranceDetails: 'CarInsuranceDetails'
};
/**
* This is a stub Prisma Client that will error at runtime if called.
*/
class PrismaClient {
constructor() {
return new Proxy(this, {
get(target, prop) {
let message
const runtime = getRuntime()
if (runtime.isEdge) {
message = `PrismaClient is not configured to run in ${runtime.prettyName}. In order to run Prisma Client on edge runtime, either:
- Use Prisma Accelerate: https://pris.ly/d/accelerate
- Use Driver Adapters: https://pris.ly/d/driver-adapters
`;
} else {
message = 'PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in `' + runtime.prettyName + '`).'
}
message += `
If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report`
throw new Error(message)
}
})
}
}
exports.PrismaClient = PrismaClient
Object.assign(exports, Prisma)
+55487
View File
File diff suppressed because it is too large Load Diff
+673
View File
File diff suppressed because one or more lines are too long
Binary file not shown.
+97
View File
@@ -0,0 +1,97 @@
{
"name": "prisma-client-f3be941c86c0d933a2a09d69aafc49ad121411869df4ce4f365fdf53679b90db",
"main": "index.js",
"types": "index.d.ts",
"browser": "index-browser.js",
"exports": {
"./package.json": "./package.json",
".": {
"require": {
"node": "./index.js",
"edge-light": "./wasm.js",
"workerd": "./wasm.js",
"worker": "./wasm.js",
"browser": "./index-browser.js",
"default": "./index.js"
},
"import": {
"node": "./index.js",
"edge-light": "./wasm.js",
"workerd": "./wasm.js",
"worker": "./wasm.js",
"browser": "./index-browser.js",
"default": "./index.js"
},
"default": "./index.js"
},
"./edge": {
"types": "./edge.d.ts",
"require": "./edge.js",
"import": "./edge.js",
"default": "./edge.js"
},
"./react-native": {
"types": "./react-native.d.ts",
"require": "./react-native.js",
"import": "./react-native.js",
"default": "./react-native.js"
},
"./extension": {
"types": "./extension.d.ts",
"require": "./extension.js",
"import": "./extension.js",
"default": "./extension.js"
},
"./index-browser": {
"types": "./index.d.ts",
"require": "./index-browser.js",
"import": "./index-browser.js",
"default": "./index-browser.js"
},
"./index": {
"types": "./index.d.ts",
"require": "./index.js",
"import": "./index.js",
"default": "./index.js"
},
"./wasm": {
"types": "./wasm.d.ts",
"require": "./wasm.js",
"import": "./wasm.js",
"default": "./wasm.js"
},
"./runtime/library": {
"types": "./runtime/library.d.ts",
"require": "./runtime/library.js",
"import": "./runtime/library.js",
"default": "./runtime/library.js"
},
"./runtime/binary": {
"types": "./runtime/binary.d.ts",
"require": "./runtime/binary.js",
"import": "./runtime/binary.js",
"default": "./runtime/binary.js"
},
"./generator-build": {
"require": "./generator-build/index.js",
"import": "./generator-build/index.js",
"default": "./generator-build/index.js"
},
"./sql": {
"require": {
"types": "./sql.d.ts",
"node": "./sql.js",
"default": "./sql.js"
},
"import": {
"types": "./sql.d.ts",
"node": "./sql.mjs",
"default": "./sql.mjs"
},
"default": "./sql.js"
},
"./*": "./*"
},
"version": "5.22.0",
"sideEffects": false
}
+623
View File
@@ -0,0 +1,623 @@
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
}
// ==================== APP SETTINGS ====================
model AppSetting {
id Int @id @default(autoincrement())
key String @unique
value String @db.Text
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
// ==================== USERS & AUTH ====================
model User {
id Int @id @default(autoincrement())
email String @unique
password String
firstName String
lastName String
isActive Boolean @default(true)
customerId Int? @unique
customer Customer? @relation(fields: [customerId], references: [id])
roles UserRole[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Role {
id Int @id @default(autoincrement())
name String @unique
description String?
permissions RolePermission[]
users UserRole[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Permission {
id Int @id @default(autoincrement())
resource String
action String
roles RolePermission[]
@@unique([resource, action])
}
model RolePermission {
roleId Int
permissionId Int
role Role @relation(fields: [roleId], references: [id], onDelete: Cascade)
permission Permission @relation(fields: [permissionId], references: [id], onDelete: Cascade)
@@id([roleId, permissionId])
}
model UserRole {
userId Int
roleId Int
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
role Role @relation(fields: [roleId], references: [id], onDelete: Cascade)
@@id([userId, roleId])
}
// ==================== CUSTOMERS ====================
enum CustomerType {
PRIVATE
BUSINESS
}
model Customer {
id Int @id @default(autoincrement())
customerNumber String @unique
type CustomerType @default(PRIVATE)
salutation String?
firstName String
lastName String
companyName String?
foundingDate DateTime? // Gründungsdatum (für Firmen)
birthDate DateTime?
birthPlace String?
email String?
phone String?
mobile String?
taxNumber String?
businessRegistrationPath String? // PDF-Pfad zur Gewerbeanmeldung
commercialRegisterPath String? // PDF-Pfad zum Handelsregisterauszug
commercialRegisterNumber String? // Handelsregisternummer (Text)
privacyPolicyPath String? // PDF-Pfad zur Datenschutzerklärung (für alle Kunden)
notes String? @db.Text
// ===== Portal-Zugangsdaten =====
portalEnabled Boolean @default(false) // Portal aktiviert?
portalEmail String? @unique // Portal-Login E-Mail
portalPasswordHash String? // Gehashtes Passwort (für Login)
portalPasswordEncrypted String? // Verschlüsseltes Passwort (für Anzeige)
portalLastLogin DateTime? // Letzte Anmeldung
user User?
addresses Address[]
bankCards BankCard[]
identityDocuments IdentityDocument[]
meters Meter[]
stressfreiEmails StressfreiEmail[]
contracts Contract[]
// Vertreter-Beziehungen (Kunde kann für andere Kunden handeln)
representingFor CustomerRepresentative[] @relation("RepresentativeCustomer")
representedBy CustomerRepresentative[] @relation("RepresentedCustomer")
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
// ==================== CUSTOMER REPRESENTATIVES ====================
// Vertretungsbeziehung: Ein Kunde kann die Verträge eines anderen Kunden einsehen
// z.B. Sohn (representativeId) kann Verträge der Mutter (customerId) sehen
model CustomerRepresentative {
id Int @id @default(autoincrement())
customerId Int // Der Kunde, dessen Verträge eingesehen werden (z.B. Mutter)
customer Customer @relation("RepresentedCustomer", fields: [customerId], references: [id], onDelete: Cascade)
representativeId Int // Der Kunde, der einsehen darf (z.B. Sohn)
representative Customer @relation("RepresentativeCustomer", fields: [representativeId], references: [id], onDelete: Cascade)
notes String? // Notizen zur Vertretung
isActive Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@unique([customerId, representativeId]) // Keine doppelten Einträge
}
// ==================== ADDRESSES ====================
enum AddressType {
DELIVERY_RESIDENCE
BILLING
}
model Address {
id Int @id @default(autoincrement())
customerId Int
customer Customer @relation(fields: [customerId], references: [id], onDelete: Cascade)
type AddressType @default(DELIVERY_RESIDENCE)
street String
houseNumber String
postalCode String
city String
country String @default("Deutschland")
isDefault Boolean @default(false)
contracts Contract[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
// ==================== BANK CARDS ====================
model BankCard {
id Int @id @default(autoincrement())
customerId Int
customer Customer @relation(fields: [customerId], references: [id], onDelete: Cascade)
accountHolder String
iban String
bic String?
bankName String?
expiryDate DateTime?
documentPath String? // Pfad zur hochgeladenen PDF
isActive Boolean @default(true)
contracts Contract[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
// ==================== IDENTITY DOCUMENTS ====================
enum DocumentType {
ID_CARD
PASSPORT
DRIVERS_LICENSE
OTHER
}
model IdentityDocument {
id Int @id @default(autoincrement())
customerId Int
customer Customer @relation(fields: [customerId], references: [id], onDelete: Cascade)
type DocumentType @default(ID_CARD)
documentNumber String
issuingAuthority String?
issueDate DateTime?
expiryDate DateTime?
documentPath String? // Pfad zur hochgeladenen PDF
isActive Boolean @default(true)
// Führerschein-spezifische Felder
licenseClasses String? // z.B. "B, BE, AM, L" - kommasepariert
licenseIssueDate DateTime? // Datum des Führerscheinerwerbs (Klasse B)
contracts Contract[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
// ==================== EMAIL PROVIDER CONFIG (Plesk, cPanel etc.) ====================
enum EmailProviderType {
PLESK
CPANEL
DIRECTADMIN
}
model EmailProviderConfig {
id Int @id @default(autoincrement())
name String @unique // z.B. "Plesk Hauptserver"
type EmailProviderType
apiUrl String // API-URL (z.B. https://server.de:8443)
apiKey String? // API-Key (verschlüsselt)
username String? // Benutzername für API
passwordEncrypted String? // Passwort (verschlüsselt)
domain String // Domain für E-Mails (z.B. stressfrei-wechseln.de)
defaultForwardEmail String? // Standard-Weiterleitungsadresse (unsere eigene)
isActive Boolean @default(true)
isDefault Boolean @default(false) // Standard-Provider
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
// ==================== STRESSFREI-WECHSELN EMAIL ADDRESSES ====================
model StressfreiEmail {
id Int @id @default(autoincrement())
customerId Int
customer Customer @relation(fields: [customerId], references: [id], onDelete: Cascade)
email String // Die Weiterleitungs-E-Mail-Adresse
platform String? // Für welche Plattform (z.B. "Freenet", "Klarmobil")
notes String? @db.Text // Optionale Notizen
isActive Boolean @default(true)
isProvisioned Boolean @default(false) // Wurde bei Provider angelegt?
provisionedAt DateTime? // Wann wurde provisioniert?
provisionError String? @db.Text // Fehlermeldung falls Provisionierung fehlschlug
contracts Contract[] // Verträge die diese E-Mail als Benutzername verwenden
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
// ==================== METERS (Energy) ====================
enum MeterType {
ELECTRICITY
GAS
}
model Meter {
id Int @id @default(autoincrement())
customerId Int
customer Customer @relation(fields: [customerId], references: [id], onDelete: Cascade)
meterNumber String
type MeterType
location String?
isActive Boolean @default(true)
readings MeterReading[]
energyDetails EnergyContractDetails[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model MeterReading {
id Int @id @default(autoincrement())
meterId Int
meter Meter @relation(fields: [meterId], references: [id], onDelete: Cascade)
readingDate DateTime
value Float
unit String @default("kWh")
notes String?
createdAt DateTime @default(now())
}
// ==================== SALES PLATFORMS ====================
model SalesPlatform {
id Int @id @default(autoincrement())
name String @unique
contactInfo String? @db.Text
isActive Boolean @default(true)
contracts Contract[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
// ==================== CANCELLATION PERIODS ====================
model CancellationPeriod {
id Int @id @default(autoincrement())
code String @unique // z.B. "14T", "1M", "3M", "12M", "1J"
description String // z.B. "14 Tage", "1 Monat", "3 Monate"
isActive Boolean @default(true)
contracts Contract[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
// ==================== CONTRACT DURATIONS ====================
model ContractDuration {
id Int @id @default(autoincrement())
code String @unique // z.B. "12M", "24M", "1J", "2J"
description String // z.B. "12 Monate", "24 Monate", "1 Jahr"
isActive Boolean @default(true)
contracts Contract[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
// ==================== PROVIDERS (Anbieter) ====================
model Provider {
id Int @id @default(autoincrement())
name String @unique // Anbietername
portalUrl String? // Kundenkontourl (Login-Seite)
usernameFieldName String? // Benutzernamefeld (z.B. "email", "username")
passwordFieldName String? // Kennwortfeld (z.B. "password", "pwd")
isActive Boolean @default(true)
tariffs Tariff[]
contracts Contract[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
// ==================== TARIFFS (Tarife) ====================
model Tariff {
id Int @id @default(autoincrement())
providerId Int
provider Provider @relation(fields: [providerId], references: [id], onDelete: Cascade)
name String // Tarifname
isActive Boolean @default(true)
contracts Contract[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@unique([providerId, name]) // Eindeutiger Tarif pro Anbieter
}
// ==================== CONTRACT CATEGORIES ====================
model ContractCategory {
id Int @id @default(autoincrement())
code String @unique // Technischer Code (z.B. ELECTRICITY, GAS)
name String // Anzeigename (z.B. Strom, Gas)
icon String? // Icon-Name für UI (z.B. "Zap", "Flame")
color String? // Farbe für UI (z.B. "#FFC107")
sortOrder Int @default(0)
isActive Boolean @default(true)
contracts Contract[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
// ==================== CONTRACTS ====================
// Legacy Enum - wird durch ContractCategory ersetzt
enum ContractType {
ELECTRICITY
GAS
DSL
CABLE
FIBER
MOBILE
TV
CAR_INSURANCE
}
enum ContractStatus {
DRAFT
PENDING
ACTIVE
CANCELLED
EXPIRED
DEACTIVATED
}
model Contract {
id Int @id @default(autoincrement())
contractNumber String @unique
customerId Int
customer Customer @relation(fields: [customerId], references: [id], onDelete: Cascade)
type ContractType
status ContractStatus @default(DRAFT)
// Neue konfigurierbare Kategorie (ersetzt langfristig das type-Enum)
contractCategoryId Int?
contractCategory ContractCategory? @relation(fields: [contractCategoryId], references: [id])
addressId Int?
address Address? @relation(fields: [addressId], references: [id])
bankCardId Int?
bankCard BankCard? @relation(fields: [bankCardId], references: [id])
identityDocumentId Int?
identityDocument IdentityDocument? @relation(fields: [identityDocumentId], references: [id])
salesPlatformId Int?
salesPlatform SalesPlatform? @relation(fields: [salesPlatformId], references: [id])
cancellationPeriodId Int?
cancellationPeriod CancellationPeriod? @relation(fields: [cancellationPeriodId], references: [id])
contractDurationId Int?
contractDuration ContractDuration? @relation(fields: [contractDurationId], references: [id])
previousContractId Int? @unique
previousContract Contract? @relation("ContractHistory", fields: [previousContractId], references: [id])
followUpContract Contract? @relation("ContractHistory")
// Anbieter & Tarif (neue Verknüpfung)
providerId Int?
provider Provider? @relation(fields: [providerId], references: [id])
tariffId Int?
tariff Tariff? @relation(fields: [tariffId], references: [id])
// Legacy-Felder (für Abwärtskompatibilität)
providerName String?
tariffName String?
customerNumberAtProvider String?
priceFirst12Months String? // Preis erste 12 Monate
priceFrom13Months String? // Preis ab 13. Monat
priceAfter24Months String? // Preis nach 24 Monaten
startDate DateTime?
endDate DateTime? // Wird aus startDate + contractDuration berechnet
commission Float?
// Kündigungsdokumente
cancellationLetterPath String? // Kündigungsschreiben PDF
cancellationConfirmationPath String? // Kündigungsbestätigung PDF
cancellationLetterOptionsPath String? // Kündigungsschreiben Optionen PDF
cancellationConfirmationOptionsPath String? // Kündigungsbestätigung Optionen PDF
// Kündigungsdaten
cancellationConfirmationDate DateTime? // Kündigungsbestätigungsdatum
cancellationConfirmationOptionsDate DateTime? // Kündigungsbestätigungsoptionendatum
wasSpecialCancellation Boolean @default(false) // Wurde sondergekündigt?
portalUsername String?
portalPasswordEncrypted String?
// Stressfrei-Wechseln E-Mail als Benutzername (Alternative zu portalUsername)
stressfreiEmailId Int?
stressfreiEmail StressfreiEmail? @relation(fields: [stressfreiEmailId], references: [id])
notes String? @db.Text
energyDetails EnergyContractDetails?
internetDetails InternetContractDetails?
mobileDetails MobileContractDetails?
tvDetails TvContractDetails?
carInsuranceDetails CarInsuranceDetails?
tasks ContractTask[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
// ==================== CONTRACT TASKS ====================
enum ContractTaskStatus {
OPEN
COMPLETED
}
model ContractTask {
id Int @id @default(autoincrement())
contractId Int
contract Contract @relation(fields: [contractId], references: [id], onDelete: Cascade)
title String
description String? @db.Text
status ContractTaskStatus @default(OPEN)
visibleInPortal Boolean @default(false)
createdBy String? // Name des Erstellers
completedAt DateTime?
subtasks ContractTaskSubtask[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model ContractTaskSubtask {
id Int @id @default(autoincrement())
taskId Int
task ContractTask @relation(fields: [taskId], references: [id], onDelete: Cascade)
title String
status ContractTaskStatus @default(OPEN)
createdBy String?
completedAt DateTime?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
// ==================== ENERGY CONTRACT DETAILS ====================
model EnergyContractDetails {
id Int @id @default(autoincrement())
contractId Int @unique
contract Contract @relation(fields: [contractId], references: [id], onDelete: Cascade)
meterId Int?
meter Meter? @relation(fields: [meterId], references: [id])
annualConsumption Float?
basePrice Float?
unitPrice Float?
bonus Float?
previousProviderName String?
previousCustomerNumber String?
}
// ==================== INTERNET CONTRACT DETAILS ====================
model InternetContractDetails {
id Int @id @default(autoincrement())
contractId Int @unique
contract Contract @relation(fields: [contractId], references: [id], onDelete: Cascade)
downloadSpeed Int?
uploadSpeed Int?
routerModel String?
routerSerialNumber String?
installationDate DateTime?
// Internet-Zugangsdaten
internetUsername String?
internetPasswordEncrypted String? // Verschlüsselt gespeichert
// Glasfaser-spezifisch
homeId String?
// Vodafone DSL/Kabel spezifisch
activationCode String?
phoneNumbers PhoneNumber[]
}
model PhoneNumber {
id Int @id @default(autoincrement())
internetContractDetailsId Int
internetDetails InternetContractDetails @relation(fields: [internetContractDetailsId], references: [id], onDelete: Cascade)
phoneNumber String
isMain Boolean @default(false)
// SIP-Zugangsdaten
sipUsername String?
sipPasswordEncrypted String? // Verschlüsselt gespeichert
sipServer String?
}
// ==================== MOBILE CONTRACT DETAILS ====================
model MobileContractDetails {
id Int @id @default(autoincrement())
contractId Int @unique
contract Contract @relation(fields: [contractId], references: [id], onDelete: Cascade)
requiresMultisim Boolean @default(false) // Multisim erforderlich?
dataVolume Float?
includedMinutes Int?
includedSMS Int?
deviceModel String?
deviceImei String?
simCards SimCard[]
// Legacy-Felder (für Abwärtskompatibilität, werden durch simCards ersetzt)
phoneNumber String?
simCardNumber String?
}
model SimCard {
id Int @id @default(autoincrement())
mobileDetailsId Int
mobileDetails MobileContractDetails @relation(fields: [mobileDetailsId], references: [id], onDelete: Cascade)
phoneNumber String? // Rufnummer
simCardNumber String? // SIM-Kartennummer
pin String? // PIN (verschlüsselt gespeichert)
puk String? // PUK (verschlüsselt gespeichert)
isMultisim Boolean @default(false) // Ist dies eine Multisim-Karte?
isMain Boolean @default(false) // Ist dies die Hauptkarte?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
// ==================== TV CONTRACT DETAILS ====================
model TvContractDetails {
id Int @id @default(autoincrement())
contractId Int @unique
contract Contract @relation(fields: [contractId], references: [id], onDelete: Cascade)
receiverModel String?
smartcardNumber String?
package String?
}
// ==================== CAR INSURANCE DETAILS ====================
enum InsuranceType {
LIABILITY
PARTIAL
FULL
}
model CarInsuranceDetails {
id Int @id @default(autoincrement())
contractId Int @unique
contract Contract @relation(fields: [contractId], references: [id], onDelete: Cascade)
licensePlate String?
hsn String?
tsn String?
vin String?
vehicleType String?
firstRegistration DateTime?
noClaimsClass String?
insuranceType InsuranceType @default(LIABILITY)
deductiblePartial Float?
deductibleFull Float?
policyNumber String?
previousInsurer String?
}
+1
View File
@@ -0,0 +1 @@
export * from "./index"
+644
View File
@@ -0,0 +1,644 @@
Object.defineProperty(exports, "__esModule", { value: true });
const {
Decimal,
objectEnumValues,
makeStrictEnum,
Public,
getRuntime,
skip
} = require('@prisma/client/runtime/index-browser.js')
const Prisma = {}
exports.Prisma = Prisma
exports.$Enums = {}
/**
* Prisma Client JS version: 5.22.0
* Query Engine version: 605197351a3c8bdd595af2d2a9bc3025bca48ea2
*/
Prisma.prismaVersion = {
client: "5.22.0",
engine: "605197351a3c8bdd595af2d2a9bc3025bca48ea2"
}
Prisma.PrismaClientKnownRequestError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`PrismaClientKnownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)};
Prisma.PrismaClientUnknownRequestError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`PrismaClientUnknownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.PrismaClientRustPanicError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`PrismaClientRustPanicError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.PrismaClientInitializationError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`PrismaClientInitializationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.PrismaClientValidationError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`PrismaClientValidationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.NotFoundError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`NotFoundError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.Decimal = Decimal
/**
* Re-export of sql-template-tag
*/
Prisma.sql = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`sqltag is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.empty = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`empty is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.join = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`join is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.raw = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`raw is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.validator = Public.validator
/**
* Extensions
*/
Prisma.getExtensionContext = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`Extensions.getExtensionContext is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.defineExtension = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`Extensions.defineExtension is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
/**
* Shorthand utilities for JSON filtering
*/
Prisma.DbNull = objectEnumValues.instances.DbNull
Prisma.JsonNull = objectEnumValues.instances.JsonNull
Prisma.AnyNull = objectEnumValues.instances.AnyNull
Prisma.NullTypes = {
DbNull: objectEnumValues.classes.DbNull,
JsonNull: objectEnumValues.classes.JsonNull,
AnyNull: objectEnumValues.classes.AnyNull
}
/**
* Enums
*/
exports.Prisma.TransactionIsolationLevel = makeStrictEnum({
ReadUncommitted: 'ReadUncommitted',
ReadCommitted: 'ReadCommitted',
RepeatableRead: 'RepeatableRead',
Serializable: 'Serializable'
});
exports.Prisma.AppSettingScalarFieldEnum = {
id: 'id',
key: 'key',
value: 'value',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.UserScalarFieldEnum = {
id: 'id',
email: 'email',
password: 'password',
firstName: 'firstName',
lastName: 'lastName',
isActive: 'isActive',
customerId: 'customerId',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.RoleScalarFieldEnum = {
id: 'id',
name: 'name',
description: 'description',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.PermissionScalarFieldEnum = {
id: 'id',
resource: 'resource',
action: 'action'
};
exports.Prisma.RolePermissionScalarFieldEnum = {
roleId: 'roleId',
permissionId: 'permissionId'
};
exports.Prisma.UserRoleScalarFieldEnum = {
userId: 'userId',
roleId: 'roleId'
};
exports.Prisma.CustomerScalarFieldEnum = {
id: 'id',
customerNumber: 'customerNumber',
type: 'type',
salutation: 'salutation',
firstName: 'firstName',
lastName: 'lastName',
companyName: 'companyName',
foundingDate: 'foundingDate',
birthDate: 'birthDate',
birthPlace: 'birthPlace',
email: 'email',
phone: 'phone',
mobile: 'mobile',
taxNumber: 'taxNumber',
businessRegistrationPath: 'businessRegistrationPath',
commercialRegisterPath: 'commercialRegisterPath',
commercialRegisterNumber: 'commercialRegisterNumber',
privacyPolicyPath: 'privacyPolicyPath',
notes: 'notes',
portalEnabled: 'portalEnabled',
portalEmail: 'portalEmail',
portalPasswordHash: 'portalPasswordHash',
portalPasswordEncrypted: 'portalPasswordEncrypted',
portalLastLogin: 'portalLastLogin',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.CustomerRepresentativeScalarFieldEnum = {
id: 'id',
customerId: 'customerId',
representativeId: 'representativeId',
notes: 'notes',
isActive: 'isActive',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.AddressScalarFieldEnum = {
id: 'id',
customerId: 'customerId',
type: 'type',
street: 'street',
houseNumber: 'houseNumber',
postalCode: 'postalCode',
city: 'city',
country: 'country',
isDefault: 'isDefault',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.BankCardScalarFieldEnum = {
id: 'id',
customerId: 'customerId',
accountHolder: 'accountHolder',
iban: 'iban',
bic: 'bic',
bankName: 'bankName',
expiryDate: 'expiryDate',
documentPath: 'documentPath',
isActive: 'isActive',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.IdentityDocumentScalarFieldEnum = {
id: 'id',
customerId: 'customerId',
type: 'type',
documentNumber: 'documentNumber',
issuingAuthority: 'issuingAuthority',
issueDate: 'issueDate',
expiryDate: 'expiryDate',
documentPath: 'documentPath',
isActive: 'isActive',
licenseClasses: 'licenseClasses',
licenseIssueDate: 'licenseIssueDate',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.EmailProviderConfigScalarFieldEnum = {
id: 'id',
name: 'name',
type: 'type',
apiUrl: 'apiUrl',
apiKey: 'apiKey',
username: 'username',
passwordEncrypted: 'passwordEncrypted',
domain: 'domain',
defaultForwardEmail: 'defaultForwardEmail',
isActive: 'isActive',
isDefault: 'isDefault',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.StressfreiEmailScalarFieldEnum = {
id: 'id',
customerId: 'customerId',
email: 'email',
platform: 'platform',
notes: 'notes',
isActive: 'isActive',
isProvisioned: 'isProvisioned',
provisionedAt: 'provisionedAt',
provisionError: 'provisionError',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.MeterScalarFieldEnum = {
id: 'id',
customerId: 'customerId',
meterNumber: 'meterNumber',
type: 'type',
location: 'location',
isActive: 'isActive',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.MeterReadingScalarFieldEnum = {
id: 'id',
meterId: 'meterId',
readingDate: 'readingDate',
value: 'value',
unit: 'unit',
notes: 'notes',
createdAt: 'createdAt'
};
exports.Prisma.SalesPlatformScalarFieldEnum = {
id: 'id',
name: 'name',
contactInfo: 'contactInfo',
isActive: 'isActive',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.CancellationPeriodScalarFieldEnum = {
id: 'id',
code: 'code',
description: 'description',
isActive: 'isActive',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.ContractDurationScalarFieldEnum = {
id: 'id',
code: 'code',
description: 'description',
isActive: 'isActive',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.ProviderScalarFieldEnum = {
id: 'id',
name: 'name',
portalUrl: 'portalUrl',
usernameFieldName: 'usernameFieldName',
passwordFieldName: 'passwordFieldName',
isActive: 'isActive',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.TariffScalarFieldEnum = {
id: 'id',
providerId: 'providerId',
name: 'name',
isActive: 'isActive',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.ContractCategoryScalarFieldEnum = {
id: 'id',
code: 'code',
name: 'name',
icon: 'icon',
color: 'color',
sortOrder: 'sortOrder',
isActive: 'isActive',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.ContractScalarFieldEnum = {
id: 'id',
contractNumber: 'contractNumber',
customerId: 'customerId',
type: 'type',
status: 'status',
contractCategoryId: 'contractCategoryId',
addressId: 'addressId',
bankCardId: 'bankCardId',
identityDocumentId: 'identityDocumentId',
salesPlatformId: 'salesPlatformId',
cancellationPeriodId: 'cancellationPeriodId',
contractDurationId: 'contractDurationId',
previousContractId: 'previousContractId',
providerId: 'providerId',
tariffId: 'tariffId',
providerName: 'providerName',
tariffName: 'tariffName',
customerNumberAtProvider: 'customerNumberAtProvider',
priceFirst12Months: 'priceFirst12Months',
priceFrom13Months: 'priceFrom13Months',
priceAfter24Months: 'priceAfter24Months',
startDate: 'startDate',
endDate: 'endDate',
commission: 'commission',
cancellationLetterPath: 'cancellationLetterPath',
cancellationConfirmationPath: 'cancellationConfirmationPath',
cancellationLetterOptionsPath: 'cancellationLetterOptionsPath',
cancellationConfirmationOptionsPath: 'cancellationConfirmationOptionsPath',
cancellationConfirmationDate: 'cancellationConfirmationDate',
cancellationConfirmationOptionsDate: 'cancellationConfirmationOptionsDate',
wasSpecialCancellation: 'wasSpecialCancellation',
portalUsername: 'portalUsername',
portalPasswordEncrypted: 'portalPasswordEncrypted',
stressfreiEmailId: 'stressfreiEmailId',
notes: 'notes',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.ContractTaskScalarFieldEnum = {
id: 'id',
contractId: 'contractId',
title: 'title',
description: 'description',
status: 'status',
visibleInPortal: 'visibleInPortal',
createdBy: 'createdBy',
completedAt: 'completedAt',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.ContractTaskSubtaskScalarFieldEnum = {
id: 'id',
taskId: 'taskId',
title: 'title',
status: 'status',
createdBy: 'createdBy',
completedAt: 'completedAt',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.EnergyContractDetailsScalarFieldEnum = {
id: 'id',
contractId: 'contractId',
meterId: 'meterId',
annualConsumption: 'annualConsumption',
basePrice: 'basePrice',
unitPrice: 'unitPrice',
bonus: 'bonus',
previousProviderName: 'previousProviderName',
previousCustomerNumber: 'previousCustomerNumber'
};
exports.Prisma.InternetContractDetailsScalarFieldEnum = {
id: 'id',
contractId: 'contractId',
downloadSpeed: 'downloadSpeed',
uploadSpeed: 'uploadSpeed',
routerModel: 'routerModel',
routerSerialNumber: 'routerSerialNumber',
installationDate: 'installationDate',
internetUsername: 'internetUsername',
internetPasswordEncrypted: 'internetPasswordEncrypted',
homeId: 'homeId',
activationCode: 'activationCode'
};
exports.Prisma.PhoneNumberScalarFieldEnum = {
id: 'id',
internetContractDetailsId: 'internetContractDetailsId',
phoneNumber: 'phoneNumber',
isMain: 'isMain',
sipUsername: 'sipUsername',
sipPasswordEncrypted: 'sipPasswordEncrypted',
sipServer: 'sipServer'
};
exports.Prisma.MobileContractDetailsScalarFieldEnum = {
id: 'id',
contractId: 'contractId',
requiresMultisim: 'requiresMultisim',
dataVolume: 'dataVolume',
includedMinutes: 'includedMinutes',
includedSMS: 'includedSMS',
deviceModel: 'deviceModel',
deviceImei: 'deviceImei',
phoneNumber: 'phoneNumber',
simCardNumber: 'simCardNumber'
};
exports.Prisma.SimCardScalarFieldEnum = {
id: 'id',
mobileDetailsId: 'mobileDetailsId',
phoneNumber: 'phoneNumber',
simCardNumber: 'simCardNumber',
pin: 'pin',
puk: 'puk',
isMultisim: 'isMultisim',
isMain: 'isMain',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.TvContractDetailsScalarFieldEnum = {
id: 'id',
contractId: 'contractId',
receiverModel: 'receiverModel',
smartcardNumber: 'smartcardNumber',
package: 'package'
};
exports.Prisma.CarInsuranceDetailsScalarFieldEnum = {
id: 'id',
contractId: 'contractId',
licensePlate: 'licensePlate',
hsn: 'hsn',
tsn: 'tsn',
vin: 'vin',
vehicleType: 'vehicleType',
firstRegistration: 'firstRegistration',
noClaimsClass: 'noClaimsClass',
insuranceType: 'insuranceType',
deductiblePartial: 'deductiblePartial',
deductibleFull: 'deductibleFull',
policyNumber: 'policyNumber',
previousInsurer: 'previousInsurer'
};
exports.Prisma.SortOrder = {
asc: 'asc',
desc: 'desc'
};
exports.Prisma.NullsOrder = {
first: 'first',
last: 'last'
};
exports.CustomerType = exports.$Enums.CustomerType = {
PRIVATE: 'PRIVATE',
BUSINESS: 'BUSINESS'
};
exports.AddressType = exports.$Enums.AddressType = {
DELIVERY_RESIDENCE: 'DELIVERY_RESIDENCE',
BILLING: 'BILLING'
};
exports.DocumentType = exports.$Enums.DocumentType = {
ID_CARD: 'ID_CARD',
PASSPORT: 'PASSPORT',
DRIVERS_LICENSE: 'DRIVERS_LICENSE',
OTHER: 'OTHER'
};
exports.EmailProviderType = exports.$Enums.EmailProviderType = {
PLESK: 'PLESK',
CPANEL: 'CPANEL',
DIRECTADMIN: 'DIRECTADMIN'
};
exports.MeterType = exports.$Enums.MeterType = {
ELECTRICITY: 'ELECTRICITY',
GAS: 'GAS'
};
exports.ContractType = exports.$Enums.ContractType = {
ELECTRICITY: 'ELECTRICITY',
GAS: 'GAS',
DSL: 'DSL',
CABLE: 'CABLE',
FIBER: 'FIBER',
MOBILE: 'MOBILE',
TV: 'TV',
CAR_INSURANCE: 'CAR_INSURANCE'
};
exports.ContractStatus = exports.$Enums.ContractStatus = {
DRAFT: 'DRAFT',
PENDING: 'PENDING',
ACTIVE: 'ACTIVE',
CANCELLED: 'CANCELLED',
EXPIRED: 'EXPIRED',
DEACTIVATED: 'DEACTIVATED'
};
exports.ContractTaskStatus = exports.$Enums.ContractTaskStatus = {
OPEN: 'OPEN',
COMPLETED: 'COMPLETED'
};
exports.InsuranceType = exports.$Enums.InsuranceType = {
LIABILITY: 'LIABILITY',
PARTIAL: 'PARTIAL',
FULL: 'FULL'
};
exports.Prisma.ModelName = {
AppSetting: 'AppSetting',
User: 'User',
Role: 'Role',
Permission: 'Permission',
RolePermission: 'RolePermission',
UserRole: 'UserRole',
Customer: 'Customer',
CustomerRepresentative: 'CustomerRepresentative',
Address: 'Address',
BankCard: 'BankCard',
IdentityDocument: 'IdentityDocument',
EmailProviderConfig: 'EmailProviderConfig',
StressfreiEmail: 'StressfreiEmail',
Meter: 'Meter',
MeterReading: 'MeterReading',
SalesPlatform: 'SalesPlatform',
CancellationPeriod: 'CancellationPeriod',
ContractDuration: 'ContractDuration',
Provider: 'Provider',
Tariff: 'Tariff',
ContractCategory: 'ContractCategory',
Contract: 'Contract',
ContractTask: 'ContractTask',
ContractTaskSubtask: 'ContractTaskSubtask',
EnergyContractDetails: 'EnergyContractDetails',
InternetContractDetails: 'InternetContractDetails',
PhoneNumber: 'PhoneNumber',
MobileContractDetails: 'MobileContractDetails',
SimCard: 'SimCard',
TvContractDetails: 'TvContractDetails',
CarInsuranceDetails: 'CarInsuranceDetails'
};
/**
* This is a stub Prisma Client that will error at runtime if called.
*/
class PrismaClient {
constructor() {
return new Proxy(this, {
get(target, prop) {
let message
const runtime = getRuntime()
if (runtime.isEdge) {
message = `PrismaClient is not configured to run in ${runtime.prettyName}. In order to run Prisma Client on edge runtime, either:
- Use Prisma Accelerate: https://pris.ly/d/accelerate
- Use Driver Adapters: https://pris.ly/d/driver-adapters
`;
} else {
message = 'PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in `' + runtime.prettyName + '`).'
}
message += `
If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report`
throw new Error(message)
}
})
}
}
exports.PrismaClient = PrismaClient
Object.assign(exports, Prisma)