set consumer customers and saleInvoices
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
-- DropForeignKey
|
||||
ALTER TABLE `customer_individuals` DROP FOREIGN KEY `customer_individuals_customer_id_fkey`;
|
||||
|
||||
-- DropForeignKey
|
||||
ALTER TABLE `customer_legal` DROP FOREIGN KEY `customer_legal_customer_id_fkey`;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE `customers` ADD COLUMN `unknown_customer` JSON NULL;
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX `customer_individuals_complex_id_idx` ON `customer_individuals`(`complex_id`);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX `customer_legal_complex_id_idx` ON `customer_legal`(`complex_id`);
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `customer_individuals` ADD CONSTRAINT `customer_individuals_customer_id_fkey` FOREIGN KEY (`customer_id`) REFERENCES `customers`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `customer_legal` ADD CONSTRAINT `customer_legal_customer_id_fkey` FOREIGN KEY (`customer_id`) REFERENCES `customers`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
@@ -1,46 +1,51 @@
|
||||
model Customer {
|
||||
id String @id @default(uuid())
|
||||
type CustomerType
|
||||
is_favorite Boolean? @default(false)
|
||||
id String @id @default(uuid())
|
||||
is_favorite Boolean? @default(false)
|
||||
|
||||
created_at DateTime @default(now()) @db.Timestamp(0)
|
||||
updated_at DateTime @updatedAt @db.Timestamp(0)
|
||||
deleted_at DateTime? @db.Timestamp(0)
|
||||
|
||||
sales_invoices SalesInvoice[]
|
||||
customer_individuals CustomerIndividual?
|
||||
customer_legals CustomerLegal?
|
||||
type CustomerType
|
||||
unknown_customer Json?
|
||||
customer_individual CustomerIndividual?
|
||||
customer_legal CustomerLegal?
|
||||
sales_invoices SalesInvoice[]
|
||||
|
||||
@@map("customers")
|
||||
}
|
||||
|
||||
model CustomerIndividual {
|
||||
customer_id String @id
|
||||
first_name String @db.VarChar(255)
|
||||
last_name String @db.VarChar(255)
|
||||
national_id String @db.Char(10)
|
||||
postal_code String @db.Char(10)
|
||||
economic_code String? @db.Char(10)
|
||||
complex_id String
|
||||
|
||||
customer Customer @relation(fields: [customer_id], references: [id])
|
||||
complex Complex @relation(fields: [complex_id], references: [id])
|
||||
customer_id String @id
|
||||
customer Customer @relation(fields: [customer_id], references: [id], onDelete: Cascade)
|
||||
|
||||
complex_id String
|
||||
complex Complex @relation(fields: [complex_id], references: [id])
|
||||
|
||||
@@unique([complex_id, national_id])
|
||||
@@index([complex_id])
|
||||
@@map("customer_individuals")
|
||||
}
|
||||
|
||||
model CustomerLegal {
|
||||
customer_id String @id
|
||||
company_name String @db.VarChar(255)
|
||||
economic_code String @db.Char(10)
|
||||
registration_number String @db.Char(20)
|
||||
postal_code String @db.Char(10)
|
||||
complex_id String
|
||||
|
||||
customer Customer @relation(fields: [customer_id], references: [id])
|
||||
complex Complex @relation(fields: [complex_id], references: [id])
|
||||
customer_id String @id
|
||||
customer Customer @relation(fields: [customer_id], references: [id], onDelete: Cascade)
|
||||
|
||||
complex_id String
|
||||
complex Complex @relation(fields: [complex_id], references: [id])
|
||||
|
||||
@@unique([complex_id, registration_number])
|
||||
@@index([complex_id])
|
||||
@@map("customer_legal")
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
import { Request } from 'express'
|
||||
import { IConsumerPayload } from '../models'
|
||||
|
||||
export const ConsumerInfoInfo = createParamDecorator(
|
||||
export const ConsumerInfo = createParamDecorator(
|
||||
(data: keyof IConsumerPayload | undefined, ctx: ExecutionContext) => {
|
||||
try {
|
||||
const request = ctx.switchToHttp().getRequest<Request>()
|
||||
|
||||
@@ -41,9 +41,7 @@ export class ConsumerGuard {
|
||||
if (!consumer.license?.expires_at) {
|
||||
throw new ForbiddenException('برای کاربر شما لایسنس ایجاد نشده است.')
|
||||
}
|
||||
if (
|
||||
new Date().toUTCString() > new Date(consumer.license?.expires_at).toUTCString()
|
||||
) {
|
||||
if (new Date().getTime() > new Date(consumer.license?.expires_at).getTime()) {
|
||||
throw new ForbiddenException('لایسنس شما منقضی شده است.')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -385,13 +385,6 @@ export type IntWithAggregatesFilter<$PrismaModel = never> = {
|
||||
_max?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type EnumCustomerTypeFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.CustomerType | Prisma.EnumCustomerTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.CustomerType[]
|
||||
notIn?: $Enums.CustomerType[]
|
||||
not?: Prisma.NestedEnumCustomerTypeFilter<$PrismaModel> | $Enums.CustomerType
|
||||
}
|
||||
|
||||
export type BoolNullableFilter<$PrismaModel = never> = {
|
||||
equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> | null
|
||||
not?: Prisma.NestedBoolNullableFilter<$PrismaModel> | boolean | null
|
||||
@@ -408,14 +401,35 @@ export type DateTimeNullableFilter<$PrismaModel = never> = {
|
||||
not?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null
|
||||
}
|
||||
|
||||
export type EnumCustomerTypeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
export type EnumCustomerTypeFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.CustomerType | Prisma.EnumCustomerTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.CustomerType[]
|
||||
notIn?: $Enums.CustomerType[]
|
||||
not?: Prisma.NestedEnumCustomerTypeWithAggregatesFilter<$PrismaModel> | $Enums.CustomerType
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumCustomerTypeFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumCustomerTypeFilter<$PrismaModel>
|
||||
not?: Prisma.NestedEnumCustomerTypeFilter<$PrismaModel> | $Enums.CustomerType
|
||||
}
|
||||
|
||||
export type JsonNullableFilter<$PrismaModel = never> =
|
||||
| Prisma.PatchUndefined<
|
||||
Prisma.Either<Required<JsonNullableFilterBase<$PrismaModel>>, Exclude<keyof Required<JsonNullableFilterBase<$PrismaModel>>, 'path'>>,
|
||||
Required<JsonNullableFilterBase<$PrismaModel>>
|
||||
>
|
||||
| Prisma.OptionalFlat<Omit<Required<JsonNullableFilterBase<$PrismaModel>>, 'path'>>
|
||||
|
||||
export type JsonNullableFilterBase<$PrismaModel = never> = {
|
||||
equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
path?: string
|
||||
mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel>
|
||||
string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
array_contains?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
lt?: runtime.InputJsonValue
|
||||
lte?: runtime.InputJsonValue
|
||||
gt?: runtime.InputJsonValue
|
||||
gte?: runtime.InputJsonValue
|
||||
not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
}
|
||||
|
||||
export type BoolNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
@@ -440,6 +454,43 @@ export type DateTimeNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
_max?: Prisma.NestedDateTimeNullableFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type EnumCustomerTypeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.CustomerType | Prisma.EnumCustomerTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.CustomerType[]
|
||||
notIn?: $Enums.CustomerType[]
|
||||
not?: Prisma.NestedEnumCustomerTypeWithAggregatesFilter<$PrismaModel> | $Enums.CustomerType
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumCustomerTypeFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumCustomerTypeFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type JsonNullableWithAggregatesFilter<$PrismaModel = never> =
|
||||
| Prisma.PatchUndefined<
|
||||
Prisma.Either<Required<JsonNullableWithAggregatesFilterBase<$PrismaModel>>, Exclude<keyof Required<JsonNullableWithAggregatesFilterBase<$PrismaModel>>, 'path'>>,
|
||||
Required<JsonNullableWithAggregatesFilterBase<$PrismaModel>>
|
||||
>
|
||||
| Prisma.OptionalFlat<Omit<Required<JsonNullableWithAggregatesFilterBase<$PrismaModel>>, 'path'>>
|
||||
|
||||
export type JsonNullableWithAggregatesFilterBase<$PrismaModel = never> = {
|
||||
equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
path?: string
|
||||
mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel>
|
||||
string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
array_contains?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
lt?: runtime.InputJsonValue
|
||||
lte?: runtime.InputJsonValue
|
||||
gt?: runtime.InputJsonValue
|
||||
gte?: runtime.InputJsonValue
|
||||
not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedJsonNullableFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedJsonNullableFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type BoolFilter<$PrismaModel = never> = {
|
||||
equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedBoolFilter<$PrismaModel> | boolean
|
||||
@@ -525,30 +576,6 @@ export type DecimalFilter<$PrismaModel = never> = {
|
||||
not?: Prisma.NestedDecimalFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
}
|
||||
|
||||
export type JsonNullableFilter<$PrismaModel = never> =
|
||||
| Prisma.PatchUndefined<
|
||||
Prisma.Either<Required<JsonNullableFilterBase<$PrismaModel>>, Exclude<keyof Required<JsonNullableFilterBase<$PrismaModel>>, 'path'>>,
|
||||
Required<JsonNullableFilterBase<$PrismaModel>>
|
||||
>
|
||||
| Prisma.OptionalFlat<Omit<Required<JsonNullableFilterBase<$PrismaModel>>, 'path'>>
|
||||
|
||||
export type JsonNullableFilterBase<$PrismaModel = never> = {
|
||||
equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
path?: string
|
||||
mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel>
|
||||
string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
array_contains?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
lt?: runtime.InputJsonValue
|
||||
lte?: runtime.InputJsonValue
|
||||
gt?: runtime.InputJsonValue
|
||||
gte?: runtime.InputJsonValue
|
||||
not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
}
|
||||
|
||||
export type DecimalWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[]
|
||||
@@ -565,33 +592,6 @@ export type DecimalWithAggregatesFilter<$PrismaModel = never> = {
|
||||
_max?: Prisma.NestedDecimalFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type JsonNullableWithAggregatesFilter<$PrismaModel = never> =
|
||||
| Prisma.PatchUndefined<
|
||||
Prisma.Either<Required<JsonNullableWithAggregatesFilterBase<$PrismaModel>>, Exclude<keyof Required<JsonNullableWithAggregatesFilterBase<$PrismaModel>>, 'path'>>,
|
||||
Required<JsonNullableWithAggregatesFilterBase<$PrismaModel>>
|
||||
>
|
||||
| Prisma.OptionalFlat<Omit<Required<JsonNullableWithAggregatesFilterBase<$PrismaModel>>, 'path'>>
|
||||
|
||||
export type JsonNullableWithAggregatesFilterBase<$PrismaModel = never> = {
|
||||
equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
path?: string
|
||||
mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel>
|
||||
string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
array_contains?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
lt?: runtime.InputJsonValue
|
||||
lte?: runtime.InputJsonValue
|
||||
gt?: runtime.InputJsonValue
|
||||
gte?: runtime.InputJsonValue
|
||||
not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedJsonNullableFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedJsonNullableFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type EnumPaymentMethodTypeFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.PaymentMethodType | Prisma.EnumPaymentMethodTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.PaymentMethodType[]
|
||||
@@ -997,13 +997,6 @@ export type NestedFloatFilter<$PrismaModel = never> = {
|
||||
not?: Prisma.NestedFloatFilter<$PrismaModel> | number
|
||||
}
|
||||
|
||||
export type NestedEnumCustomerTypeFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.CustomerType | Prisma.EnumCustomerTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.CustomerType[]
|
||||
notIn?: $Enums.CustomerType[]
|
||||
not?: Prisma.NestedEnumCustomerTypeFilter<$PrismaModel> | $Enums.CustomerType
|
||||
}
|
||||
|
||||
export type NestedBoolNullableFilter<$PrismaModel = never> = {
|
||||
equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> | null
|
||||
not?: Prisma.NestedBoolNullableFilter<$PrismaModel> | boolean | null
|
||||
@@ -1020,14 +1013,11 @@ export type NestedDateTimeNullableFilter<$PrismaModel = never> = {
|
||||
not?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null
|
||||
}
|
||||
|
||||
export type NestedEnumCustomerTypeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
export type NestedEnumCustomerTypeFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.CustomerType | Prisma.EnumCustomerTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.CustomerType[]
|
||||
notIn?: $Enums.CustomerType[]
|
||||
not?: Prisma.NestedEnumCustomerTypeWithAggregatesFilter<$PrismaModel> | $Enums.CustomerType
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumCustomerTypeFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumCustomerTypeFilter<$PrismaModel>
|
||||
not?: Prisma.NestedEnumCustomerTypeFilter<$PrismaModel> | $Enums.CustomerType
|
||||
}
|
||||
|
||||
export type NestedBoolNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
@@ -1052,6 +1042,40 @@ export type NestedDateTimeNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
_max?: Prisma.NestedDateTimeNullableFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedEnumCustomerTypeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.CustomerType | Prisma.EnumCustomerTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.CustomerType[]
|
||||
notIn?: $Enums.CustomerType[]
|
||||
not?: Prisma.NestedEnumCustomerTypeWithAggregatesFilter<$PrismaModel> | $Enums.CustomerType
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumCustomerTypeFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumCustomerTypeFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedJsonNullableFilter<$PrismaModel = never> =
|
||||
| Prisma.PatchUndefined<
|
||||
Prisma.Either<Required<NestedJsonNullableFilterBase<$PrismaModel>>, Exclude<keyof Required<NestedJsonNullableFilterBase<$PrismaModel>>, 'path'>>,
|
||||
Required<NestedJsonNullableFilterBase<$PrismaModel>>
|
||||
>
|
||||
| Prisma.OptionalFlat<Omit<Required<NestedJsonNullableFilterBase<$PrismaModel>>, 'path'>>
|
||||
|
||||
export type NestedJsonNullableFilterBase<$PrismaModel = never> = {
|
||||
equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
path?: string
|
||||
mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel>
|
||||
string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
array_contains?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
lt?: runtime.InputJsonValue
|
||||
lte?: runtime.InputJsonValue
|
||||
gt?: runtime.InputJsonValue
|
||||
gte?: runtime.InputJsonValue
|
||||
not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
}
|
||||
|
||||
export type NestedBoolFilter<$PrismaModel = never> = {
|
||||
equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedBoolFilter<$PrismaModel> | boolean
|
||||
@@ -1153,30 +1177,6 @@ export type NestedDecimalWithAggregatesFilter<$PrismaModel = never> = {
|
||||
_max?: Prisma.NestedDecimalFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedJsonNullableFilter<$PrismaModel = never> =
|
||||
| Prisma.PatchUndefined<
|
||||
Prisma.Either<Required<NestedJsonNullableFilterBase<$PrismaModel>>, Exclude<keyof Required<NestedJsonNullableFilterBase<$PrismaModel>>, 'path'>>,
|
||||
Required<NestedJsonNullableFilterBase<$PrismaModel>>
|
||||
>
|
||||
| Prisma.OptionalFlat<Omit<Required<NestedJsonNullableFilterBase<$PrismaModel>>, 'path'>>
|
||||
|
||||
export type NestedJsonNullableFilterBase<$PrismaModel = never> = {
|
||||
equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
path?: string
|
||||
mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel>
|
||||
string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
array_contains?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
lt?: runtime.InputJsonValue
|
||||
lte?: runtime.InputJsonValue
|
||||
gt?: runtime.InputJsonValue
|
||||
gte?: runtime.InputJsonValue
|
||||
not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
}
|
||||
|
||||
export type NestedEnumPaymentMethodTypeFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.PaymentMethodType | Prisma.EnumPaymentMethodTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.PaymentMethodType[]
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -2843,23 +2843,24 @@ export type UserDevicesScalarFieldEnum = (typeof UserDevicesScalarFieldEnum)[key
|
||||
|
||||
export const CustomerScalarFieldEnum = {
|
||||
id: 'id',
|
||||
type: 'type',
|
||||
is_favorite: 'is_favorite',
|
||||
created_at: 'created_at',
|
||||
updated_at: 'updated_at',
|
||||
deleted_at: 'deleted_at'
|
||||
deleted_at: 'deleted_at',
|
||||
type: 'type',
|
||||
unknown_customer: 'unknown_customer'
|
||||
} as const
|
||||
|
||||
export type CustomerScalarFieldEnum = (typeof CustomerScalarFieldEnum)[keyof typeof CustomerScalarFieldEnum]
|
||||
|
||||
|
||||
export const CustomerIndividualScalarFieldEnum = {
|
||||
customer_id: 'customer_id',
|
||||
first_name: 'first_name',
|
||||
last_name: 'last_name',
|
||||
national_id: 'national_id',
|
||||
postal_code: 'postal_code',
|
||||
economic_code: 'economic_code',
|
||||
customer_id: 'customer_id',
|
||||
complex_id: 'complex_id'
|
||||
} as const
|
||||
|
||||
@@ -2867,11 +2868,11 @@ export type CustomerIndividualScalarFieldEnum = (typeof CustomerIndividualScalar
|
||||
|
||||
|
||||
export const CustomerLegalScalarFieldEnum = {
|
||||
customer_id: 'customer_id',
|
||||
company_name: 'company_name',
|
||||
economic_code: 'economic_code',
|
||||
registration_number: 'registration_number',
|
||||
postal_code: 'postal_code',
|
||||
customer_id: 'customer_id',
|
||||
complex_id: 'complex_id'
|
||||
} as const
|
||||
|
||||
@@ -3239,6 +3240,23 @@ export const UserDevicesOrderByRelevanceFieldEnum = {
|
||||
export type UserDevicesOrderByRelevanceFieldEnum = (typeof UserDevicesOrderByRelevanceFieldEnum)[keyof typeof UserDevicesOrderByRelevanceFieldEnum]
|
||||
|
||||
|
||||
export const JsonNullValueFilter = {
|
||||
DbNull: DbNull,
|
||||
JsonNull: JsonNull,
|
||||
AnyNull: AnyNull
|
||||
} as const
|
||||
|
||||
export type JsonNullValueFilter = (typeof JsonNullValueFilter)[keyof typeof JsonNullValueFilter]
|
||||
|
||||
|
||||
export const QueryMode = {
|
||||
default: 'default',
|
||||
insensitive: 'insensitive'
|
||||
} as const
|
||||
|
||||
export type QueryMode = (typeof QueryMode)[keyof typeof QueryMode]
|
||||
|
||||
|
||||
export const CustomerOrderByRelevanceFieldEnum = {
|
||||
id: 'id'
|
||||
} as const
|
||||
@@ -3247,12 +3265,12 @@ export type CustomerOrderByRelevanceFieldEnum = (typeof CustomerOrderByRelevance
|
||||
|
||||
|
||||
export const CustomerIndividualOrderByRelevanceFieldEnum = {
|
||||
customer_id: 'customer_id',
|
||||
first_name: 'first_name',
|
||||
last_name: 'last_name',
|
||||
national_id: 'national_id',
|
||||
postal_code: 'postal_code',
|
||||
economic_code: 'economic_code',
|
||||
customer_id: 'customer_id',
|
||||
complex_id: 'complex_id'
|
||||
} as const
|
||||
|
||||
@@ -3260,11 +3278,11 @@ export type CustomerIndividualOrderByRelevanceFieldEnum = (typeof CustomerIndivi
|
||||
|
||||
|
||||
export const CustomerLegalOrderByRelevanceFieldEnum = {
|
||||
customer_id: 'customer_id',
|
||||
company_name: 'company_name',
|
||||
economic_code: 'economic_code',
|
||||
registration_number: 'registration_number',
|
||||
postal_code: 'postal_code',
|
||||
customer_id: 'customer_id',
|
||||
complex_id: 'complex_id'
|
||||
} as const
|
||||
|
||||
@@ -3306,23 +3324,6 @@ export const GuildOrderByRelevanceFieldEnum = {
|
||||
export type GuildOrderByRelevanceFieldEnum = (typeof GuildOrderByRelevanceFieldEnum)[keyof typeof GuildOrderByRelevanceFieldEnum]
|
||||
|
||||
|
||||
export const JsonNullValueFilter = {
|
||||
DbNull: DbNull,
|
||||
JsonNull: JsonNull,
|
||||
AnyNull: AnyNull
|
||||
} as const
|
||||
|
||||
export type JsonNullValueFilter = (typeof JsonNullValueFilter)[keyof typeof JsonNullValueFilter]
|
||||
|
||||
|
||||
export const QueryMode = {
|
||||
default: 'default',
|
||||
insensitive: 'insensitive'
|
||||
} as const
|
||||
|
||||
export type QueryMode = (typeof QueryMode)[keyof typeof QueryMode]
|
||||
|
||||
|
||||
export const SalesInvoiceOrderByRelevanceFieldEnum = {
|
||||
id: 'id',
|
||||
code: 'code',
|
||||
@@ -3499,6 +3500,13 @@ export type EnumProviderRoleFieldRefInput<$PrismaModel> = FieldRefInputType<$Pri
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Reference to a field of type 'Boolean'
|
||||
*/
|
||||
export type BooleanFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Boolean'>
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Reference to a field of type 'CustomerType'
|
||||
*/
|
||||
@@ -3507,9 +3515,16 @@ export type EnumCustomerTypeFieldRefInput<$PrismaModel> = FieldRefInputType<$Pri
|
||||
|
||||
|
||||
/**
|
||||
* Reference to a field of type 'Boolean'
|
||||
* Reference to a field of type 'Json'
|
||||
*/
|
||||
export type BooleanFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Boolean'>
|
||||
export type JsonFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Json'>
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Reference to a field of type 'QueryMode'
|
||||
*/
|
||||
export type EnumQueryModeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'QueryMode'>
|
||||
|
||||
|
||||
|
||||
@@ -3534,20 +3549,6 @@ export type DecimalFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel,
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Reference to a field of type 'Json'
|
||||
*/
|
||||
export type JsonFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Json'>
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Reference to a field of type 'QueryMode'
|
||||
*/
|
||||
export type EnumQueryModeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'QueryMode'>
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Reference to a field of type 'PaymentMethodType'
|
||||
*/
|
||||
|
||||
@@ -358,23 +358,24 @@ export type UserDevicesScalarFieldEnum = (typeof UserDevicesScalarFieldEnum)[key
|
||||
|
||||
export const CustomerScalarFieldEnum = {
|
||||
id: 'id',
|
||||
type: 'type',
|
||||
is_favorite: 'is_favorite',
|
||||
created_at: 'created_at',
|
||||
updated_at: 'updated_at',
|
||||
deleted_at: 'deleted_at'
|
||||
deleted_at: 'deleted_at',
|
||||
type: 'type',
|
||||
unknown_customer: 'unknown_customer'
|
||||
} as const
|
||||
|
||||
export type CustomerScalarFieldEnum = (typeof CustomerScalarFieldEnum)[keyof typeof CustomerScalarFieldEnum]
|
||||
|
||||
|
||||
export const CustomerIndividualScalarFieldEnum = {
|
||||
customer_id: 'customer_id',
|
||||
first_name: 'first_name',
|
||||
last_name: 'last_name',
|
||||
national_id: 'national_id',
|
||||
postal_code: 'postal_code',
|
||||
economic_code: 'economic_code',
|
||||
customer_id: 'customer_id',
|
||||
complex_id: 'complex_id'
|
||||
} as const
|
||||
|
||||
@@ -382,11 +383,11 @@ export type CustomerIndividualScalarFieldEnum = (typeof CustomerIndividualScalar
|
||||
|
||||
|
||||
export const CustomerLegalScalarFieldEnum = {
|
||||
customer_id: 'customer_id',
|
||||
company_name: 'company_name',
|
||||
economic_code: 'economic_code',
|
||||
registration_number: 'registration_number',
|
||||
postal_code: 'postal_code',
|
||||
customer_id: 'customer_id',
|
||||
complex_id: 'complex_id'
|
||||
} as const
|
||||
|
||||
@@ -754,6 +755,23 @@ export const UserDevicesOrderByRelevanceFieldEnum = {
|
||||
export type UserDevicesOrderByRelevanceFieldEnum = (typeof UserDevicesOrderByRelevanceFieldEnum)[keyof typeof UserDevicesOrderByRelevanceFieldEnum]
|
||||
|
||||
|
||||
export const JsonNullValueFilter = {
|
||||
DbNull: 'DbNull',
|
||||
JsonNull: 'JsonNull',
|
||||
AnyNull: 'AnyNull'
|
||||
} as const
|
||||
|
||||
export type JsonNullValueFilter = (typeof JsonNullValueFilter)[keyof typeof JsonNullValueFilter]
|
||||
|
||||
|
||||
export const QueryMode = {
|
||||
default: 'default',
|
||||
insensitive: 'insensitive'
|
||||
} as const
|
||||
|
||||
export type QueryMode = (typeof QueryMode)[keyof typeof QueryMode]
|
||||
|
||||
|
||||
export const CustomerOrderByRelevanceFieldEnum = {
|
||||
id: 'id'
|
||||
} as const
|
||||
@@ -762,12 +780,12 @@ export type CustomerOrderByRelevanceFieldEnum = (typeof CustomerOrderByRelevance
|
||||
|
||||
|
||||
export const CustomerIndividualOrderByRelevanceFieldEnum = {
|
||||
customer_id: 'customer_id',
|
||||
first_name: 'first_name',
|
||||
last_name: 'last_name',
|
||||
national_id: 'national_id',
|
||||
postal_code: 'postal_code',
|
||||
economic_code: 'economic_code',
|
||||
customer_id: 'customer_id',
|
||||
complex_id: 'complex_id'
|
||||
} as const
|
||||
|
||||
@@ -775,11 +793,11 @@ export type CustomerIndividualOrderByRelevanceFieldEnum = (typeof CustomerIndivi
|
||||
|
||||
|
||||
export const CustomerLegalOrderByRelevanceFieldEnum = {
|
||||
customer_id: 'customer_id',
|
||||
company_name: 'company_name',
|
||||
economic_code: 'economic_code',
|
||||
registration_number: 'registration_number',
|
||||
postal_code: 'postal_code',
|
||||
customer_id: 'customer_id',
|
||||
complex_id: 'complex_id'
|
||||
} as const
|
||||
|
||||
@@ -821,23 +839,6 @@ export const GuildOrderByRelevanceFieldEnum = {
|
||||
export type GuildOrderByRelevanceFieldEnum = (typeof GuildOrderByRelevanceFieldEnum)[keyof typeof GuildOrderByRelevanceFieldEnum]
|
||||
|
||||
|
||||
export const JsonNullValueFilter = {
|
||||
DbNull: 'DbNull',
|
||||
JsonNull: 'JsonNull',
|
||||
AnyNull: 'AnyNull'
|
||||
} as const
|
||||
|
||||
export type JsonNullValueFilter = (typeof JsonNullValueFilter)[keyof typeof JsonNullValueFilter]
|
||||
|
||||
|
||||
export const QueryMode = {
|
||||
default: 'default',
|
||||
insensitive: 'insensitive'
|
||||
} as const
|
||||
|
||||
export type QueryMode = (typeof QueryMode)[keyof typeof QueryMode]
|
||||
|
||||
|
||||
export const SalesInvoiceOrderByRelevanceFieldEnum = {
|
||||
id: 'id',
|
||||
code: 'code',
|
||||
|
||||
@@ -26,58 +26,60 @@ export type AggregateCustomer = {
|
||||
|
||||
export type CustomerMinAggregateOutputType = {
|
||||
id: string | null
|
||||
type: $Enums.CustomerType | null
|
||||
is_favorite: boolean | null
|
||||
created_at: Date | null
|
||||
updated_at: Date | null
|
||||
deleted_at: Date | null
|
||||
type: $Enums.CustomerType | null
|
||||
}
|
||||
|
||||
export type CustomerMaxAggregateOutputType = {
|
||||
id: string | null
|
||||
type: $Enums.CustomerType | null
|
||||
is_favorite: boolean | null
|
||||
created_at: Date | null
|
||||
updated_at: Date | null
|
||||
deleted_at: Date | null
|
||||
type: $Enums.CustomerType | null
|
||||
}
|
||||
|
||||
export type CustomerCountAggregateOutputType = {
|
||||
id: number
|
||||
type: number
|
||||
is_favorite: number
|
||||
created_at: number
|
||||
updated_at: number
|
||||
deleted_at: number
|
||||
type: number
|
||||
unknown_customer: number
|
||||
_all: number
|
||||
}
|
||||
|
||||
|
||||
export type CustomerMinAggregateInputType = {
|
||||
id?: true
|
||||
type?: true
|
||||
is_favorite?: true
|
||||
created_at?: true
|
||||
updated_at?: true
|
||||
deleted_at?: true
|
||||
type?: true
|
||||
}
|
||||
|
||||
export type CustomerMaxAggregateInputType = {
|
||||
id?: true
|
||||
type?: true
|
||||
is_favorite?: true
|
||||
created_at?: true
|
||||
updated_at?: true
|
||||
deleted_at?: true
|
||||
type?: true
|
||||
}
|
||||
|
||||
export type CustomerCountAggregateInputType = {
|
||||
id?: true
|
||||
type?: true
|
||||
is_favorite?: true
|
||||
created_at?: true
|
||||
updated_at?: true
|
||||
deleted_at?: true
|
||||
type?: true
|
||||
unknown_customer?: true
|
||||
_all?: true
|
||||
}
|
||||
|
||||
@@ -155,11 +157,12 @@ export type CustomerGroupByArgs<ExtArgs extends runtime.Types.Extensions.Interna
|
||||
|
||||
export type CustomerGroupByOutputType = {
|
||||
id: string
|
||||
type: $Enums.CustomerType
|
||||
is_favorite: boolean | null
|
||||
created_at: Date
|
||||
updated_at: Date
|
||||
deleted_at: Date | null
|
||||
type: $Enums.CustomerType
|
||||
unknown_customer: runtime.JsonValue | null
|
||||
_count: CustomerCountAggregateOutputType | null
|
||||
_min: CustomerMinAggregateOutputType | null
|
||||
_max: CustomerMaxAggregateOutputType | null
|
||||
@@ -185,26 +188,28 @@ export type CustomerWhereInput = {
|
||||
OR?: Prisma.CustomerWhereInput[]
|
||||
NOT?: Prisma.CustomerWhereInput | Prisma.CustomerWhereInput[]
|
||||
id?: Prisma.StringFilter<"Customer"> | string
|
||||
type?: Prisma.EnumCustomerTypeFilter<"Customer"> | $Enums.CustomerType
|
||||
is_favorite?: Prisma.BoolNullableFilter<"Customer"> | boolean | null
|
||||
created_at?: Prisma.DateTimeFilter<"Customer"> | Date | string
|
||||
updated_at?: Prisma.DateTimeFilter<"Customer"> | Date | string
|
||||
deleted_at?: Prisma.DateTimeNullableFilter<"Customer"> | Date | string | null
|
||||
type?: Prisma.EnumCustomerTypeFilter<"Customer"> | $Enums.CustomerType
|
||||
unknown_customer?: Prisma.JsonNullableFilter<"Customer">
|
||||
customer_individual?: Prisma.XOR<Prisma.CustomerIndividualNullableScalarRelationFilter, Prisma.CustomerIndividualWhereInput> | null
|
||||
customer_legal?: Prisma.XOR<Prisma.CustomerLegalNullableScalarRelationFilter, Prisma.CustomerLegalWhereInput> | null
|
||||
sales_invoices?: Prisma.SalesInvoiceListRelationFilter
|
||||
customer_individuals?: Prisma.XOR<Prisma.CustomerIndividualNullableScalarRelationFilter, Prisma.CustomerIndividualWhereInput> | null
|
||||
customer_legals?: Prisma.XOR<Prisma.CustomerLegalNullableScalarRelationFilter, Prisma.CustomerLegalWhereInput> | null
|
||||
}
|
||||
|
||||
export type CustomerOrderByWithRelationInput = {
|
||||
id?: Prisma.SortOrder
|
||||
type?: Prisma.SortOrder
|
||||
is_favorite?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
updated_at?: Prisma.SortOrder
|
||||
deleted_at?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
type?: Prisma.SortOrder
|
||||
unknown_customer?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
customer_individual?: Prisma.CustomerIndividualOrderByWithRelationInput
|
||||
customer_legal?: Prisma.CustomerLegalOrderByWithRelationInput
|
||||
sales_invoices?: Prisma.SalesInvoiceOrderByRelationAggregateInput
|
||||
customer_individuals?: Prisma.CustomerIndividualOrderByWithRelationInput
|
||||
customer_legals?: Prisma.CustomerLegalOrderByWithRelationInput
|
||||
_relevance?: Prisma.CustomerOrderByRelevanceInput
|
||||
}
|
||||
|
||||
@@ -213,23 +218,25 @@ export type CustomerWhereUniqueInput = Prisma.AtLeast<{
|
||||
AND?: Prisma.CustomerWhereInput | Prisma.CustomerWhereInput[]
|
||||
OR?: Prisma.CustomerWhereInput[]
|
||||
NOT?: Prisma.CustomerWhereInput | Prisma.CustomerWhereInput[]
|
||||
type?: Prisma.EnumCustomerTypeFilter<"Customer"> | $Enums.CustomerType
|
||||
is_favorite?: Prisma.BoolNullableFilter<"Customer"> | boolean | null
|
||||
created_at?: Prisma.DateTimeFilter<"Customer"> | Date | string
|
||||
updated_at?: Prisma.DateTimeFilter<"Customer"> | Date | string
|
||||
deleted_at?: Prisma.DateTimeNullableFilter<"Customer"> | Date | string | null
|
||||
type?: Prisma.EnumCustomerTypeFilter<"Customer"> | $Enums.CustomerType
|
||||
unknown_customer?: Prisma.JsonNullableFilter<"Customer">
|
||||
customer_individual?: Prisma.XOR<Prisma.CustomerIndividualNullableScalarRelationFilter, Prisma.CustomerIndividualWhereInput> | null
|
||||
customer_legal?: Prisma.XOR<Prisma.CustomerLegalNullableScalarRelationFilter, Prisma.CustomerLegalWhereInput> | null
|
||||
sales_invoices?: Prisma.SalesInvoiceListRelationFilter
|
||||
customer_individuals?: Prisma.XOR<Prisma.CustomerIndividualNullableScalarRelationFilter, Prisma.CustomerIndividualWhereInput> | null
|
||||
customer_legals?: Prisma.XOR<Prisma.CustomerLegalNullableScalarRelationFilter, Prisma.CustomerLegalWhereInput> | null
|
||||
}, "id">
|
||||
|
||||
export type CustomerOrderByWithAggregationInput = {
|
||||
id?: Prisma.SortOrder
|
||||
type?: Prisma.SortOrder
|
||||
is_favorite?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
updated_at?: Prisma.SortOrder
|
||||
deleted_at?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
type?: Prisma.SortOrder
|
||||
unknown_customer?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
_count?: Prisma.CustomerCountOrderByAggregateInput
|
||||
_max?: Prisma.CustomerMaxOrderByAggregateInput
|
||||
_min?: Prisma.CustomerMinOrderByAggregateInput
|
||||
@@ -240,86 +247,94 @@ export type CustomerScalarWhereWithAggregatesInput = {
|
||||
OR?: Prisma.CustomerScalarWhereWithAggregatesInput[]
|
||||
NOT?: Prisma.CustomerScalarWhereWithAggregatesInput | Prisma.CustomerScalarWhereWithAggregatesInput[]
|
||||
id?: Prisma.StringWithAggregatesFilter<"Customer"> | string
|
||||
type?: Prisma.EnumCustomerTypeWithAggregatesFilter<"Customer"> | $Enums.CustomerType
|
||||
is_favorite?: Prisma.BoolNullableWithAggregatesFilter<"Customer"> | boolean | null
|
||||
created_at?: Prisma.DateTimeWithAggregatesFilter<"Customer"> | Date | string
|
||||
updated_at?: Prisma.DateTimeWithAggregatesFilter<"Customer"> | Date | string
|
||||
deleted_at?: Prisma.DateTimeNullableWithAggregatesFilter<"Customer"> | Date | string | null
|
||||
type?: Prisma.EnumCustomerTypeWithAggregatesFilter<"Customer"> | $Enums.CustomerType
|
||||
unknown_customer?: Prisma.JsonNullableWithAggregatesFilter<"Customer">
|
||||
}
|
||||
|
||||
export type CustomerCreateInput = {
|
||||
id?: string
|
||||
type: $Enums.CustomerType
|
||||
is_favorite?: boolean | null
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
deleted_at?: Date | string | null
|
||||
type: $Enums.CustomerType
|
||||
unknown_customer?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
customer_individual?: Prisma.CustomerIndividualCreateNestedOneWithoutCustomerInput
|
||||
customer_legal?: Prisma.CustomerLegalCreateNestedOneWithoutCustomerInput
|
||||
sales_invoices?: Prisma.SalesInvoiceCreateNestedManyWithoutCustomerInput
|
||||
customer_individuals?: Prisma.CustomerIndividualCreateNestedOneWithoutCustomerInput
|
||||
customer_legals?: Prisma.CustomerLegalCreateNestedOneWithoutCustomerInput
|
||||
}
|
||||
|
||||
export type CustomerUncheckedCreateInput = {
|
||||
id?: string
|
||||
type: $Enums.CustomerType
|
||||
is_favorite?: boolean | null
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
deleted_at?: Date | string | null
|
||||
type: $Enums.CustomerType
|
||||
unknown_customer?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
customer_individual?: Prisma.CustomerIndividualUncheckedCreateNestedOneWithoutCustomerInput
|
||||
customer_legal?: Prisma.CustomerLegalUncheckedCreateNestedOneWithoutCustomerInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutCustomerInput
|
||||
customer_individuals?: Prisma.CustomerIndividualUncheckedCreateNestedOneWithoutCustomerInput
|
||||
customer_legals?: Prisma.CustomerLegalUncheckedCreateNestedOneWithoutCustomerInput
|
||||
}
|
||||
|
||||
export type CustomerUpdateInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
type?: Prisma.EnumCustomerTypeFieldUpdateOperationsInput | $Enums.CustomerType
|
||||
is_favorite?: Prisma.NullableBoolFieldUpdateOperationsInput | boolean | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
type?: Prisma.EnumCustomerTypeFieldUpdateOperationsInput | $Enums.CustomerType
|
||||
unknown_customer?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
customer_individual?: Prisma.CustomerIndividualUpdateOneWithoutCustomerNestedInput
|
||||
customer_legal?: Prisma.CustomerLegalUpdateOneWithoutCustomerNestedInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUpdateManyWithoutCustomerNestedInput
|
||||
customer_individuals?: Prisma.CustomerIndividualUpdateOneWithoutCustomerNestedInput
|
||||
customer_legals?: Prisma.CustomerLegalUpdateOneWithoutCustomerNestedInput
|
||||
}
|
||||
|
||||
export type CustomerUncheckedUpdateInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
type?: Prisma.EnumCustomerTypeFieldUpdateOperationsInput | $Enums.CustomerType
|
||||
is_favorite?: Prisma.NullableBoolFieldUpdateOperationsInput | boolean | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
type?: Prisma.EnumCustomerTypeFieldUpdateOperationsInput | $Enums.CustomerType
|
||||
unknown_customer?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
customer_individual?: Prisma.CustomerIndividualUncheckedUpdateOneWithoutCustomerNestedInput
|
||||
customer_legal?: Prisma.CustomerLegalUncheckedUpdateOneWithoutCustomerNestedInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutCustomerNestedInput
|
||||
customer_individuals?: Prisma.CustomerIndividualUncheckedUpdateOneWithoutCustomerNestedInput
|
||||
customer_legals?: Prisma.CustomerLegalUncheckedUpdateOneWithoutCustomerNestedInput
|
||||
}
|
||||
|
||||
export type CustomerCreateManyInput = {
|
||||
id?: string
|
||||
type: $Enums.CustomerType
|
||||
is_favorite?: boolean | null
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
deleted_at?: Date | string | null
|
||||
type: $Enums.CustomerType
|
||||
unknown_customer?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
}
|
||||
|
||||
export type CustomerUpdateManyMutationInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
type?: Prisma.EnumCustomerTypeFieldUpdateOperationsInput | $Enums.CustomerType
|
||||
is_favorite?: Prisma.NullableBoolFieldUpdateOperationsInput | boolean | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
type?: Prisma.EnumCustomerTypeFieldUpdateOperationsInput | $Enums.CustomerType
|
||||
unknown_customer?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
}
|
||||
|
||||
export type CustomerUncheckedUpdateManyInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
type?: Prisma.EnumCustomerTypeFieldUpdateOperationsInput | $Enums.CustomerType
|
||||
is_favorite?: Prisma.NullableBoolFieldUpdateOperationsInput | boolean | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
type?: Prisma.EnumCustomerTypeFieldUpdateOperationsInput | $Enums.CustomerType
|
||||
unknown_customer?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
}
|
||||
|
||||
export type CustomerOrderByRelevanceInput = {
|
||||
@@ -330,29 +345,30 @@ export type CustomerOrderByRelevanceInput = {
|
||||
|
||||
export type CustomerCountOrderByAggregateInput = {
|
||||
id?: Prisma.SortOrder
|
||||
type?: Prisma.SortOrder
|
||||
is_favorite?: Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
updated_at?: Prisma.SortOrder
|
||||
deleted_at?: Prisma.SortOrder
|
||||
type?: Prisma.SortOrder
|
||||
unknown_customer?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type CustomerMaxOrderByAggregateInput = {
|
||||
id?: Prisma.SortOrder
|
||||
type?: Prisma.SortOrder
|
||||
is_favorite?: Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
updated_at?: Prisma.SortOrder
|
||||
deleted_at?: Prisma.SortOrder
|
||||
type?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type CustomerMinOrderByAggregateInput = {
|
||||
id?: Prisma.SortOrder
|
||||
type?: Prisma.SortOrder
|
||||
is_favorite?: Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
updated_at?: Prisma.SortOrder
|
||||
deleted_at?: Prisma.SortOrder
|
||||
type?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type CustomerScalarRelationFilter = {
|
||||
@@ -365,10 +381,6 @@ export type CustomerNullableScalarRelationFilter = {
|
||||
isNot?: Prisma.CustomerWhereInput | null
|
||||
}
|
||||
|
||||
export type EnumCustomerTypeFieldUpdateOperationsInput = {
|
||||
set?: $Enums.CustomerType
|
||||
}
|
||||
|
||||
export type NullableBoolFieldUpdateOperationsInput = {
|
||||
set?: boolean | null
|
||||
}
|
||||
@@ -377,32 +389,36 @@ export type NullableDateTimeFieldUpdateOperationsInput = {
|
||||
set?: Date | string | null
|
||||
}
|
||||
|
||||
export type CustomerCreateNestedOneWithoutCustomer_individualsInput = {
|
||||
create?: Prisma.XOR<Prisma.CustomerCreateWithoutCustomer_individualsInput, Prisma.CustomerUncheckedCreateWithoutCustomer_individualsInput>
|
||||
connectOrCreate?: Prisma.CustomerCreateOrConnectWithoutCustomer_individualsInput
|
||||
export type EnumCustomerTypeFieldUpdateOperationsInput = {
|
||||
set?: $Enums.CustomerType
|
||||
}
|
||||
|
||||
export type CustomerCreateNestedOneWithoutCustomer_individualInput = {
|
||||
create?: Prisma.XOR<Prisma.CustomerCreateWithoutCustomer_individualInput, Prisma.CustomerUncheckedCreateWithoutCustomer_individualInput>
|
||||
connectOrCreate?: Prisma.CustomerCreateOrConnectWithoutCustomer_individualInput
|
||||
connect?: Prisma.CustomerWhereUniqueInput
|
||||
}
|
||||
|
||||
export type CustomerUpdateOneRequiredWithoutCustomer_individualsNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.CustomerCreateWithoutCustomer_individualsInput, Prisma.CustomerUncheckedCreateWithoutCustomer_individualsInput>
|
||||
connectOrCreate?: Prisma.CustomerCreateOrConnectWithoutCustomer_individualsInput
|
||||
upsert?: Prisma.CustomerUpsertWithoutCustomer_individualsInput
|
||||
export type CustomerUpdateOneRequiredWithoutCustomer_individualNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.CustomerCreateWithoutCustomer_individualInput, Prisma.CustomerUncheckedCreateWithoutCustomer_individualInput>
|
||||
connectOrCreate?: Prisma.CustomerCreateOrConnectWithoutCustomer_individualInput
|
||||
upsert?: Prisma.CustomerUpsertWithoutCustomer_individualInput
|
||||
connect?: Prisma.CustomerWhereUniqueInput
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.CustomerUpdateToOneWithWhereWithoutCustomer_individualsInput, Prisma.CustomerUpdateWithoutCustomer_individualsInput>, Prisma.CustomerUncheckedUpdateWithoutCustomer_individualsInput>
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.CustomerUpdateToOneWithWhereWithoutCustomer_individualInput, Prisma.CustomerUpdateWithoutCustomer_individualInput>, Prisma.CustomerUncheckedUpdateWithoutCustomer_individualInput>
|
||||
}
|
||||
|
||||
export type CustomerCreateNestedOneWithoutCustomer_legalsInput = {
|
||||
create?: Prisma.XOR<Prisma.CustomerCreateWithoutCustomer_legalsInput, Prisma.CustomerUncheckedCreateWithoutCustomer_legalsInput>
|
||||
connectOrCreate?: Prisma.CustomerCreateOrConnectWithoutCustomer_legalsInput
|
||||
export type CustomerCreateNestedOneWithoutCustomer_legalInput = {
|
||||
create?: Prisma.XOR<Prisma.CustomerCreateWithoutCustomer_legalInput, Prisma.CustomerUncheckedCreateWithoutCustomer_legalInput>
|
||||
connectOrCreate?: Prisma.CustomerCreateOrConnectWithoutCustomer_legalInput
|
||||
connect?: Prisma.CustomerWhereUniqueInput
|
||||
}
|
||||
|
||||
export type CustomerUpdateOneRequiredWithoutCustomer_legalsNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.CustomerCreateWithoutCustomer_legalsInput, Prisma.CustomerUncheckedCreateWithoutCustomer_legalsInput>
|
||||
connectOrCreate?: Prisma.CustomerCreateOrConnectWithoutCustomer_legalsInput
|
||||
upsert?: Prisma.CustomerUpsertWithoutCustomer_legalsInput
|
||||
export type CustomerUpdateOneRequiredWithoutCustomer_legalNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.CustomerCreateWithoutCustomer_legalInput, Prisma.CustomerUncheckedCreateWithoutCustomer_legalInput>
|
||||
connectOrCreate?: Prisma.CustomerCreateOrConnectWithoutCustomer_legalInput
|
||||
upsert?: Prisma.CustomerUpsertWithoutCustomer_legalInput
|
||||
connect?: Prisma.CustomerWhereUniqueInput
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.CustomerUpdateToOneWithWhereWithoutCustomer_legalsInput, Prisma.CustomerUpdateWithoutCustomer_legalsInput>, Prisma.CustomerUncheckedUpdateWithoutCustomer_legalsInput>
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.CustomerUpdateToOneWithWhereWithoutCustomer_legalInput, Prisma.CustomerUpdateWithoutCustomer_legalInput>, Prisma.CustomerUncheckedUpdateWithoutCustomer_legalInput>
|
||||
}
|
||||
|
||||
export type CustomerCreateNestedOneWithoutSales_invoicesInput = {
|
||||
@@ -421,146 +437,156 @@ export type CustomerUpdateOneWithoutSales_invoicesNestedInput = {
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.CustomerUpdateToOneWithWhereWithoutSales_invoicesInput, Prisma.CustomerUpdateWithoutSales_invoicesInput>, Prisma.CustomerUncheckedUpdateWithoutSales_invoicesInput>
|
||||
}
|
||||
|
||||
export type CustomerCreateWithoutCustomer_individualsInput = {
|
||||
export type CustomerCreateWithoutCustomer_individualInput = {
|
||||
id?: string
|
||||
type: $Enums.CustomerType
|
||||
is_favorite?: boolean | null
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
deleted_at?: Date | string | null
|
||||
type: $Enums.CustomerType
|
||||
unknown_customer?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
customer_legal?: Prisma.CustomerLegalCreateNestedOneWithoutCustomerInput
|
||||
sales_invoices?: Prisma.SalesInvoiceCreateNestedManyWithoutCustomerInput
|
||||
customer_legals?: Prisma.CustomerLegalCreateNestedOneWithoutCustomerInput
|
||||
}
|
||||
|
||||
export type CustomerUncheckedCreateWithoutCustomer_individualsInput = {
|
||||
export type CustomerUncheckedCreateWithoutCustomer_individualInput = {
|
||||
id?: string
|
||||
type: $Enums.CustomerType
|
||||
is_favorite?: boolean | null
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
deleted_at?: Date | string | null
|
||||
type: $Enums.CustomerType
|
||||
unknown_customer?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
customer_legal?: Prisma.CustomerLegalUncheckedCreateNestedOneWithoutCustomerInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutCustomerInput
|
||||
customer_legals?: Prisma.CustomerLegalUncheckedCreateNestedOneWithoutCustomerInput
|
||||
}
|
||||
|
||||
export type CustomerCreateOrConnectWithoutCustomer_individualsInput = {
|
||||
export type CustomerCreateOrConnectWithoutCustomer_individualInput = {
|
||||
where: Prisma.CustomerWhereUniqueInput
|
||||
create: Prisma.XOR<Prisma.CustomerCreateWithoutCustomer_individualsInput, Prisma.CustomerUncheckedCreateWithoutCustomer_individualsInput>
|
||||
create: Prisma.XOR<Prisma.CustomerCreateWithoutCustomer_individualInput, Prisma.CustomerUncheckedCreateWithoutCustomer_individualInput>
|
||||
}
|
||||
|
||||
export type CustomerUpsertWithoutCustomer_individualsInput = {
|
||||
update: Prisma.XOR<Prisma.CustomerUpdateWithoutCustomer_individualsInput, Prisma.CustomerUncheckedUpdateWithoutCustomer_individualsInput>
|
||||
create: Prisma.XOR<Prisma.CustomerCreateWithoutCustomer_individualsInput, Prisma.CustomerUncheckedCreateWithoutCustomer_individualsInput>
|
||||
export type CustomerUpsertWithoutCustomer_individualInput = {
|
||||
update: Prisma.XOR<Prisma.CustomerUpdateWithoutCustomer_individualInput, Prisma.CustomerUncheckedUpdateWithoutCustomer_individualInput>
|
||||
create: Prisma.XOR<Prisma.CustomerCreateWithoutCustomer_individualInput, Prisma.CustomerUncheckedCreateWithoutCustomer_individualInput>
|
||||
where?: Prisma.CustomerWhereInput
|
||||
}
|
||||
|
||||
export type CustomerUpdateToOneWithWhereWithoutCustomer_individualsInput = {
|
||||
export type CustomerUpdateToOneWithWhereWithoutCustomer_individualInput = {
|
||||
where?: Prisma.CustomerWhereInput
|
||||
data: Prisma.XOR<Prisma.CustomerUpdateWithoutCustomer_individualsInput, Prisma.CustomerUncheckedUpdateWithoutCustomer_individualsInput>
|
||||
data: Prisma.XOR<Prisma.CustomerUpdateWithoutCustomer_individualInput, Prisma.CustomerUncheckedUpdateWithoutCustomer_individualInput>
|
||||
}
|
||||
|
||||
export type CustomerUpdateWithoutCustomer_individualsInput = {
|
||||
export type CustomerUpdateWithoutCustomer_individualInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
type?: Prisma.EnumCustomerTypeFieldUpdateOperationsInput | $Enums.CustomerType
|
||||
is_favorite?: Prisma.NullableBoolFieldUpdateOperationsInput | boolean | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
type?: Prisma.EnumCustomerTypeFieldUpdateOperationsInput | $Enums.CustomerType
|
||||
unknown_customer?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
customer_legal?: Prisma.CustomerLegalUpdateOneWithoutCustomerNestedInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUpdateManyWithoutCustomerNestedInput
|
||||
customer_legals?: Prisma.CustomerLegalUpdateOneWithoutCustomerNestedInput
|
||||
}
|
||||
|
||||
export type CustomerUncheckedUpdateWithoutCustomer_individualsInput = {
|
||||
export type CustomerUncheckedUpdateWithoutCustomer_individualInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
type?: Prisma.EnumCustomerTypeFieldUpdateOperationsInput | $Enums.CustomerType
|
||||
is_favorite?: Prisma.NullableBoolFieldUpdateOperationsInput | boolean | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
type?: Prisma.EnumCustomerTypeFieldUpdateOperationsInput | $Enums.CustomerType
|
||||
unknown_customer?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
customer_legal?: Prisma.CustomerLegalUncheckedUpdateOneWithoutCustomerNestedInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutCustomerNestedInput
|
||||
customer_legals?: Prisma.CustomerLegalUncheckedUpdateOneWithoutCustomerNestedInput
|
||||
}
|
||||
|
||||
export type CustomerCreateWithoutCustomer_legalsInput = {
|
||||
export type CustomerCreateWithoutCustomer_legalInput = {
|
||||
id?: string
|
||||
type: $Enums.CustomerType
|
||||
is_favorite?: boolean | null
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
deleted_at?: Date | string | null
|
||||
type: $Enums.CustomerType
|
||||
unknown_customer?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
customer_individual?: Prisma.CustomerIndividualCreateNestedOneWithoutCustomerInput
|
||||
sales_invoices?: Prisma.SalesInvoiceCreateNestedManyWithoutCustomerInput
|
||||
customer_individuals?: Prisma.CustomerIndividualCreateNestedOneWithoutCustomerInput
|
||||
}
|
||||
|
||||
export type CustomerUncheckedCreateWithoutCustomer_legalsInput = {
|
||||
export type CustomerUncheckedCreateWithoutCustomer_legalInput = {
|
||||
id?: string
|
||||
type: $Enums.CustomerType
|
||||
is_favorite?: boolean | null
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
deleted_at?: Date | string | null
|
||||
type: $Enums.CustomerType
|
||||
unknown_customer?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
customer_individual?: Prisma.CustomerIndividualUncheckedCreateNestedOneWithoutCustomerInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutCustomerInput
|
||||
customer_individuals?: Prisma.CustomerIndividualUncheckedCreateNestedOneWithoutCustomerInput
|
||||
}
|
||||
|
||||
export type CustomerCreateOrConnectWithoutCustomer_legalsInput = {
|
||||
export type CustomerCreateOrConnectWithoutCustomer_legalInput = {
|
||||
where: Prisma.CustomerWhereUniqueInput
|
||||
create: Prisma.XOR<Prisma.CustomerCreateWithoutCustomer_legalsInput, Prisma.CustomerUncheckedCreateWithoutCustomer_legalsInput>
|
||||
create: Prisma.XOR<Prisma.CustomerCreateWithoutCustomer_legalInput, Prisma.CustomerUncheckedCreateWithoutCustomer_legalInput>
|
||||
}
|
||||
|
||||
export type CustomerUpsertWithoutCustomer_legalsInput = {
|
||||
update: Prisma.XOR<Prisma.CustomerUpdateWithoutCustomer_legalsInput, Prisma.CustomerUncheckedUpdateWithoutCustomer_legalsInput>
|
||||
create: Prisma.XOR<Prisma.CustomerCreateWithoutCustomer_legalsInput, Prisma.CustomerUncheckedCreateWithoutCustomer_legalsInput>
|
||||
export type CustomerUpsertWithoutCustomer_legalInput = {
|
||||
update: Prisma.XOR<Prisma.CustomerUpdateWithoutCustomer_legalInput, Prisma.CustomerUncheckedUpdateWithoutCustomer_legalInput>
|
||||
create: Prisma.XOR<Prisma.CustomerCreateWithoutCustomer_legalInput, Prisma.CustomerUncheckedCreateWithoutCustomer_legalInput>
|
||||
where?: Prisma.CustomerWhereInput
|
||||
}
|
||||
|
||||
export type CustomerUpdateToOneWithWhereWithoutCustomer_legalsInput = {
|
||||
export type CustomerUpdateToOneWithWhereWithoutCustomer_legalInput = {
|
||||
where?: Prisma.CustomerWhereInput
|
||||
data: Prisma.XOR<Prisma.CustomerUpdateWithoutCustomer_legalsInput, Prisma.CustomerUncheckedUpdateWithoutCustomer_legalsInput>
|
||||
data: Prisma.XOR<Prisma.CustomerUpdateWithoutCustomer_legalInput, Prisma.CustomerUncheckedUpdateWithoutCustomer_legalInput>
|
||||
}
|
||||
|
||||
export type CustomerUpdateWithoutCustomer_legalsInput = {
|
||||
export type CustomerUpdateWithoutCustomer_legalInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
type?: Prisma.EnumCustomerTypeFieldUpdateOperationsInput | $Enums.CustomerType
|
||||
is_favorite?: Prisma.NullableBoolFieldUpdateOperationsInput | boolean | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
type?: Prisma.EnumCustomerTypeFieldUpdateOperationsInput | $Enums.CustomerType
|
||||
unknown_customer?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
customer_individual?: Prisma.CustomerIndividualUpdateOneWithoutCustomerNestedInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUpdateManyWithoutCustomerNestedInput
|
||||
customer_individuals?: Prisma.CustomerIndividualUpdateOneWithoutCustomerNestedInput
|
||||
}
|
||||
|
||||
export type CustomerUncheckedUpdateWithoutCustomer_legalsInput = {
|
||||
export type CustomerUncheckedUpdateWithoutCustomer_legalInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
type?: Prisma.EnumCustomerTypeFieldUpdateOperationsInput | $Enums.CustomerType
|
||||
is_favorite?: Prisma.NullableBoolFieldUpdateOperationsInput | boolean | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
type?: Prisma.EnumCustomerTypeFieldUpdateOperationsInput | $Enums.CustomerType
|
||||
unknown_customer?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
customer_individual?: Prisma.CustomerIndividualUncheckedUpdateOneWithoutCustomerNestedInput
|
||||
sales_invoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutCustomerNestedInput
|
||||
customer_individuals?: Prisma.CustomerIndividualUncheckedUpdateOneWithoutCustomerNestedInput
|
||||
}
|
||||
|
||||
export type CustomerCreateWithoutSales_invoicesInput = {
|
||||
id?: string
|
||||
type: $Enums.CustomerType
|
||||
is_favorite?: boolean | null
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
deleted_at?: Date | string | null
|
||||
customer_individuals?: Prisma.CustomerIndividualCreateNestedOneWithoutCustomerInput
|
||||
customer_legals?: Prisma.CustomerLegalCreateNestedOneWithoutCustomerInput
|
||||
type: $Enums.CustomerType
|
||||
unknown_customer?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
customer_individual?: Prisma.CustomerIndividualCreateNestedOneWithoutCustomerInput
|
||||
customer_legal?: Prisma.CustomerLegalCreateNestedOneWithoutCustomerInput
|
||||
}
|
||||
|
||||
export type CustomerUncheckedCreateWithoutSales_invoicesInput = {
|
||||
id?: string
|
||||
type: $Enums.CustomerType
|
||||
is_favorite?: boolean | null
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
deleted_at?: Date | string | null
|
||||
customer_individuals?: Prisma.CustomerIndividualUncheckedCreateNestedOneWithoutCustomerInput
|
||||
customer_legals?: Prisma.CustomerLegalUncheckedCreateNestedOneWithoutCustomerInput
|
||||
type: $Enums.CustomerType
|
||||
unknown_customer?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
customer_individual?: Prisma.CustomerIndividualUncheckedCreateNestedOneWithoutCustomerInput
|
||||
customer_legal?: Prisma.CustomerLegalUncheckedCreateNestedOneWithoutCustomerInput
|
||||
}
|
||||
|
||||
export type CustomerCreateOrConnectWithoutSales_invoicesInput = {
|
||||
@@ -581,24 +607,26 @@ export type CustomerUpdateToOneWithWhereWithoutSales_invoicesInput = {
|
||||
|
||||
export type CustomerUpdateWithoutSales_invoicesInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
type?: Prisma.EnumCustomerTypeFieldUpdateOperationsInput | $Enums.CustomerType
|
||||
is_favorite?: Prisma.NullableBoolFieldUpdateOperationsInput | boolean | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
customer_individuals?: Prisma.CustomerIndividualUpdateOneWithoutCustomerNestedInput
|
||||
customer_legals?: Prisma.CustomerLegalUpdateOneWithoutCustomerNestedInput
|
||||
type?: Prisma.EnumCustomerTypeFieldUpdateOperationsInput | $Enums.CustomerType
|
||||
unknown_customer?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
customer_individual?: Prisma.CustomerIndividualUpdateOneWithoutCustomerNestedInput
|
||||
customer_legal?: Prisma.CustomerLegalUpdateOneWithoutCustomerNestedInput
|
||||
}
|
||||
|
||||
export type CustomerUncheckedUpdateWithoutSales_invoicesInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
type?: Prisma.EnumCustomerTypeFieldUpdateOperationsInput | $Enums.CustomerType
|
||||
is_favorite?: Prisma.NullableBoolFieldUpdateOperationsInput | boolean | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
customer_individuals?: Prisma.CustomerIndividualUncheckedUpdateOneWithoutCustomerNestedInput
|
||||
customer_legals?: Prisma.CustomerLegalUncheckedUpdateOneWithoutCustomerNestedInput
|
||||
type?: Prisma.EnumCustomerTypeFieldUpdateOperationsInput | $Enums.CustomerType
|
||||
unknown_customer?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
customer_individual?: Prisma.CustomerIndividualUncheckedUpdateOneWithoutCustomerNestedInput
|
||||
customer_legal?: Prisma.CustomerLegalUncheckedUpdateOneWithoutCustomerNestedInput
|
||||
}
|
||||
|
||||
|
||||
@@ -634,14 +662,15 @@ export type CustomerCountOutputTypeCountSales_invoicesArgs<ExtArgs extends runti
|
||||
|
||||
export type CustomerSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
||||
id?: boolean
|
||||
type?: boolean
|
||||
is_favorite?: boolean
|
||||
created_at?: boolean
|
||||
updated_at?: boolean
|
||||
deleted_at?: boolean
|
||||
type?: boolean
|
||||
unknown_customer?: boolean
|
||||
customer_individual?: boolean | Prisma.Customer$customer_individualArgs<ExtArgs>
|
||||
customer_legal?: boolean | Prisma.Customer$customer_legalArgs<ExtArgs>
|
||||
sales_invoices?: boolean | Prisma.Customer$sales_invoicesArgs<ExtArgs>
|
||||
customer_individuals?: boolean | Prisma.Customer$customer_individualsArgs<ExtArgs>
|
||||
customer_legals?: boolean | Prisma.Customer$customer_legalsArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.CustomerCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}, ExtArgs["result"]["customer"]>
|
||||
|
||||
@@ -649,35 +678,37 @@ export type CustomerSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs
|
||||
|
||||
export type CustomerSelectScalar = {
|
||||
id?: boolean
|
||||
type?: boolean
|
||||
is_favorite?: boolean
|
||||
created_at?: boolean
|
||||
updated_at?: boolean
|
||||
deleted_at?: boolean
|
||||
type?: boolean
|
||||
unknown_customer?: boolean
|
||||
}
|
||||
|
||||
export type CustomerOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "type" | "is_favorite" | "created_at" | "updated_at" | "deleted_at", ExtArgs["result"]["customer"]>
|
||||
export type CustomerOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "is_favorite" | "created_at" | "updated_at" | "deleted_at" | "type" | "unknown_customer", ExtArgs["result"]["customer"]>
|
||||
export type CustomerInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
customer_individual?: boolean | Prisma.Customer$customer_individualArgs<ExtArgs>
|
||||
customer_legal?: boolean | Prisma.Customer$customer_legalArgs<ExtArgs>
|
||||
sales_invoices?: boolean | Prisma.Customer$sales_invoicesArgs<ExtArgs>
|
||||
customer_individuals?: boolean | Prisma.Customer$customer_individualsArgs<ExtArgs>
|
||||
customer_legals?: boolean | Prisma.Customer$customer_legalsArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.CustomerCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}
|
||||
|
||||
export type $CustomerPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
name: "Customer"
|
||||
objects: {
|
||||
customer_individual: Prisma.$CustomerIndividualPayload<ExtArgs> | null
|
||||
customer_legal: Prisma.$CustomerLegalPayload<ExtArgs> | null
|
||||
sales_invoices: Prisma.$SalesInvoicePayload<ExtArgs>[]
|
||||
customer_individuals: Prisma.$CustomerIndividualPayload<ExtArgs> | null
|
||||
customer_legals: Prisma.$CustomerLegalPayload<ExtArgs> | null
|
||||
}
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
id: string
|
||||
type: $Enums.CustomerType
|
||||
is_favorite: boolean | null
|
||||
created_at: Date
|
||||
updated_at: Date
|
||||
deleted_at: Date | null
|
||||
type: $Enums.CustomerType
|
||||
unknown_customer: runtime.JsonValue | null
|
||||
}, ExtArgs["result"]["customer"]>
|
||||
composites: {}
|
||||
}
|
||||
@@ -1018,9 +1049,9 @@ readonly fields: CustomerFieldRefs;
|
||||
*/
|
||||
export interface Prisma__CustomerClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
|
||||
readonly [Symbol.toStringTag]: "PrismaPromise"
|
||||
customer_individual<T extends Prisma.Customer$customer_individualArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Customer$customer_individualArgs<ExtArgs>>): Prisma.Prisma__CustomerIndividualClient<runtime.Types.Result.GetResult<Prisma.$CustomerIndividualPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
customer_legal<T extends Prisma.Customer$customer_legalArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Customer$customer_legalArgs<ExtArgs>>): Prisma.Prisma__CustomerLegalClient<runtime.Types.Result.GetResult<Prisma.$CustomerLegalPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
sales_invoices<T extends Prisma.Customer$sales_invoicesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Customer$sales_invoicesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$SalesInvoicePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
customer_individuals<T extends Prisma.Customer$customer_individualsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Customer$customer_individualsArgs<ExtArgs>>): Prisma.Prisma__CustomerIndividualClient<runtime.Types.Result.GetResult<Prisma.$CustomerIndividualPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
customer_legals<T extends Prisma.Customer$customer_legalsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Customer$customer_legalsArgs<ExtArgs>>): Prisma.Prisma__CustomerLegalClient<runtime.Types.Result.GetResult<Prisma.$CustomerLegalPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
/**
|
||||
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
||||
* @param onfulfilled The callback to execute when the Promise is resolved.
|
||||
@@ -1051,11 +1082,12 @@ export interface Prisma__CustomerClient<T, Null = never, ExtArgs extends runtime
|
||||
*/
|
||||
export interface CustomerFieldRefs {
|
||||
readonly id: Prisma.FieldRef<"Customer", 'String'>
|
||||
readonly type: Prisma.FieldRef<"Customer", 'CustomerType'>
|
||||
readonly is_favorite: Prisma.FieldRef<"Customer", 'Boolean'>
|
||||
readonly created_at: Prisma.FieldRef<"Customer", 'DateTime'>
|
||||
readonly updated_at: Prisma.FieldRef<"Customer", 'DateTime'>
|
||||
readonly deleted_at: Prisma.FieldRef<"Customer", 'DateTime'>
|
||||
readonly type: Prisma.FieldRef<"Customer", 'CustomerType'>
|
||||
readonly unknown_customer: Prisma.FieldRef<"Customer", 'Json'>
|
||||
}
|
||||
|
||||
|
||||
@@ -1398,6 +1430,44 @@ export type CustomerDeleteManyArgs<ExtArgs extends runtime.Types.Extensions.Inte
|
||||
limit?: number
|
||||
}
|
||||
|
||||
/**
|
||||
* Customer.customer_individual
|
||||
*/
|
||||
export type Customer$customer_individualArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the CustomerIndividual
|
||||
*/
|
||||
select?: Prisma.CustomerIndividualSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the CustomerIndividual
|
||||
*/
|
||||
omit?: Prisma.CustomerIndividualOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.CustomerIndividualInclude<ExtArgs> | null
|
||||
where?: Prisma.CustomerIndividualWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* Customer.customer_legal
|
||||
*/
|
||||
export type Customer$customer_legalArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the CustomerLegal
|
||||
*/
|
||||
select?: Prisma.CustomerLegalSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the CustomerLegal
|
||||
*/
|
||||
omit?: Prisma.CustomerLegalOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.CustomerLegalInclude<ExtArgs> | null
|
||||
where?: Prisma.CustomerLegalWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* Customer.sales_invoices
|
||||
*/
|
||||
@@ -1422,44 +1492,6 @@ export type Customer$sales_invoicesArgs<ExtArgs extends runtime.Types.Extensions
|
||||
distinct?: Prisma.SalesInvoiceScalarFieldEnum | Prisma.SalesInvoiceScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* Customer.customer_individuals
|
||||
*/
|
||||
export type Customer$customer_individualsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the CustomerIndividual
|
||||
*/
|
||||
select?: Prisma.CustomerIndividualSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the CustomerIndividual
|
||||
*/
|
||||
omit?: Prisma.CustomerIndividualOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.CustomerIndividualInclude<ExtArgs> | null
|
||||
where?: Prisma.CustomerIndividualWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* Customer.customer_legals
|
||||
*/
|
||||
export type Customer$customer_legalsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the CustomerLegal
|
||||
*/
|
||||
select?: Prisma.CustomerLegalSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the CustomerLegal
|
||||
*/
|
||||
omit?: Prisma.CustomerLegalOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.CustomerLegalInclude<ExtArgs> | null
|
||||
where?: Prisma.CustomerLegalWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* Customer without action
|
||||
*/
|
||||
|
||||
@@ -25,64 +25,64 @@ export type AggregateCustomerIndividual = {
|
||||
}
|
||||
|
||||
export type CustomerIndividualMinAggregateOutputType = {
|
||||
customer_id: string | null
|
||||
first_name: string | null
|
||||
last_name: string | null
|
||||
national_id: string | null
|
||||
postal_code: string | null
|
||||
economic_code: string | null
|
||||
customer_id: string | null
|
||||
complex_id: string | null
|
||||
}
|
||||
|
||||
export type CustomerIndividualMaxAggregateOutputType = {
|
||||
customer_id: string | null
|
||||
first_name: string | null
|
||||
last_name: string | null
|
||||
national_id: string | null
|
||||
postal_code: string | null
|
||||
economic_code: string | null
|
||||
customer_id: string | null
|
||||
complex_id: string | null
|
||||
}
|
||||
|
||||
export type CustomerIndividualCountAggregateOutputType = {
|
||||
customer_id: number
|
||||
first_name: number
|
||||
last_name: number
|
||||
national_id: number
|
||||
postal_code: number
|
||||
economic_code: number
|
||||
customer_id: number
|
||||
complex_id: number
|
||||
_all: number
|
||||
}
|
||||
|
||||
|
||||
export type CustomerIndividualMinAggregateInputType = {
|
||||
customer_id?: true
|
||||
first_name?: true
|
||||
last_name?: true
|
||||
national_id?: true
|
||||
postal_code?: true
|
||||
economic_code?: true
|
||||
customer_id?: true
|
||||
complex_id?: true
|
||||
}
|
||||
|
||||
export type CustomerIndividualMaxAggregateInputType = {
|
||||
customer_id?: true
|
||||
first_name?: true
|
||||
last_name?: true
|
||||
national_id?: true
|
||||
postal_code?: true
|
||||
economic_code?: true
|
||||
customer_id?: true
|
||||
complex_id?: true
|
||||
}
|
||||
|
||||
export type CustomerIndividualCountAggregateInputType = {
|
||||
customer_id?: true
|
||||
first_name?: true
|
||||
last_name?: true
|
||||
national_id?: true
|
||||
postal_code?: true
|
||||
economic_code?: true
|
||||
customer_id?: true
|
||||
complex_id?: true
|
||||
_all?: true
|
||||
}
|
||||
@@ -160,12 +160,12 @@ export type CustomerIndividualGroupByArgs<ExtArgs extends runtime.Types.Extensio
|
||||
}
|
||||
|
||||
export type CustomerIndividualGroupByOutputType = {
|
||||
customer_id: string
|
||||
first_name: string
|
||||
last_name: string
|
||||
national_id: string
|
||||
postal_code: string
|
||||
economic_code: string | null
|
||||
customer_id: string
|
||||
complex_id: string
|
||||
_count: CustomerIndividualCountAggregateOutputType | null
|
||||
_min: CustomerIndividualMinAggregateOutputType | null
|
||||
@@ -191,24 +191,24 @@ export type CustomerIndividualWhereInput = {
|
||||
AND?: Prisma.CustomerIndividualWhereInput | Prisma.CustomerIndividualWhereInput[]
|
||||
OR?: Prisma.CustomerIndividualWhereInput[]
|
||||
NOT?: Prisma.CustomerIndividualWhereInput | Prisma.CustomerIndividualWhereInput[]
|
||||
customer_id?: Prisma.StringFilter<"CustomerIndividual"> | string
|
||||
first_name?: Prisma.StringFilter<"CustomerIndividual"> | string
|
||||
last_name?: Prisma.StringFilter<"CustomerIndividual"> | string
|
||||
national_id?: Prisma.StringFilter<"CustomerIndividual"> | string
|
||||
postal_code?: Prisma.StringFilter<"CustomerIndividual"> | string
|
||||
economic_code?: Prisma.StringNullableFilter<"CustomerIndividual"> | string | null
|
||||
customer_id?: Prisma.StringFilter<"CustomerIndividual"> | string
|
||||
complex_id?: Prisma.StringFilter<"CustomerIndividual"> | string
|
||||
customer?: Prisma.XOR<Prisma.CustomerScalarRelationFilter, Prisma.CustomerWhereInput>
|
||||
complex?: Prisma.XOR<Prisma.ComplexScalarRelationFilter, Prisma.ComplexWhereInput>
|
||||
}
|
||||
|
||||
export type CustomerIndividualOrderByWithRelationInput = {
|
||||
customer_id?: Prisma.SortOrder
|
||||
first_name?: Prisma.SortOrder
|
||||
last_name?: Prisma.SortOrder
|
||||
national_id?: Prisma.SortOrder
|
||||
postal_code?: Prisma.SortOrder
|
||||
economic_code?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
customer_id?: Prisma.SortOrder
|
||||
complex_id?: Prisma.SortOrder
|
||||
customer?: Prisma.CustomerOrderByWithRelationInput
|
||||
complex?: Prisma.ComplexOrderByWithRelationInput
|
||||
@@ -232,12 +232,12 @@ export type CustomerIndividualWhereUniqueInput = Prisma.AtLeast<{
|
||||
}, "customer_id" | "complex_id_national_id">
|
||||
|
||||
export type CustomerIndividualOrderByWithAggregationInput = {
|
||||
customer_id?: Prisma.SortOrder
|
||||
first_name?: Prisma.SortOrder
|
||||
last_name?: Prisma.SortOrder
|
||||
national_id?: Prisma.SortOrder
|
||||
postal_code?: Prisma.SortOrder
|
||||
economic_code?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
customer_id?: Prisma.SortOrder
|
||||
complex_id?: Prisma.SortOrder
|
||||
_count?: Prisma.CustomerIndividualCountOrderByAggregateInput
|
||||
_max?: Prisma.CustomerIndividualMaxOrderByAggregateInput
|
||||
@@ -248,12 +248,12 @@ export type CustomerIndividualScalarWhereWithAggregatesInput = {
|
||||
AND?: Prisma.CustomerIndividualScalarWhereWithAggregatesInput | Prisma.CustomerIndividualScalarWhereWithAggregatesInput[]
|
||||
OR?: Prisma.CustomerIndividualScalarWhereWithAggregatesInput[]
|
||||
NOT?: Prisma.CustomerIndividualScalarWhereWithAggregatesInput | Prisma.CustomerIndividualScalarWhereWithAggregatesInput[]
|
||||
customer_id?: Prisma.StringWithAggregatesFilter<"CustomerIndividual"> | string
|
||||
first_name?: Prisma.StringWithAggregatesFilter<"CustomerIndividual"> | string
|
||||
last_name?: Prisma.StringWithAggregatesFilter<"CustomerIndividual"> | string
|
||||
national_id?: Prisma.StringWithAggregatesFilter<"CustomerIndividual"> | string
|
||||
postal_code?: Prisma.StringWithAggregatesFilter<"CustomerIndividual"> | string
|
||||
economic_code?: Prisma.StringNullableWithAggregatesFilter<"CustomerIndividual"> | string | null
|
||||
customer_id?: Prisma.StringWithAggregatesFilter<"CustomerIndividual"> | string
|
||||
complex_id?: Prisma.StringWithAggregatesFilter<"CustomerIndividual"> | string
|
||||
}
|
||||
|
||||
@@ -263,17 +263,17 @@ export type CustomerIndividualCreateInput = {
|
||||
national_id: string
|
||||
postal_code: string
|
||||
economic_code?: string | null
|
||||
customer: Prisma.CustomerCreateNestedOneWithoutCustomer_individualsInput
|
||||
customer: Prisma.CustomerCreateNestedOneWithoutCustomer_individualInput
|
||||
complex: Prisma.ComplexCreateNestedOneWithoutCustomerIndividualsInput
|
||||
}
|
||||
|
||||
export type CustomerIndividualUncheckedCreateInput = {
|
||||
customer_id: string
|
||||
first_name: string
|
||||
last_name: string
|
||||
national_id: string
|
||||
postal_code: string
|
||||
economic_code?: string | null
|
||||
customer_id: string
|
||||
complex_id: string
|
||||
}
|
||||
|
||||
@@ -283,27 +283,27 @@ export type CustomerIndividualUpdateInput = {
|
||||
national_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
postal_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
economic_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
customer?: Prisma.CustomerUpdateOneRequiredWithoutCustomer_individualsNestedInput
|
||||
customer?: Prisma.CustomerUpdateOneRequiredWithoutCustomer_individualNestedInput
|
||||
complex?: Prisma.ComplexUpdateOneRequiredWithoutCustomerIndividualsNestedInput
|
||||
}
|
||||
|
||||
export type CustomerIndividualUncheckedUpdateInput = {
|
||||
customer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
first_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
last_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
national_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
postal_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
economic_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
customer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
complex_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
}
|
||||
|
||||
export type CustomerIndividualCreateManyInput = {
|
||||
customer_id: string
|
||||
first_name: string
|
||||
last_name: string
|
||||
national_id: string
|
||||
postal_code: string
|
||||
economic_code?: string | null
|
||||
customer_id: string
|
||||
complex_id: string
|
||||
}
|
||||
|
||||
@@ -316,12 +316,12 @@ export type CustomerIndividualUpdateManyMutationInput = {
|
||||
}
|
||||
|
||||
export type CustomerIndividualUncheckedUpdateManyInput = {
|
||||
customer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
first_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
last_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
national_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
postal_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
economic_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
customer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
complex_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
}
|
||||
|
||||
@@ -352,32 +352,32 @@ export type CustomerIndividualComplex_idNational_idCompoundUniqueInput = {
|
||||
}
|
||||
|
||||
export type CustomerIndividualCountOrderByAggregateInput = {
|
||||
customer_id?: Prisma.SortOrder
|
||||
first_name?: Prisma.SortOrder
|
||||
last_name?: Prisma.SortOrder
|
||||
national_id?: Prisma.SortOrder
|
||||
postal_code?: Prisma.SortOrder
|
||||
economic_code?: Prisma.SortOrder
|
||||
customer_id?: Prisma.SortOrder
|
||||
complex_id?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type CustomerIndividualMaxOrderByAggregateInput = {
|
||||
customer_id?: Prisma.SortOrder
|
||||
first_name?: Prisma.SortOrder
|
||||
last_name?: Prisma.SortOrder
|
||||
national_id?: Prisma.SortOrder
|
||||
postal_code?: Prisma.SortOrder
|
||||
economic_code?: Prisma.SortOrder
|
||||
customer_id?: Prisma.SortOrder
|
||||
complex_id?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type CustomerIndividualMinOrderByAggregateInput = {
|
||||
customer_id?: Prisma.SortOrder
|
||||
first_name?: Prisma.SortOrder
|
||||
last_name?: Prisma.SortOrder
|
||||
national_id?: Prisma.SortOrder
|
||||
postal_code?: Prisma.SortOrder
|
||||
economic_code?: Prisma.SortOrder
|
||||
customer_id?: Prisma.SortOrder
|
||||
complex_id?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
@@ -461,16 +461,16 @@ export type CustomerIndividualCreateWithoutComplexInput = {
|
||||
national_id: string
|
||||
postal_code: string
|
||||
economic_code?: string | null
|
||||
customer: Prisma.CustomerCreateNestedOneWithoutCustomer_individualsInput
|
||||
customer: Prisma.CustomerCreateNestedOneWithoutCustomer_individualInput
|
||||
}
|
||||
|
||||
export type CustomerIndividualUncheckedCreateWithoutComplexInput = {
|
||||
customer_id: string
|
||||
first_name: string
|
||||
last_name: string
|
||||
national_id: string
|
||||
postal_code: string
|
||||
economic_code?: string | null
|
||||
customer_id: string
|
||||
}
|
||||
|
||||
export type CustomerIndividualCreateOrConnectWithoutComplexInput = {
|
||||
@@ -503,12 +503,12 @@ export type CustomerIndividualScalarWhereInput = {
|
||||
AND?: Prisma.CustomerIndividualScalarWhereInput | Prisma.CustomerIndividualScalarWhereInput[]
|
||||
OR?: Prisma.CustomerIndividualScalarWhereInput[]
|
||||
NOT?: Prisma.CustomerIndividualScalarWhereInput | Prisma.CustomerIndividualScalarWhereInput[]
|
||||
customer_id?: Prisma.StringFilter<"CustomerIndividual"> | string
|
||||
first_name?: Prisma.StringFilter<"CustomerIndividual"> | string
|
||||
last_name?: Prisma.StringFilter<"CustomerIndividual"> | string
|
||||
national_id?: Prisma.StringFilter<"CustomerIndividual"> | string
|
||||
postal_code?: Prisma.StringFilter<"CustomerIndividual"> | string
|
||||
economic_code?: Prisma.StringNullableFilter<"CustomerIndividual"> | string | null
|
||||
customer_id?: Prisma.StringFilter<"CustomerIndividual"> | string
|
||||
complex_id?: Prisma.StringFilter<"CustomerIndividual"> | string
|
||||
}
|
||||
|
||||
@@ -565,12 +565,12 @@ export type CustomerIndividualUncheckedUpdateWithoutCustomerInput = {
|
||||
}
|
||||
|
||||
export type CustomerIndividualCreateManyComplexInput = {
|
||||
customer_id: string
|
||||
first_name: string
|
||||
last_name: string
|
||||
national_id: string
|
||||
postal_code: string
|
||||
economic_code?: string | null
|
||||
customer_id: string
|
||||
}
|
||||
|
||||
export type CustomerIndividualUpdateWithoutComplexInput = {
|
||||
@@ -579,36 +579,36 @@ export type CustomerIndividualUpdateWithoutComplexInput = {
|
||||
national_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
postal_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
economic_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
customer?: Prisma.CustomerUpdateOneRequiredWithoutCustomer_individualsNestedInput
|
||||
customer?: Prisma.CustomerUpdateOneRequiredWithoutCustomer_individualNestedInput
|
||||
}
|
||||
|
||||
export type CustomerIndividualUncheckedUpdateWithoutComplexInput = {
|
||||
customer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
first_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
last_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
national_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
postal_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
economic_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
customer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
}
|
||||
|
||||
export type CustomerIndividualUncheckedUpdateManyWithoutComplexInput = {
|
||||
customer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
first_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
last_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
national_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
postal_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
economic_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
customer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
}
|
||||
|
||||
|
||||
|
||||
export type CustomerIndividualSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
||||
customer_id?: boolean
|
||||
first_name?: boolean
|
||||
last_name?: boolean
|
||||
national_id?: boolean
|
||||
postal_code?: boolean
|
||||
economic_code?: boolean
|
||||
customer_id?: boolean
|
||||
complex_id?: boolean
|
||||
customer?: boolean | Prisma.CustomerDefaultArgs<ExtArgs>
|
||||
complex?: boolean | Prisma.ComplexDefaultArgs<ExtArgs>
|
||||
@@ -617,16 +617,16 @@ export type CustomerIndividualSelect<ExtArgs extends runtime.Types.Extensions.In
|
||||
|
||||
|
||||
export type CustomerIndividualSelectScalar = {
|
||||
customer_id?: boolean
|
||||
first_name?: boolean
|
||||
last_name?: boolean
|
||||
national_id?: boolean
|
||||
postal_code?: boolean
|
||||
economic_code?: boolean
|
||||
customer_id?: boolean
|
||||
complex_id?: boolean
|
||||
}
|
||||
|
||||
export type CustomerIndividualOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"customer_id" | "first_name" | "last_name" | "national_id" | "postal_code" | "economic_code" | "complex_id", ExtArgs["result"]["customerIndividual"]>
|
||||
export type CustomerIndividualOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"first_name" | "last_name" | "national_id" | "postal_code" | "economic_code" | "customer_id" | "complex_id", ExtArgs["result"]["customerIndividual"]>
|
||||
export type CustomerIndividualInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
customer?: boolean | Prisma.CustomerDefaultArgs<ExtArgs>
|
||||
complex?: boolean | Prisma.ComplexDefaultArgs<ExtArgs>
|
||||
@@ -639,12 +639,12 @@ export type $CustomerIndividualPayload<ExtArgs extends runtime.Types.Extensions.
|
||||
complex: Prisma.$ComplexPayload<ExtArgs>
|
||||
}
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
customer_id: string
|
||||
first_name: string
|
||||
last_name: string
|
||||
national_id: string
|
||||
postal_code: string
|
||||
economic_code: string | null
|
||||
customer_id: string
|
||||
complex_id: string
|
||||
}, ExtArgs["result"]["customerIndividual"]>
|
||||
composites: {}
|
||||
@@ -729,8 +729,8 @@ export interface CustomerIndividualDelegate<ExtArgs extends runtime.Types.Extens
|
||||
* // Get first 10 CustomerIndividuals
|
||||
* const customerIndividuals = await prisma.customerIndividual.findMany({ take: 10 })
|
||||
*
|
||||
* // Only select the `customer_id`
|
||||
* const customerIndividualWithCustomer_idOnly = await prisma.customerIndividual.findMany({ select: { customer_id: true } })
|
||||
* // Only select the `first_name`
|
||||
* const customerIndividualWithFirst_nameOnly = await prisma.customerIndividual.findMany({ select: { first_name: true } })
|
||||
*
|
||||
*/
|
||||
findMany<T extends CustomerIndividualFindManyArgs>(args?: Prisma.SelectSubset<T, CustomerIndividualFindManyArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$CustomerIndividualPayload<ExtArgs>, T, "findMany", GlobalOmitOptions>>
|
||||
@@ -1017,12 +1017,12 @@ export interface Prisma__CustomerIndividualClient<T, Null = never, ExtArgs exten
|
||||
* Fields of the CustomerIndividual model
|
||||
*/
|
||||
export interface CustomerIndividualFieldRefs {
|
||||
readonly customer_id: Prisma.FieldRef<"CustomerIndividual", 'String'>
|
||||
readonly first_name: Prisma.FieldRef<"CustomerIndividual", 'String'>
|
||||
readonly last_name: Prisma.FieldRef<"CustomerIndividual", 'String'>
|
||||
readonly national_id: Prisma.FieldRef<"CustomerIndividual", 'String'>
|
||||
readonly postal_code: Prisma.FieldRef<"CustomerIndividual", 'String'>
|
||||
readonly economic_code: Prisma.FieldRef<"CustomerIndividual", 'String'>
|
||||
readonly customer_id: Prisma.FieldRef<"CustomerIndividual", 'String'>
|
||||
readonly complex_id: Prisma.FieldRef<"CustomerIndividual", 'String'>
|
||||
}
|
||||
|
||||
|
||||
@@ -25,58 +25,58 @@ export type AggregateCustomerLegal = {
|
||||
}
|
||||
|
||||
export type CustomerLegalMinAggregateOutputType = {
|
||||
customer_id: string | null
|
||||
company_name: string | null
|
||||
economic_code: string | null
|
||||
registration_number: string | null
|
||||
postal_code: string | null
|
||||
customer_id: string | null
|
||||
complex_id: string | null
|
||||
}
|
||||
|
||||
export type CustomerLegalMaxAggregateOutputType = {
|
||||
customer_id: string | null
|
||||
company_name: string | null
|
||||
economic_code: string | null
|
||||
registration_number: string | null
|
||||
postal_code: string | null
|
||||
customer_id: string | null
|
||||
complex_id: string | null
|
||||
}
|
||||
|
||||
export type CustomerLegalCountAggregateOutputType = {
|
||||
customer_id: number
|
||||
company_name: number
|
||||
economic_code: number
|
||||
registration_number: number
|
||||
postal_code: number
|
||||
customer_id: number
|
||||
complex_id: number
|
||||
_all: number
|
||||
}
|
||||
|
||||
|
||||
export type CustomerLegalMinAggregateInputType = {
|
||||
customer_id?: true
|
||||
company_name?: true
|
||||
economic_code?: true
|
||||
registration_number?: true
|
||||
postal_code?: true
|
||||
customer_id?: true
|
||||
complex_id?: true
|
||||
}
|
||||
|
||||
export type CustomerLegalMaxAggregateInputType = {
|
||||
customer_id?: true
|
||||
company_name?: true
|
||||
economic_code?: true
|
||||
registration_number?: true
|
||||
postal_code?: true
|
||||
customer_id?: true
|
||||
complex_id?: true
|
||||
}
|
||||
|
||||
export type CustomerLegalCountAggregateInputType = {
|
||||
customer_id?: true
|
||||
company_name?: true
|
||||
economic_code?: true
|
||||
registration_number?: true
|
||||
postal_code?: true
|
||||
customer_id?: true
|
||||
complex_id?: true
|
||||
_all?: true
|
||||
}
|
||||
@@ -154,11 +154,11 @@ export type CustomerLegalGroupByArgs<ExtArgs extends runtime.Types.Extensions.In
|
||||
}
|
||||
|
||||
export type CustomerLegalGroupByOutputType = {
|
||||
customer_id: string
|
||||
company_name: string
|
||||
economic_code: string
|
||||
registration_number: string
|
||||
postal_code: string
|
||||
customer_id: string
|
||||
complex_id: string
|
||||
_count: CustomerLegalCountAggregateOutputType | null
|
||||
_min: CustomerLegalMinAggregateOutputType | null
|
||||
@@ -184,22 +184,22 @@ export type CustomerLegalWhereInput = {
|
||||
AND?: Prisma.CustomerLegalWhereInput | Prisma.CustomerLegalWhereInput[]
|
||||
OR?: Prisma.CustomerLegalWhereInput[]
|
||||
NOT?: Prisma.CustomerLegalWhereInput | Prisma.CustomerLegalWhereInput[]
|
||||
customer_id?: Prisma.StringFilter<"CustomerLegal"> | string
|
||||
company_name?: Prisma.StringFilter<"CustomerLegal"> | string
|
||||
economic_code?: Prisma.StringFilter<"CustomerLegal"> | string
|
||||
registration_number?: Prisma.StringFilter<"CustomerLegal"> | string
|
||||
postal_code?: Prisma.StringFilter<"CustomerLegal"> | string
|
||||
customer_id?: Prisma.StringFilter<"CustomerLegal"> | string
|
||||
complex_id?: Prisma.StringFilter<"CustomerLegal"> | string
|
||||
customer?: Prisma.XOR<Prisma.CustomerScalarRelationFilter, Prisma.CustomerWhereInput>
|
||||
complex?: Prisma.XOR<Prisma.ComplexScalarRelationFilter, Prisma.ComplexWhereInput>
|
||||
}
|
||||
|
||||
export type CustomerLegalOrderByWithRelationInput = {
|
||||
customer_id?: Prisma.SortOrder
|
||||
company_name?: Prisma.SortOrder
|
||||
economic_code?: Prisma.SortOrder
|
||||
registration_number?: Prisma.SortOrder
|
||||
postal_code?: Prisma.SortOrder
|
||||
customer_id?: Prisma.SortOrder
|
||||
complex_id?: Prisma.SortOrder
|
||||
customer?: Prisma.CustomerOrderByWithRelationInput
|
||||
complex?: Prisma.ComplexOrderByWithRelationInput
|
||||
@@ -222,11 +222,11 @@ export type CustomerLegalWhereUniqueInput = Prisma.AtLeast<{
|
||||
}, "customer_id" | "complex_id_registration_number">
|
||||
|
||||
export type CustomerLegalOrderByWithAggregationInput = {
|
||||
customer_id?: Prisma.SortOrder
|
||||
company_name?: Prisma.SortOrder
|
||||
economic_code?: Prisma.SortOrder
|
||||
registration_number?: Prisma.SortOrder
|
||||
postal_code?: Prisma.SortOrder
|
||||
customer_id?: Prisma.SortOrder
|
||||
complex_id?: Prisma.SortOrder
|
||||
_count?: Prisma.CustomerLegalCountOrderByAggregateInput
|
||||
_max?: Prisma.CustomerLegalMaxOrderByAggregateInput
|
||||
@@ -237,11 +237,11 @@ export type CustomerLegalScalarWhereWithAggregatesInput = {
|
||||
AND?: Prisma.CustomerLegalScalarWhereWithAggregatesInput | Prisma.CustomerLegalScalarWhereWithAggregatesInput[]
|
||||
OR?: Prisma.CustomerLegalScalarWhereWithAggregatesInput[]
|
||||
NOT?: Prisma.CustomerLegalScalarWhereWithAggregatesInput | Prisma.CustomerLegalScalarWhereWithAggregatesInput[]
|
||||
customer_id?: Prisma.StringWithAggregatesFilter<"CustomerLegal"> | string
|
||||
company_name?: Prisma.StringWithAggregatesFilter<"CustomerLegal"> | string
|
||||
economic_code?: Prisma.StringWithAggregatesFilter<"CustomerLegal"> | string
|
||||
registration_number?: Prisma.StringWithAggregatesFilter<"CustomerLegal"> | string
|
||||
postal_code?: Prisma.StringWithAggregatesFilter<"CustomerLegal"> | string
|
||||
customer_id?: Prisma.StringWithAggregatesFilter<"CustomerLegal"> | string
|
||||
complex_id?: Prisma.StringWithAggregatesFilter<"CustomerLegal"> | string
|
||||
}
|
||||
|
||||
@@ -250,16 +250,16 @@ export type CustomerLegalCreateInput = {
|
||||
economic_code: string
|
||||
registration_number: string
|
||||
postal_code: string
|
||||
customer: Prisma.CustomerCreateNestedOneWithoutCustomer_legalsInput
|
||||
customer: Prisma.CustomerCreateNestedOneWithoutCustomer_legalInput
|
||||
complex: Prisma.ComplexCreateNestedOneWithoutCustomerLegalsInput
|
||||
}
|
||||
|
||||
export type CustomerLegalUncheckedCreateInput = {
|
||||
customer_id: string
|
||||
company_name: string
|
||||
economic_code: string
|
||||
registration_number: string
|
||||
postal_code: string
|
||||
customer_id: string
|
||||
complex_id: string
|
||||
}
|
||||
|
||||
@@ -268,25 +268,25 @@ export type CustomerLegalUpdateInput = {
|
||||
economic_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
registration_number?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
postal_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
customer?: Prisma.CustomerUpdateOneRequiredWithoutCustomer_legalsNestedInput
|
||||
customer?: Prisma.CustomerUpdateOneRequiredWithoutCustomer_legalNestedInput
|
||||
complex?: Prisma.ComplexUpdateOneRequiredWithoutCustomerLegalsNestedInput
|
||||
}
|
||||
|
||||
export type CustomerLegalUncheckedUpdateInput = {
|
||||
customer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
company_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
economic_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
registration_number?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
postal_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
customer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
complex_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
}
|
||||
|
||||
export type CustomerLegalCreateManyInput = {
|
||||
customer_id: string
|
||||
company_name: string
|
||||
economic_code: string
|
||||
registration_number: string
|
||||
postal_code: string
|
||||
customer_id: string
|
||||
complex_id: string
|
||||
}
|
||||
|
||||
@@ -298,11 +298,11 @@ export type CustomerLegalUpdateManyMutationInput = {
|
||||
}
|
||||
|
||||
export type CustomerLegalUncheckedUpdateManyInput = {
|
||||
customer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
company_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
economic_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
registration_number?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
postal_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
customer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
complex_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
}
|
||||
|
||||
@@ -333,29 +333,29 @@ export type CustomerLegalComplex_idRegistration_numberCompoundUniqueInput = {
|
||||
}
|
||||
|
||||
export type CustomerLegalCountOrderByAggregateInput = {
|
||||
customer_id?: Prisma.SortOrder
|
||||
company_name?: Prisma.SortOrder
|
||||
economic_code?: Prisma.SortOrder
|
||||
registration_number?: Prisma.SortOrder
|
||||
postal_code?: Prisma.SortOrder
|
||||
customer_id?: Prisma.SortOrder
|
||||
complex_id?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type CustomerLegalMaxOrderByAggregateInput = {
|
||||
customer_id?: Prisma.SortOrder
|
||||
company_name?: Prisma.SortOrder
|
||||
economic_code?: Prisma.SortOrder
|
||||
registration_number?: Prisma.SortOrder
|
||||
postal_code?: Prisma.SortOrder
|
||||
customer_id?: Prisma.SortOrder
|
||||
complex_id?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type CustomerLegalMinOrderByAggregateInput = {
|
||||
customer_id?: Prisma.SortOrder
|
||||
company_name?: Prisma.SortOrder
|
||||
economic_code?: Prisma.SortOrder
|
||||
registration_number?: Prisma.SortOrder
|
||||
postal_code?: Prisma.SortOrder
|
||||
customer_id?: Prisma.SortOrder
|
||||
complex_id?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
@@ -438,15 +438,15 @@ export type CustomerLegalCreateWithoutComplexInput = {
|
||||
economic_code: string
|
||||
registration_number: string
|
||||
postal_code: string
|
||||
customer: Prisma.CustomerCreateNestedOneWithoutCustomer_legalsInput
|
||||
customer: Prisma.CustomerCreateNestedOneWithoutCustomer_legalInput
|
||||
}
|
||||
|
||||
export type CustomerLegalUncheckedCreateWithoutComplexInput = {
|
||||
customer_id: string
|
||||
company_name: string
|
||||
economic_code: string
|
||||
registration_number: string
|
||||
postal_code: string
|
||||
customer_id: string
|
||||
}
|
||||
|
||||
export type CustomerLegalCreateOrConnectWithoutComplexInput = {
|
||||
@@ -479,11 +479,11 @@ export type CustomerLegalScalarWhereInput = {
|
||||
AND?: Prisma.CustomerLegalScalarWhereInput | Prisma.CustomerLegalScalarWhereInput[]
|
||||
OR?: Prisma.CustomerLegalScalarWhereInput[]
|
||||
NOT?: Prisma.CustomerLegalScalarWhereInput | Prisma.CustomerLegalScalarWhereInput[]
|
||||
customer_id?: Prisma.StringFilter<"CustomerLegal"> | string
|
||||
company_name?: Prisma.StringFilter<"CustomerLegal"> | string
|
||||
economic_code?: Prisma.StringFilter<"CustomerLegal"> | string
|
||||
registration_number?: Prisma.StringFilter<"CustomerLegal"> | string
|
||||
postal_code?: Prisma.StringFilter<"CustomerLegal"> | string
|
||||
customer_id?: Prisma.StringFilter<"CustomerLegal"> | string
|
||||
complex_id?: Prisma.StringFilter<"CustomerLegal"> | string
|
||||
}
|
||||
|
||||
@@ -536,11 +536,11 @@ export type CustomerLegalUncheckedUpdateWithoutCustomerInput = {
|
||||
}
|
||||
|
||||
export type CustomerLegalCreateManyComplexInput = {
|
||||
customer_id: string
|
||||
company_name: string
|
||||
economic_code: string
|
||||
registration_number: string
|
||||
postal_code: string
|
||||
customer_id: string
|
||||
}
|
||||
|
||||
export type CustomerLegalUpdateWithoutComplexInput = {
|
||||
@@ -548,33 +548,33 @@ export type CustomerLegalUpdateWithoutComplexInput = {
|
||||
economic_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
registration_number?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
postal_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
customer?: Prisma.CustomerUpdateOneRequiredWithoutCustomer_legalsNestedInput
|
||||
customer?: Prisma.CustomerUpdateOneRequiredWithoutCustomer_legalNestedInput
|
||||
}
|
||||
|
||||
export type CustomerLegalUncheckedUpdateWithoutComplexInput = {
|
||||
customer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
company_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
economic_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
registration_number?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
postal_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
customer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
}
|
||||
|
||||
export type CustomerLegalUncheckedUpdateManyWithoutComplexInput = {
|
||||
customer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
company_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
economic_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
registration_number?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
postal_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
customer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
}
|
||||
|
||||
|
||||
|
||||
export type CustomerLegalSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
||||
customer_id?: boolean
|
||||
company_name?: boolean
|
||||
economic_code?: boolean
|
||||
registration_number?: boolean
|
||||
postal_code?: boolean
|
||||
customer_id?: boolean
|
||||
complex_id?: boolean
|
||||
customer?: boolean | Prisma.CustomerDefaultArgs<ExtArgs>
|
||||
complex?: boolean | Prisma.ComplexDefaultArgs<ExtArgs>
|
||||
@@ -583,15 +583,15 @@ export type CustomerLegalSelect<ExtArgs extends runtime.Types.Extensions.Interna
|
||||
|
||||
|
||||
export type CustomerLegalSelectScalar = {
|
||||
customer_id?: boolean
|
||||
company_name?: boolean
|
||||
economic_code?: boolean
|
||||
registration_number?: boolean
|
||||
postal_code?: boolean
|
||||
customer_id?: boolean
|
||||
complex_id?: boolean
|
||||
}
|
||||
|
||||
export type CustomerLegalOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"customer_id" | "company_name" | "economic_code" | "registration_number" | "postal_code" | "complex_id", ExtArgs["result"]["customerLegal"]>
|
||||
export type CustomerLegalOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"company_name" | "economic_code" | "registration_number" | "postal_code" | "customer_id" | "complex_id", ExtArgs["result"]["customerLegal"]>
|
||||
export type CustomerLegalInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
customer?: boolean | Prisma.CustomerDefaultArgs<ExtArgs>
|
||||
complex?: boolean | Prisma.ComplexDefaultArgs<ExtArgs>
|
||||
@@ -604,11 +604,11 @@ export type $CustomerLegalPayload<ExtArgs extends runtime.Types.Extensions.Inter
|
||||
complex: Prisma.$ComplexPayload<ExtArgs>
|
||||
}
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
customer_id: string
|
||||
company_name: string
|
||||
economic_code: string
|
||||
registration_number: string
|
||||
postal_code: string
|
||||
customer_id: string
|
||||
complex_id: string
|
||||
}, ExtArgs["result"]["customerLegal"]>
|
||||
composites: {}
|
||||
@@ -693,8 +693,8 @@ export interface CustomerLegalDelegate<ExtArgs extends runtime.Types.Extensions.
|
||||
* // Get first 10 CustomerLegals
|
||||
* const customerLegals = await prisma.customerLegal.findMany({ take: 10 })
|
||||
*
|
||||
* // Only select the `customer_id`
|
||||
* const customerLegalWithCustomer_idOnly = await prisma.customerLegal.findMany({ select: { customer_id: true } })
|
||||
* // Only select the `company_name`
|
||||
* const customerLegalWithCompany_nameOnly = await prisma.customerLegal.findMany({ select: { company_name: true } })
|
||||
*
|
||||
*/
|
||||
findMany<T extends CustomerLegalFindManyArgs>(args?: Prisma.SelectSubset<T, CustomerLegalFindManyArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$CustomerLegalPayload<ExtArgs>, T, "findMany", GlobalOmitOptions>>
|
||||
@@ -981,11 +981,11 @@ export interface Prisma__CustomerLegalClient<T, Null = never, ExtArgs extends ru
|
||||
* Fields of the CustomerLegal model
|
||||
*/
|
||||
export interface CustomerLegalFieldRefs {
|
||||
readonly customer_id: Prisma.FieldRef<"CustomerLegal", 'String'>
|
||||
readonly company_name: Prisma.FieldRef<"CustomerLegal", 'String'>
|
||||
readonly economic_code: Prisma.FieldRef<"CustomerLegal", 'String'>
|
||||
readonly registration_number: Prisma.FieldRef<"CustomerLegal", 'String'>
|
||||
readonly postal_code: Prisma.FieldRef<"CustomerLegal", 'String'>
|
||||
readonly customer_id: Prisma.FieldRef<"CustomerLegal", 'String'>
|
||||
readonly complex_id: Prisma.FieldRef<"CustomerLegal", 'String'>
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -71,7 +71,7 @@ export class SalesInvoicesService {
|
||||
customer: {
|
||||
select: {
|
||||
type: true,
|
||||
customer_individuals: {
|
||||
customer_individual: {
|
||||
select: {
|
||||
economic_code: true,
|
||||
first_name: true,
|
||||
@@ -80,7 +80,7 @@ export class SalesInvoicesService {
|
||||
national_id: true,
|
||||
},
|
||||
},
|
||||
customer_legals: {
|
||||
customer_legal: {
|
||||
select: {
|
||||
economic_code: true,
|
||||
postal_code: true,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ConsumerInfoInfo } from '@/common/decorators/consumerInfo.decorator'
|
||||
import { ConsumerInfo } from '@/common/decorators/consumerInfo.decorator'
|
||||
import { Controller, Get } from '@nestjs/common'
|
||||
import { ApiTags } from '@nestjs/swagger'
|
||||
import { ConsumerService } from './consumer.service'
|
||||
@@ -9,7 +9,7 @@ export class ConsumerController {
|
||||
constructor(private service: ConsumerService) {}
|
||||
|
||||
@Get('')
|
||||
async findOne(@ConsumerInfoInfo('user_id') userId: string) {
|
||||
async findOne(@ConsumerInfo('user_id') userId: string) {
|
||||
return this.service.getInfo(userId)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,10 +5,15 @@ import { ConsumerBusinessActivitiesModule } from './business-activities/business
|
||||
import { ConsumerController } from './consumer.controller'
|
||||
import { ConsumerMiddleware } from './consumer.middleware'
|
||||
import { ConsumerService } from './consumer.service'
|
||||
import { ConsumerCustomersModule } from './customers/customers.module'
|
||||
|
||||
@Module({
|
||||
controllers: [ConsumerController],
|
||||
imports: [ConsumerAccountsModule, ConsumerBusinessActivitiesModule],
|
||||
imports: [
|
||||
ConsumerAccountsModule,
|
||||
ConsumerBusinessActivitiesModule,
|
||||
ConsumerCustomersModule,
|
||||
],
|
||||
providers: [JwtService, ConsumerService],
|
||||
})
|
||||
export class ConsumerModule implements NestModule {
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
import { ConsumerInfo } from '@/common/decorators/consumerInfo.decorator'
|
||||
import { Body, Controller, Get, Param, Patch } from '@nestjs/common'
|
||||
import { consumerCustomersService } from './customers.service'
|
||||
import {
|
||||
UpdateCustomerIndividualDto,
|
||||
UpdateCustomerLegalDto,
|
||||
} from './dto/create-customers.dto'
|
||||
|
||||
@Controller('consumer/customers')
|
||||
export class consumerCustomersController {
|
||||
constructor(private readonly service: consumerCustomersService) {}
|
||||
|
||||
@Get()
|
||||
async findAll(@ConsumerInfo('user_id') userId: string) {
|
||||
return this.service.findAll(userId)
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
async findOne(@ConsumerInfo('user_id') userId: string, @Param('id') id: string) {
|
||||
return this.service.findOne(userId, id)
|
||||
}
|
||||
|
||||
@Patch(':id/legal')
|
||||
async updateLegal(
|
||||
@ConsumerInfo('user_id') userId: string,
|
||||
@Param('id') id: string,
|
||||
@Body() data: UpdateCustomerLegalDto,
|
||||
) {
|
||||
return this.service.updateLegal(userId, id, data)
|
||||
}
|
||||
|
||||
@Patch(':id/individual')
|
||||
async updateIndividual(
|
||||
@ConsumerInfo('user_id') userId: string,
|
||||
@Param('id') id: string,
|
||||
@Body() data: UpdateCustomerIndividualDto,
|
||||
) {
|
||||
return this.service.updateIndividual(userId, id, data)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
import { PrismaModule } from '@/prisma/prisma.module'
|
||||
import { Module } from '@nestjs/common'
|
||||
import { consumerCustomersController } from './customers.controller'
|
||||
import { consumerCustomersService } from './customers.service'
|
||||
import { ConsumerSaleInvoicesModule } from './sale-invoices/sale-invoices.module'
|
||||
|
||||
@Module({
|
||||
imports: [PrismaModule, ConsumerSaleInvoicesModule],
|
||||
controllers: [consumerCustomersController],
|
||||
providers: [consumerCustomersService],
|
||||
})
|
||||
export class ConsumerCustomersModule {}
|
||||
@@ -0,0 +1,145 @@
|
||||
import { CustomerSelect, CustomerWhereInput } from '@/generated/prisma/models'
|
||||
import { PrismaService } from '@/prisma/prisma.service'
|
||||
import { Injectable } from '@nestjs/common'
|
||||
import { ResponseMapper } from 'common/response/response-mapper'
|
||||
import {
|
||||
UpdateCustomerIndividualDto,
|
||||
UpdateCustomerLegalDto,
|
||||
} from './dto/create-customers.dto'
|
||||
|
||||
@Injectable()
|
||||
export class consumerCustomersService {
|
||||
constructor(private readonly prisma: PrismaService) {}
|
||||
|
||||
defaultSelect: CustomerSelect = {
|
||||
id: true,
|
||||
type: true,
|
||||
is_favorite: true,
|
||||
created_at: true,
|
||||
customer_individual: {
|
||||
select: {
|
||||
first_name: true,
|
||||
last_name: true,
|
||||
national_id: true,
|
||||
postal_code: true,
|
||||
economic_code: true,
|
||||
},
|
||||
},
|
||||
customer_legal: {
|
||||
select: {
|
||||
company_name: true,
|
||||
registration_number: true,
|
||||
postal_code: true,
|
||||
economic_code: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
private defaultWhere(user_id: string): CustomerWhereInput {
|
||||
return {
|
||||
OR: [
|
||||
{
|
||||
customer_individual: {
|
||||
complex: {
|
||||
business_activity: {
|
||||
user_id,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
customer_legal: {
|
||||
complex: {
|
||||
business_activity: {
|
||||
user_id,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
}
|
||||
|
||||
async findAll(user_id: string, page = 1, pageSize = 10) {
|
||||
const [customers, count] = await this.prisma.$transaction(async tx => [
|
||||
await tx.customer.findMany({
|
||||
where: this.defaultWhere(user_id),
|
||||
select: this.defaultSelect,
|
||||
skip: (page - 1) * pageSize,
|
||||
take: 10,
|
||||
}),
|
||||
await tx.customer.count({
|
||||
where: this.defaultWhere(user_id),
|
||||
}),
|
||||
])
|
||||
return ResponseMapper.paginate(customers, { count, page, pageSize })
|
||||
}
|
||||
|
||||
async findOne(user_id: string, customer_id: string) {
|
||||
const customer = await this.prisma.customer.findUniqueOrThrow({
|
||||
where: {
|
||||
...this.defaultWhere(user_id),
|
||||
id: customer_id,
|
||||
},
|
||||
select: this.defaultSelect,
|
||||
})
|
||||
|
||||
console.log(customer)
|
||||
|
||||
return ResponseMapper.single(customer)
|
||||
}
|
||||
|
||||
async updateLegal(user_id: string, customer_id: string, data: UpdateCustomerLegalDto) {
|
||||
const customer = await this.prisma.customer.update({
|
||||
where: {
|
||||
id: customer_id,
|
||||
customer_legal: {
|
||||
complex: {
|
||||
business_activity: {
|
||||
user_id,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
data: {
|
||||
is_favorite: data.is_favorite,
|
||||
customer_legal: {
|
||||
update: {
|
||||
...data,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
return ResponseMapper.update(customer)
|
||||
}
|
||||
|
||||
async updateIndividual(
|
||||
user_id: string,
|
||||
customer_id: string,
|
||||
data: UpdateCustomerIndividualDto,
|
||||
) {
|
||||
const customer = await this.prisma.customer.update({
|
||||
where: {
|
||||
id: customer_id,
|
||||
customer_individual: {
|
||||
complex: {
|
||||
business_activity: {
|
||||
user_id,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
data: {
|
||||
is_favorite: data.is_favorite,
|
||||
|
||||
customer_individual: {
|
||||
update: {
|
||||
...data,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
return ResponseMapper.update(customer)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
import { ApiProperty } from '@nestjs/swagger'
|
||||
import {
|
||||
IsBoolean,
|
||||
IsNumber,
|
||||
IsOptional,
|
||||
IsString,
|
||||
MaxLength,
|
||||
MinLength,
|
||||
} from 'class-validator'
|
||||
|
||||
export class UpdateCustomerLegalDto {
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
@ApiProperty({ required: true })
|
||||
company_name?: string
|
||||
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
@ApiProperty({ required: true })
|
||||
economic_code?: string
|
||||
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
@ApiProperty({ required: true })
|
||||
registration_number?: string
|
||||
|
||||
@IsNumber()
|
||||
@MaxLength(10)
|
||||
@MinLength(10)
|
||||
@IsOptional()
|
||||
@ApiProperty({ maxLength: 10, minLength: 10 })
|
||||
postal_code?: string
|
||||
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
@ApiProperty({ required: false })
|
||||
is_favorite?: boolean
|
||||
}
|
||||
|
||||
export class UpdateCustomerIndividualDto {
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
@ApiProperty({ required: true })
|
||||
first_name?: string
|
||||
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
@ApiProperty({ required: true })
|
||||
last_name?: string
|
||||
|
||||
@IsNumber()
|
||||
@MaxLength(10)
|
||||
@MinLength(10)
|
||||
@IsOptional()
|
||||
@ApiProperty({ required: true, maxLength: 10, minLength: 10 })
|
||||
national_code?: string
|
||||
|
||||
@IsNumber()
|
||||
@MaxLength(10)
|
||||
@MinLength(10)
|
||||
@IsOptional()
|
||||
@ApiProperty({ maxLength: 10, minLength: 10 })
|
||||
postal_code?: string
|
||||
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
@ApiProperty({ required: false })
|
||||
is_favorite?: boolean
|
||||
|
||||
@IsNumber()
|
||||
@IsOptional()
|
||||
@ApiProperty({ required: false })
|
||||
economic_code?: string
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
import { TokenAccount } from '@/common/decorators/tokenInfo.decorator'
|
||||
import { Controller, Get, Param } from '@nestjs/common'
|
||||
import { ApiTags } from '@nestjs/swagger'
|
||||
import { CustomerSaleInvoicesService } from './sale-invoices.service'
|
||||
|
||||
@ApiTags('customerSaleInvoices')
|
||||
@Controller('consumer/customers/:customerId/sale-invoices')
|
||||
export class CustomerSaleInvoicesController {
|
||||
constructor(private readonly service: CustomerSaleInvoicesService) {}
|
||||
|
||||
@Get()
|
||||
async findAll(
|
||||
@TokenAccount('userId') userId: string,
|
||||
@Param('customerId') customerId: string,
|
||||
) {
|
||||
return this.service.findAll(userId, customerId)
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
async findOne(
|
||||
@TokenAccount('userId') userId: string,
|
||||
@Param('customerId') customerId: string,
|
||||
@Param('id') id: string,
|
||||
) {
|
||||
return this.service.findOne(userId, customerId, id)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import { PrismaModule } from '@/prisma/prisma.module'
|
||||
import { Module } from '@nestjs/common'
|
||||
import { CustomerSaleInvoicesController } from './sale-invoices.controller'
|
||||
import { CustomerSaleInvoicesService } from './sale-invoices.service'
|
||||
|
||||
@Module({
|
||||
imports: [PrismaModule],
|
||||
controllers: [CustomerSaleInvoicesController],
|
||||
providers: [CustomerSaleInvoicesService],
|
||||
})
|
||||
export class ConsumerSaleInvoicesModule {}
|
||||
@@ -0,0 +1,152 @@
|
||||
import { SalesInvoiceSelect, SalesInvoiceWhereInput } from '@/generated/prisma/models'
|
||||
import { PrismaService } from '@/prisma/prisma.service'
|
||||
import { Injectable } from '@nestjs/common'
|
||||
import { ResponseMapper } from 'common/response/response-mapper'
|
||||
|
||||
@Injectable()
|
||||
export class CustomerSaleInvoicesService {
|
||||
constructor(private readonly prisma: PrismaService) {}
|
||||
|
||||
defaultSelect: SalesInvoiceSelect = {
|
||||
id: true,
|
||||
code: true,
|
||||
invoice_date: true,
|
||||
notes: true,
|
||||
total_amount: true,
|
||||
pos: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
complex: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
business_activity: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
account: {
|
||||
select: {
|
||||
role: true,
|
||||
user: {
|
||||
select: {
|
||||
first_name: true,
|
||||
last_name: true,
|
||||
},
|
||||
},
|
||||
account: {
|
||||
select: {
|
||||
username: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
created_at: true,
|
||||
}
|
||||
|
||||
async findAll(user_id: string, customer_id: string, page = 1, pageSize = 10) {
|
||||
const salesWhere: SalesInvoiceWhereInput = {
|
||||
customer_id,
|
||||
pos: {
|
||||
complex: {
|
||||
business_activity: {
|
||||
user_id,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
const [accounts, count] = await this.prisma.$transaction(async tx => [
|
||||
await tx.salesInvoice.findMany({
|
||||
where: salesWhere,
|
||||
select: {
|
||||
...this.defaultSelect,
|
||||
_count: {
|
||||
select: {
|
||||
items: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
skip: (page - 1) * pageSize,
|
||||
take: 10,
|
||||
}),
|
||||
await tx.salesInvoice.count({
|
||||
where: salesWhere,
|
||||
}),
|
||||
])
|
||||
|
||||
const mappedAccounts = accounts.map(account => {
|
||||
const { _count, ...rest } = account
|
||||
return {
|
||||
...rest,
|
||||
items_count: _count.items,
|
||||
}
|
||||
})
|
||||
|
||||
return ResponseMapper.paginate(mappedAccounts, {
|
||||
count,
|
||||
page,
|
||||
pageSize,
|
||||
})
|
||||
}
|
||||
|
||||
async findOne(user_id: string, customer_id: string, id: string) {
|
||||
const account = await this.prisma.salesInvoice.findUniqueOrThrow({
|
||||
where: {
|
||||
id,
|
||||
customer_id,
|
||||
pos: {
|
||||
complex: {
|
||||
business_activity: {
|
||||
user_id,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
select: {
|
||||
...this.defaultSelect,
|
||||
|
||||
items: {
|
||||
select: {
|
||||
id: true,
|
||||
notes: true,
|
||||
unit_price: true,
|
||||
discount: true,
|
||||
quantity: true,
|
||||
total_amount: true,
|
||||
payload: true,
|
||||
good: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
pricing_model: true,
|
||||
unit_type: true,
|
||||
category: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
image_url: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
payments: {
|
||||
select: {
|
||||
amount: true,
|
||||
paid_at: true,
|
||||
payment_method: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
return ResponseMapper.single(account)
|
||||
}
|
||||
}
|
||||
@@ -40,6 +40,8 @@ export class SalesInvoicesService {
|
||||
}
|
||||
|
||||
async create(data: CreateSalesInvoiceDto, posInfo: IPosPayload) {
|
||||
console.log(posInfo)
|
||||
|
||||
data.invoice_date = new Date(data.invoice_date).toISOString() as any
|
||||
|
||||
const { complex_id, pos_id, consumer_account_id } = posInfo
|
||||
|
||||
Reference in New Issue
Block a user