feat: add stock keeping unit management with create, update, and retrieval functionalities
- Implemented CreateStockKeepingUnitDto for creating stock keeping units. - Added StockKeepingUnitsService for handling business logic related to stock keeping units. - Created StockKeepingUnitsController to manage HTTP requests for stock keeping units. - Developed UpdateStockKeepingUnitDto for updating existing stock keeping units. - Introduced StockKeepingUnitsServiceFindAllResponseDto for response structure. - Established stock keeping units module for encapsulation of related components. feat: enhance sales invoice fiscal management with new endpoints - Created SalesInvoicesFilterDto for filtering sales invoices. - Implemented PosSalesInvoiceFiscalController for managing fiscal operations on sales invoices. - Developed PosSalesInvoiceFiscalService to handle fiscal logic and interactions. - Added methods for sending, retrying, and checking the status of fiscal invoices. - Integrated error handling and response mapping for fiscal operations.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { FiscalResponseStatus } from '@/generated/prisma/enums'
|
||||
|
||||
export default {
|
||||
PaymentMethodType: {
|
||||
TERMINAL: 'ترمینال',
|
||||
@@ -12,7 +14,6 @@ export default {
|
||||
COUNT: 'تعداد',
|
||||
GRAM: 'گرم',
|
||||
KILOGRAM: 'کیلوگرم',
|
||||
KILO_GRAM: 'کیلوگرم',
|
||||
LITER: 'لیتر',
|
||||
MILLILITER: 'میلیلیتر',
|
||||
METER: 'متر',
|
||||
@@ -96,6 +97,10 @@ export default {
|
||||
MANAGER: 'مدیریت',
|
||||
OPERATOR: 'اپراتور',
|
||||
},
|
||||
ComplexRole: {
|
||||
MANAGER: 'مدیریت',
|
||||
OPERATOR: 'اپراتور',
|
||||
},
|
||||
ConsumerRole: {
|
||||
OWNER: 'مدیر اصلی',
|
||||
MANAGER: 'مدیریت',
|
||||
@@ -135,6 +140,20 @@ export default {
|
||||
SUCCESS: 'موفق',
|
||||
FAILURE: 'ناموفق',
|
||||
NOT_SEND: 'ارسال نشده',
|
||||
[FiscalResponseStatus.QUEUED]: 'در صف ارسال',
|
||||
},
|
||||
FiscalRequestType: {
|
||||
MAIN: 'اصلی',
|
||||
UPDATE: 'اصلاح',
|
||||
REVOKE: 'ابطال',
|
||||
REMOVE: 'حذف',
|
||||
},
|
||||
FiscalInvoiceCustomerType: {
|
||||
Unknown: 'ناشناس',
|
||||
Known: 'شناسایی شده',
|
||||
},
|
||||
SKUGuildType: {
|
||||
GOLD: 'طلا',
|
||||
},
|
||||
GoldKarat: {
|
||||
KARAT_18: '۱۸ عیار',
|
||||
|
||||
+16
-13
@@ -1,22 +1,25 @@
|
||||
export enum TokenType {
|
||||
ACCESS = 'ACCESS',
|
||||
REFRESH = 'REFRESH',
|
||||
}
|
||||
|
||||
export enum AccountType {
|
||||
PARTNER = 'PARTNER',
|
||||
BUSINESS = 'BUSINESS',
|
||||
ADMIN = 'ADMIN',
|
||||
PROVIDER = 'PROVIDER',
|
||||
POS = 'POS',
|
||||
}
|
||||
|
||||
export enum GoldKarat {
|
||||
KARAT_18 = '18',
|
||||
KARAT_21 = '21',
|
||||
KARAT_24 = '24',
|
||||
}
|
||||
|
||||
export enum FiscalRequestType {
|
||||
MAIN = 'MAIN',
|
||||
UPDATE = 'UPDATE',
|
||||
REVOKE = 'REVOKE',
|
||||
REMOVE = 'REMOVE',
|
||||
}
|
||||
|
||||
export enum FiscalInvoiceCustomerType {
|
||||
Unknown = 'Unknown',
|
||||
Known = 'Known',
|
||||
}
|
||||
|
||||
export enum SKUGuildType {
|
||||
GOLD = 'GOLD',
|
||||
}
|
||||
|
||||
export const UploadedFileTypes = {
|
||||
GOOD: 'good',
|
||||
SERVICE: 'service',
|
||||
|
||||
@@ -167,6 +167,26 @@ export type Complex = Prisma.ComplexModel
|
||||
*
|
||||
*/
|
||||
export type Pos = Prisma.PosModel
|
||||
/**
|
||||
* Model Good
|
||||
*
|
||||
*/
|
||||
export type Good = Prisma.GoodModel
|
||||
/**
|
||||
* Model GoodCategory
|
||||
*
|
||||
*/
|
||||
export type GoodCategory = Prisma.GoodCategoryModel
|
||||
/**
|
||||
* Model MeasureUnits
|
||||
*
|
||||
*/
|
||||
export type MeasureUnits = Prisma.MeasureUnitsModel
|
||||
/**
|
||||
* Model StockKeepingUnits
|
||||
*
|
||||
*/
|
||||
export type StockKeepingUnits = Prisma.StockKeepingUnitsModel
|
||||
/**
|
||||
* Model TriggerLog
|
||||
*
|
||||
@@ -187,16 +207,6 @@ export type CustomerIndividual = Prisma.CustomerIndividualModel
|
||||
*
|
||||
*/
|
||||
export type CustomerLegal = Prisma.CustomerLegalModel
|
||||
/**
|
||||
* Model Good
|
||||
*
|
||||
*/
|
||||
export type Good = Prisma.GoodModel
|
||||
/**
|
||||
* Model GoodCategory
|
||||
*
|
||||
*/
|
||||
export type GoodCategory = Prisma.GoodCategoryModel
|
||||
/**
|
||||
* Model Guild
|
||||
*
|
||||
|
||||
@@ -189,6 +189,26 @@ export type Complex = Prisma.ComplexModel
|
||||
*
|
||||
*/
|
||||
export type Pos = Prisma.PosModel
|
||||
/**
|
||||
* Model Good
|
||||
*
|
||||
*/
|
||||
export type Good = Prisma.GoodModel
|
||||
/**
|
||||
* Model GoodCategory
|
||||
*
|
||||
*/
|
||||
export type GoodCategory = Prisma.GoodCategoryModel
|
||||
/**
|
||||
* Model MeasureUnits
|
||||
*
|
||||
*/
|
||||
export type MeasureUnits = Prisma.MeasureUnitsModel
|
||||
/**
|
||||
* Model StockKeepingUnits
|
||||
*
|
||||
*/
|
||||
export type StockKeepingUnits = Prisma.StockKeepingUnitsModel
|
||||
/**
|
||||
* Model TriggerLog
|
||||
*
|
||||
@@ -209,16 +229,6 @@ export type CustomerIndividual = Prisma.CustomerIndividualModel
|
||||
*
|
||||
*/
|
||||
export type CustomerLegal = Prisma.CustomerLegalModel
|
||||
/**
|
||||
* Model Good
|
||||
*
|
||||
*/
|
||||
export type Good = Prisma.GoodModel
|
||||
/**
|
||||
* Model GoodCategory
|
||||
*
|
||||
*/
|
||||
export type GoodCategory = Prisma.GoodCategoryModel
|
||||
/**
|
||||
* Model Guild
|
||||
*
|
||||
|
||||
@@ -490,68 +490,6 @@ export type EnumPOSTypeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
_max?: Prisma.NestedEnumPOSTypeFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type BoolNullableFilter<$PrismaModel = never> = {
|
||||
equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> | null
|
||||
not?: Prisma.NestedBoolNullableFilter<$PrismaModel> | boolean | null
|
||||
}
|
||||
|
||||
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 DateTimeNullableFilter<$PrismaModel = never> = {
|
||||
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null
|
||||
in?: Date[] | string[] | null
|
||||
notIn?: Date[] | string[] | null
|
||||
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null
|
||||
}
|
||||
|
||||
export type BoolNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> | null
|
||||
not?: Prisma.NestedBoolNullableWithAggregatesFilter<$PrismaModel> | boolean | null
|
||||
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedBoolNullableFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedBoolNullableFilter<$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 DateTimeNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null
|
||||
in?: Date[] | string[] | null
|
||||
notIn?: Date[] | string[] | null
|
||||
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedDateTimeNullableWithAggregatesFilter<$PrismaModel> | Date | string | null
|
||||
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedDateTimeNullableFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedDateTimeNullableFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type EnumUnitTypeFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.UnitType | Prisma.EnumUnitTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.UnitType[]
|
||||
notIn?: $Enums.UnitType[]
|
||||
not?: Prisma.NestedEnumUnitTypeFilter<$PrismaModel> | $Enums.UnitType
|
||||
}
|
||||
|
||||
export type EnumGoodPricingModelFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.GoodPricingModel | Prisma.EnumGoodPricingModelFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.GoodPricingModel[]
|
||||
@@ -570,14 +508,15 @@ export type DecimalNullableFilter<$PrismaModel = never> = {
|
||||
not?: Prisma.NestedDecimalNullableFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
}
|
||||
|
||||
export type EnumUnitTypeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.UnitType | Prisma.EnumUnitTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.UnitType[]
|
||||
notIn?: $Enums.UnitType[]
|
||||
not?: Prisma.NestedEnumUnitTypeWithAggregatesFilter<$PrismaModel> | $Enums.UnitType
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumUnitTypeFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumUnitTypeFilter<$PrismaModel>
|
||||
export type DateTimeNullableFilter<$PrismaModel = never> = {
|
||||
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null
|
||||
in?: Date[] | string[] | null
|
||||
notIn?: Date[] | string[] | null
|
||||
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null
|
||||
}
|
||||
|
||||
export type EnumGoodPricingModelWithAggregatesFilter<$PrismaModel = never> = {
|
||||
@@ -606,6 +545,20 @@ export type DecimalNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
_max?: Prisma.NestedDecimalNullableFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type DateTimeNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null
|
||||
in?: Date[] | string[] | null
|
||||
notIn?: Date[] | string[] | null
|
||||
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedDateTimeNullableWithAggregatesFilter<$PrismaModel> | Date | string | null
|
||||
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedDateTimeNullableFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedDateTimeNullableFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type DecimalFilter<$PrismaModel = never> = {
|
||||
equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[]
|
||||
@@ -617,6 +570,13 @@ export type DecimalFilter<$PrismaModel = never> = {
|
||||
not?: Prisma.NestedDecimalFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
}
|
||||
|
||||
export type EnumSKUGuildTypeFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.SKUGuildType | Prisma.EnumSKUGuildTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.SKUGuildType[]
|
||||
notIn?: $Enums.SKUGuildType[]
|
||||
not?: Prisma.NestedEnumSKUGuildTypeFilter<$PrismaModel> | $Enums.SKUGuildType
|
||||
}
|
||||
|
||||
export type DecimalWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[]
|
||||
@@ -633,6 +593,80 @@ export type DecimalWithAggregatesFilter<$PrismaModel = never> = {
|
||||
_max?: Prisma.NestedDecimalFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type EnumSKUGuildTypeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.SKUGuildType | Prisma.EnumSKUGuildTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.SKUGuildType[]
|
||||
notIn?: $Enums.SKUGuildType[]
|
||||
not?: Prisma.NestedEnumSKUGuildTypeWithAggregatesFilter<$PrismaModel> | $Enums.SKUGuildType
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumSKUGuildTypeFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumSKUGuildTypeFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type BoolNullableFilter<$PrismaModel = never> = {
|
||||
equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> | null
|
||||
not?: Prisma.NestedBoolNullableFilter<$PrismaModel> | boolean | null
|
||||
}
|
||||
|
||||
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 BoolNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> | null
|
||||
not?: Prisma.NestedBoolNullableWithAggregatesFilter<$PrismaModel> | boolean | null
|
||||
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedBoolNullableFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedBoolNullableFilter<$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 EnumFiscalResponseStatusFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.FiscalResponseStatus | Prisma.EnumFiscalResponseStatusFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.FiscalResponseStatus[]
|
||||
notIn?: $Enums.FiscalResponseStatus[]
|
||||
not?: Prisma.NestedEnumFiscalResponseStatusFilter<$PrismaModel> | $Enums.FiscalResponseStatus
|
||||
}
|
||||
|
||||
export type EnumFiscalRequestTypeFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.FiscalRequestType | Prisma.EnumFiscalRequestTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.FiscalRequestType[]
|
||||
notIn?: $Enums.FiscalRequestType[]
|
||||
not?: Prisma.NestedEnumFiscalRequestTypeFilter<$PrismaModel> | $Enums.FiscalRequestType
|
||||
}
|
||||
|
||||
export type EnumFiscalResponseStatusWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.FiscalResponseStatus | Prisma.EnumFiscalResponseStatusFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.FiscalResponseStatus[]
|
||||
notIn?: $Enums.FiscalResponseStatus[]
|
||||
not?: Prisma.NestedEnumFiscalResponseStatusWithAggregatesFilter<$PrismaModel> | $Enums.FiscalResponseStatus
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumFiscalResponseStatusFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumFiscalResponseStatusFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type EnumFiscalRequestTypeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.FiscalRequestType | Prisma.EnumFiscalRequestTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.FiscalRequestType[]
|
||||
notIn?: $Enums.FiscalRequestType[]
|
||||
not?: Prisma.NestedEnumFiscalRequestTypeWithAggregatesFilter<$PrismaModel> | $Enums.FiscalRequestType
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumFiscalRequestTypeFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumFiscalRequestTypeFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type EnumPaymentMethodTypeFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.PaymentMethodType | Prisma.EnumPaymentMethodTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.PaymentMethodType[]
|
||||
@@ -1116,68 +1150,6 @@ export type NestedEnumPOSTypeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
_max?: Prisma.NestedEnumPOSTypeFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedBoolNullableFilter<$PrismaModel = never> = {
|
||||
equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> | null
|
||||
not?: Prisma.NestedBoolNullableFilter<$PrismaModel> | boolean | null
|
||||
}
|
||||
|
||||
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 NestedDateTimeNullableFilter<$PrismaModel = never> = {
|
||||
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null
|
||||
in?: Date[] | string[] | null
|
||||
notIn?: Date[] | string[] | null
|
||||
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null
|
||||
}
|
||||
|
||||
export type NestedBoolNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> | null
|
||||
not?: Prisma.NestedBoolNullableWithAggregatesFilter<$PrismaModel> | boolean | null
|
||||
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedBoolNullableFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedBoolNullableFilter<$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 NestedDateTimeNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null
|
||||
in?: Date[] | string[] | null
|
||||
notIn?: Date[] | string[] | null
|
||||
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedDateTimeNullableWithAggregatesFilter<$PrismaModel> | Date | string | null
|
||||
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedDateTimeNullableFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedDateTimeNullableFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedEnumUnitTypeFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.UnitType | Prisma.EnumUnitTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.UnitType[]
|
||||
notIn?: $Enums.UnitType[]
|
||||
not?: Prisma.NestedEnumUnitTypeFilter<$PrismaModel> | $Enums.UnitType
|
||||
}
|
||||
|
||||
export type NestedEnumGoodPricingModelFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.GoodPricingModel | Prisma.EnumGoodPricingModelFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.GoodPricingModel[]
|
||||
@@ -1196,14 +1168,15 @@ export type NestedDecimalNullableFilter<$PrismaModel = never> = {
|
||||
not?: Prisma.NestedDecimalNullableFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string | null
|
||||
}
|
||||
|
||||
export type NestedEnumUnitTypeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.UnitType | Prisma.EnumUnitTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.UnitType[]
|
||||
notIn?: $Enums.UnitType[]
|
||||
not?: Prisma.NestedEnumUnitTypeWithAggregatesFilter<$PrismaModel> | $Enums.UnitType
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumUnitTypeFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumUnitTypeFilter<$PrismaModel>
|
||||
export type NestedDateTimeNullableFilter<$PrismaModel = never> = {
|
||||
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null
|
||||
in?: Date[] | string[] | null
|
||||
notIn?: Date[] | string[] | null
|
||||
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null
|
||||
}
|
||||
|
||||
export type NestedEnumGoodPricingModelWithAggregatesFilter<$PrismaModel = never> = {
|
||||
@@ -1232,6 +1205,20 @@ export type NestedDecimalNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
_max?: Prisma.NestedDecimalNullableFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedDateTimeNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null
|
||||
in?: Date[] | string[] | null
|
||||
notIn?: Date[] | string[] | null
|
||||
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedDateTimeNullableWithAggregatesFilter<$PrismaModel> | Date | string | null
|
||||
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedDateTimeNullableFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedDateTimeNullableFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedDecimalFilter<$PrismaModel = never> = {
|
||||
equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[]
|
||||
@@ -1243,6 +1230,13 @@ export type NestedDecimalFilter<$PrismaModel = never> = {
|
||||
not?: Prisma.NestedDecimalFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
}
|
||||
|
||||
export type NestedEnumSKUGuildTypeFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.SKUGuildType | Prisma.EnumSKUGuildTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.SKUGuildType[]
|
||||
notIn?: $Enums.SKUGuildType[]
|
||||
not?: Prisma.NestedEnumSKUGuildTypeFilter<$PrismaModel> | $Enums.SKUGuildType
|
||||
}
|
||||
|
||||
export type NestedDecimalWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[]
|
||||
@@ -1259,6 +1253,80 @@ export type NestedDecimalWithAggregatesFilter<$PrismaModel = never> = {
|
||||
_max?: Prisma.NestedDecimalFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedEnumSKUGuildTypeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.SKUGuildType | Prisma.EnumSKUGuildTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.SKUGuildType[]
|
||||
notIn?: $Enums.SKUGuildType[]
|
||||
not?: Prisma.NestedEnumSKUGuildTypeWithAggregatesFilter<$PrismaModel> | $Enums.SKUGuildType
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumSKUGuildTypeFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumSKUGuildTypeFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedBoolNullableFilter<$PrismaModel = never> = {
|
||||
equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> | null
|
||||
not?: Prisma.NestedBoolNullableFilter<$PrismaModel> | boolean | null
|
||||
}
|
||||
|
||||
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 NestedBoolNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> | null
|
||||
not?: Prisma.NestedBoolNullableWithAggregatesFilter<$PrismaModel> | boolean | null
|
||||
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedBoolNullableFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedBoolNullableFilter<$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 NestedEnumFiscalResponseStatusFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.FiscalResponseStatus | Prisma.EnumFiscalResponseStatusFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.FiscalResponseStatus[]
|
||||
notIn?: $Enums.FiscalResponseStatus[]
|
||||
not?: Prisma.NestedEnumFiscalResponseStatusFilter<$PrismaModel> | $Enums.FiscalResponseStatus
|
||||
}
|
||||
|
||||
export type NestedEnumFiscalRequestTypeFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.FiscalRequestType | Prisma.EnumFiscalRequestTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.FiscalRequestType[]
|
||||
notIn?: $Enums.FiscalRequestType[]
|
||||
not?: Prisma.NestedEnumFiscalRequestTypeFilter<$PrismaModel> | $Enums.FiscalRequestType
|
||||
}
|
||||
|
||||
export type NestedEnumFiscalResponseStatusWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.FiscalResponseStatus | Prisma.EnumFiscalResponseStatusFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.FiscalResponseStatus[]
|
||||
notIn?: $Enums.FiscalResponseStatus[]
|
||||
not?: Prisma.NestedEnumFiscalResponseStatusWithAggregatesFilter<$PrismaModel> | $Enums.FiscalResponseStatus
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumFiscalResponseStatusFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumFiscalResponseStatusFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedEnumFiscalRequestTypeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.FiscalRequestType | Prisma.EnumFiscalRequestTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.FiscalRequestType[]
|
||||
notIn?: $Enums.FiscalRequestType[]
|
||||
not?: Prisma.NestedEnumFiscalRequestTypeWithAggregatesFilter<$PrismaModel> | $Enums.FiscalRequestType
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumFiscalRequestTypeFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumFiscalRequestTypeFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedEnumPaymentMethodTypeFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.PaymentMethodType | Prisma.EnumPaymentMethodTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.PaymentMethodType[]
|
||||
|
||||
@@ -259,7 +259,33 @@ export type PartnerFiscalSwitchType = (typeof PartnerFiscalSwitchType)[keyof typ
|
||||
export const FiscalResponseStatus = {
|
||||
SUCCESS: 'SUCCESS',
|
||||
FAILURE: 'FAILURE',
|
||||
NOT_SEND: 'NOT_SEND'
|
||||
NOT_SEND: 'NOT_SEND',
|
||||
QUEUED: 'QUEUED'
|
||||
} as const
|
||||
|
||||
export type FiscalResponseStatus = (typeof FiscalResponseStatus)[keyof typeof FiscalResponseStatus]
|
||||
|
||||
|
||||
export const FiscalRequestType = {
|
||||
MAIN: 'MAIN',
|
||||
UPDATE: 'UPDATE',
|
||||
REVOKE: 'REVOKE',
|
||||
REMOVE: 'REMOVE'
|
||||
} as const
|
||||
|
||||
export type FiscalRequestType = (typeof FiscalRequestType)[keyof typeof FiscalRequestType]
|
||||
|
||||
|
||||
export const FiscalInvoiceCustomerType = {
|
||||
Unknown: 'Unknown',
|
||||
Known: 'Known'
|
||||
} as const
|
||||
|
||||
export type FiscalInvoiceCustomerType = (typeof FiscalInvoiceCustomerType)[keyof typeof FiscalInvoiceCustomerType]
|
||||
|
||||
|
||||
export const SKUGuildType = {
|
||||
GOLD: 'GOLD'
|
||||
} as const
|
||||
|
||||
export type SKUGuildType = (typeof SKUGuildType)[keyof typeof SKUGuildType]
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -414,12 +414,14 @@ export const ModelName = {
|
||||
BusinessActivity: 'BusinessActivity',
|
||||
Complex: 'Complex',
|
||||
Pos: 'Pos',
|
||||
Good: 'Good',
|
||||
GoodCategory: 'GoodCategory',
|
||||
MeasureUnits: 'MeasureUnits',
|
||||
StockKeepingUnits: 'StockKeepingUnits',
|
||||
TriggerLog: 'TriggerLog',
|
||||
Customer: 'Customer',
|
||||
CustomerIndividual: 'CustomerIndividual',
|
||||
CustomerLegal: 'CustomerLegal',
|
||||
Good: 'Good',
|
||||
GoodCategory: 'GoodCategory',
|
||||
Guild: 'Guild',
|
||||
SalesInvoice: 'SalesInvoice',
|
||||
SalesInvoiceItem: 'SalesInvoiceItem',
|
||||
@@ -444,7 +446,7 @@ export type TypeMap<ExtArgs extends runtime.Types.Extensions.InternalArgs = runt
|
||||
omit: GlobalOmitOptions
|
||||
}
|
||||
meta: {
|
||||
modelProps: "adminAccount" | "admin" | "account" | "deviceBrand" | "device" | "licenseChargeTransaction" | "license" | "licenseActivation" | "licenseRenewChargeTransaction" | "licenseRenew" | "partnerAccountQuotaChargeTransaction" | "partnerAccountQuotaCredit" | "licenseAccountAllocation" | "partnerAccount" | "partner" | "permissionConsumer" | "permissionPos" | "permissionComplex" | "permissionBusiness" | "providerAccount" | "provider" | "consumerDevices" | "applicationReleasedInfo" | "consumerAccount" | "consumer" | "consumerIndividual" | "consumerLegal" | "businessActivity" | "complex" | "pos" | "triggerLog" | "customer" | "customerIndividual" | "customerLegal" | "good" | "goodCategory" | "guild" | "salesInvoice" | "salesInvoiceItem" | "saleInvoiceFiscals" | "saleInvoiceFiscalAttempts" | "salesInvoicePayment" | "salesInvoicePaymentTerminalInfo" | "service" | "serviceCategory"
|
||||
modelProps: "adminAccount" | "admin" | "account" | "deviceBrand" | "device" | "licenseChargeTransaction" | "license" | "licenseActivation" | "licenseRenewChargeTransaction" | "licenseRenew" | "partnerAccountQuotaChargeTransaction" | "partnerAccountQuotaCredit" | "licenseAccountAllocation" | "partnerAccount" | "partner" | "permissionConsumer" | "permissionPos" | "permissionComplex" | "permissionBusiness" | "providerAccount" | "provider" | "consumerDevices" | "applicationReleasedInfo" | "consumerAccount" | "consumer" | "consumerIndividual" | "consumerLegal" | "businessActivity" | "complex" | "pos" | "good" | "goodCategory" | "measureUnits" | "stockKeepingUnits" | "triggerLog" | "customer" | "customerIndividual" | "customerLegal" | "guild" | "salesInvoice" | "salesInvoiceItem" | "saleInvoiceFiscals" | "saleInvoiceFiscalAttempts" | "salesInvoicePayment" | "salesInvoicePaymentTerminalInfo" | "service" | "serviceCategory"
|
||||
txIsolationLevel: TransactionIsolationLevel
|
||||
}
|
||||
model: {
|
||||
@@ -2428,6 +2430,270 @@ export type TypeMap<ExtArgs extends runtime.Types.Extensions.InternalArgs = runt
|
||||
}
|
||||
}
|
||||
}
|
||||
Good: {
|
||||
payload: Prisma.$GoodPayload<ExtArgs>
|
||||
fields: Prisma.GoodFieldRefs
|
||||
operations: {
|
||||
findUnique: {
|
||||
args: Prisma.GoodFindUniqueArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$GoodPayload> | null
|
||||
}
|
||||
findUniqueOrThrow: {
|
||||
args: Prisma.GoodFindUniqueOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$GoodPayload>
|
||||
}
|
||||
findFirst: {
|
||||
args: Prisma.GoodFindFirstArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$GoodPayload> | null
|
||||
}
|
||||
findFirstOrThrow: {
|
||||
args: Prisma.GoodFindFirstOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$GoodPayload>
|
||||
}
|
||||
findMany: {
|
||||
args: Prisma.GoodFindManyArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$GoodPayload>[]
|
||||
}
|
||||
create: {
|
||||
args: Prisma.GoodCreateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$GoodPayload>
|
||||
}
|
||||
createMany: {
|
||||
args: Prisma.GoodCreateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
delete: {
|
||||
args: Prisma.GoodDeleteArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$GoodPayload>
|
||||
}
|
||||
update: {
|
||||
args: Prisma.GoodUpdateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$GoodPayload>
|
||||
}
|
||||
deleteMany: {
|
||||
args: Prisma.GoodDeleteManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
updateMany: {
|
||||
args: Prisma.GoodUpdateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
upsert: {
|
||||
args: Prisma.GoodUpsertArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$GoodPayload>
|
||||
}
|
||||
aggregate: {
|
||||
args: Prisma.GoodAggregateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.AggregateGood>
|
||||
}
|
||||
groupBy: {
|
||||
args: Prisma.GoodGroupByArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.GoodGroupByOutputType>[]
|
||||
}
|
||||
count: {
|
||||
args: Prisma.GoodCountArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.GoodCountAggregateOutputType> | number
|
||||
}
|
||||
}
|
||||
}
|
||||
GoodCategory: {
|
||||
payload: Prisma.$GoodCategoryPayload<ExtArgs>
|
||||
fields: Prisma.GoodCategoryFieldRefs
|
||||
operations: {
|
||||
findUnique: {
|
||||
args: Prisma.GoodCategoryFindUniqueArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$GoodCategoryPayload> | null
|
||||
}
|
||||
findUniqueOrThrow: {
|
||||
args: Prisma.GoodCategoryFindUniqueOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$GoodCategoryPayload>
|
||||
}
|
||||
findFirst: {
|
||||
args: Prisma.GoodCategoryFindFirstArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$GoodCategoryPayload> | null
|
||||
}
|
||||
findFirstOrThrow: {
|
||||
args: Prisma.GoodCategoryFindFirstOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$GoodCategoryPayload>
|
||||
}
|
||||
findMany: {
|
||||
args: Prisma.GoodCategoryFindManyArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$GoodCategoryPayload>[]
|
||||
}
|
||||
create: {
|
||||
args: Prisma.GoodCategoryCreateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$GoodCategoryPayload>
|
||||
}
|
||||
createMany: {
|
||||
args: Prisma.GoodCategoryCreateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
delete: {
|
||||
args: Prisma.GoodCategoryDeleteArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$GoodCategoryPayload>
|
||||
}
|
||||
update: {
|
||||
args: Prisma.GoodCategoryUpdateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$GoodCategoryPayload>
|
||||
}
|
||||
deleteMany: {
|
||||
args: Prisma.GoodCategoryDeleteManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
updateMany: {
|
||||
args: Prisma.GoodCategoryUpdateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
upsert: {
|
||||
args: Prisma.GoodCategoryUpsertArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$GoodCategoryPayload>
|
||||
}
|
||||
aggregate: {
|
||||
args: Prisma.GoodCategoryAggregateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.AggregateGoodCategory>
|
||||
}
|
||||
groupBy: {
|
||||
args: Prisma.GoodCategoryGroupByArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.GoodCategoryGroupByOutputType>[]
|
||||
}
|
||||
count: {
|
||||
args: Prisma.GoodCategoryCountArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.GoodCategoryCountAggregateOutputType> | number
|
||||
}
|
||||
}
|
||||
}
|
||||
MeasureUnits: {
|
||||
payload: Prisma.$MeasureUnitsPayload<ExtArgs>
|
||||
fields: Prisma.MeasureUnitsFieldRefs
|
||||
operations: {
|
||||
findUnique: {
|
||||
args: Prisma.MeasureUnitsFindUniqueArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$MeasureUnitsPayload> | null
|
||||
}
|
||||
findUniqueOrThrow: {
|
||||
args: Prisma.MeasureUnitsFindUniqueOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$MeasureUnitsPayload>
|
||||
}
|
||||
findFirst: {
|
||||
args: Prisma.MeasureUnitsFindFirstArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$MeasureUnitsPayload> | null
|
||||
}
|
||||
findFirstOrThrow: {
|
||||
args: Prisma.MeasureUnitsFindFirstOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$MeasureUnitsPayload>
|
||||
}
|
||||
findMany: {
|
||||
args: Prisma.MeasureUnitsFindManyArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$MeasureUnitsPayload>[]
|
||||
}
|
||||
create: {
|
||||
args: Prisma.MeasureUnitsCreateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$MeasureUnitsPayload>
|
||||
}
|
||||
createMany: {
|
||||
args: Prisma.MeasureUnitsCreateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
delete: {
|
||||
args: Prisma.MeasureUnitsDeleteArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$MeasureUnitsPayload>
|
||||
}
|
||||
update: {
|
||||
args: Prisma.MeasureUnitsUpdateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$MeasureUnitsPayload>
|
||||
}
|
||||
deleteMany: {
|
||||
args: Prisma.MeasureUnitsDeleteManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
updateMany: {
|
||||
args: Prisma.MeasureUnitsUpdateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
upsert: {
|
||||
args: Prisma.MeasureUnitsUpsertArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$MeasureUnitsPayload>
|
||||
}
|
||||
aggregate: {
|
||||
args: Prisma.MeasureUnitsAggregateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.AggregateMeasureUnits>
|
||||
}
|
||||
groupBy: {
|
||||
args: Prisma.MeasureUnitsGroupByArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.MeasureUnitsGroupByOutputType>[]
|
||||
}
|
||||
count: {
|
||||
args: Prisma.MeasureUnitsCountArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.MeasureUnitsCountAggregateOutputType> | number
|
||||
}
|
||||
}
|
||||
}
|
||||
StockKeepingUnits: {
|
||||
payload: Prisma.$StockKeepingUnitsPayload<ExtArgs>
|
||||
fields: Prisma.StockKeepingUnitsFieldRefs
|
||||
operations: {
|
||||
findUnique: {
|
||||
args: Prisma.StockKeepingUnitsFindUniqueArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$StockKeepingUnitsPayload> | null
|
||||
}
|
||||
findUniqueOrThrow: {
|
||||
args: Prisma.StockKeepingUnitsFindUniqueOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$StockKeepingUnitsPayload>
|
||||
}
|
||||
findFirst: {
|
||||
args: Prisma.StockKeepingUnitsFindFirstArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$StockKeepingUnitsPayload> | null
|
||||
}
|
||||
findFirstOrThrow: {
|
||||
args: Prisma.StockKeepingUnitsFindFirstOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$StockKeepingUnitsPayload>
|
||||
}
|
||||
findMany: {
|
||||
args: Prisma.StockKeepingUnitsFindManyArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$StockKeepingUnitsPayload>[]
|
||||
}
|
||||
create: {
|
||||
args: Prisma.StockKeepingUnitsCreateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$StockKeepingUnitsPayload>
|
||||
}
|
||||
createMany: {
|
||||
args: Prisma.StockKeepingUnitsCreateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
delete: {
|
||||
args: Prisma.StockKeepingUnitsDeleteArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$StockKeepingUnitsPayload>
|
||||
}
|
||||
update: {
|
||||
args: Prisma.StockKeepingUnitsUpdateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$StockKeepingUnitsPayload>
|
||||
}
|
||||
deleteMany: {
|
||||
args: Prisma.StockKeepingUnitsDeleteManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
updateMany: {
|
||||
args: Prisma.StockKeepingUnitsUpdateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
upsert: {
|
||||
args: Prisma.StockKeepingUnitsUpsertArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$StockKeepingUnitsPayload>
|
||||
}
|
||||
aggregate: {
|
||||
args: Prisma.StockKeepingUnitsAggregateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.AggregateStockKeepingUnits>
|
||||
}
|
||||
groupBy: {
|
||||
args: Prisma.StockKeepingUnitsGroupByArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.StockKeepingUnitsGroupByOutputType>[]
|
||||
}
|
||||
count: {
|
||||
args: Prisma.StockKeepingUnitsCountArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.StockKeepingUnitsCountAggregateOutputType> | number
|
||||
}
|
||||
}
|
||||
}
|
||||
TriggerLog: {
|
||||
payload: Prisma.$TriggerLogPayload<ExtArgs>
|
||||
fields: Prisma.TriggerLogFieldRefs
|
||||
@@ -2692,138 +2958,6 @@ export type TypeMap<ExtArgs extends runtime.Types.Extensions.InternalArgs = runt
|
||||
}
|
||||
}
|
||||
}
|
||||
Good: {
|
||||
payload: Prisma.$GoodPayload<ExtArgs>
|
||||
fields: Prisma.GoodFieldRefs
|
||||
operations: {
|
||||
findUnique: {
|
||||
args: Prisma.GoodFindUniqueArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$GoodPayload> | null
|
||||
}
|
||||
findUniqueOrThrow: {
|
||||
args: Prisma.GoodFindUniqueOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$GoodPayload>
|
||||
}
|
||||
findFirst: {
|
||||
args: Prisma.GoodFindFirstArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$GoodPayload> | null
|
||||
}
|
||||
findFirstOrThrow: {
|
||||
args: Prisma.GoodFindFirstOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$GoodPayload>
|
||||
}
|
||||
findMany: {
|
||||
args: Prisma.GoodFindManyArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$GoodPayload>[]
|
||||
}
|
||||
create: {
|
||||
args: Prisma.GoodCreateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$GoodPayload>
|
||||
}
|
||||
createMany: {
|
||||
args: Prisma.GoodCreateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
delete: {
|
||||
args: Prisma.GoodDeleteArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$GoodPayload>
|
||||
}
|
||||
update: {
|
||||
args: Prisma.GoodUpdateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$GoodPayload>
|
||||
}
|
||||
deleteMany: {
|
||||
args: Prisma.GoodDeleteManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
updateMany: {
|
||||
args: Prisma.GoodUpdateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
upsert: {
|
||||
args: Prisma.GoodUpsertArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$GoodPayload>
|
||||
}
|
||||
aggregate: {
|
||||
args: Prisma.GoodAggregateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.AggregateGood>
|
||||
}
|
||||
groupBy: {
|
||||
args: Prisma.GoodGroupByArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.GoodGroupByOutputType>[]
|
||||
}
|
||||
count: {
|
||||
args: Prisma.GoodCountArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.GoodCountAggregateOutputType> | number
|
||||
}
|
||||
}
|
||||
}
|
||||
GoodCategory: {
|
||||
payload: Prisma.$GoodCategoryPayload<ExtArgs>
|
||||
fields: Prisma.GoodCategoryFieldRefs
|
||||
operations: {
|
||||
findUnique: {
|
||||
args: Prisma.GoodCategoryFindUniqueArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$GoodCategoryPayload> | null
|
||||
}
|
||||
findUniqueOrThrow: {
|
||||
args: Prisma.GoodCategoryFindUniqueOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$GoodCategoryPayload>
|
||||
}
|
||||
findFirst: {
|
||||
args: Prisma.GoodCategoryFindFirstArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$GoodCategoryPayload> | null
|
||||
}
|
||||
findFirstOrThrow: {
|
||||
args: Prisma.GoodCategoryFindFirstOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$GoodCategoryPayload>
|
||||
}
|
||||
findMany: {
|
||||
args: Prisma.GoodCategoryFindManyArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$GoodCategoryPayload>[]
|
||||
}
|
||||
create: {
|
||||
args: Prisma.GoodCategoryCreateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$GoodCategoryPayload>
|
||||
}
|
||||
createMany: {
|
||||
args: Prisma.GoodCategoryCreateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
delete: {
|
||||
args: Prisma.GoodCategoryDeleteArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$GoodCategoryPayload>
|
||||
}
|
||||
update: {
|
||||
args: Prisma.GoodCategoryUpdateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$GoodCategoryPayload>
|
||||
}
|
||||
deleteMany: {
|
||||
args: Prisma.GoodCategoryDeleteManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
updateMany: {
|
||||
args: Prisma.GoodCategoryUpdateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
upsert: {
|
||||
args: Prisma.GoodCategoryUpsertArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$GoodCategoryPayload>
|
||||
}
|
||||
aggregate: {
|
||||
args: Prisma.GoodCategoryAggregateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.AggregateGoodCategory>
|
||||
}
|
||||
groupBy: {
|
||||
args: Prisma.GoodCategoryGroupByArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.GoodCategoryGroupByOutputType>[]
|
||||
}
|
||||
count: {
|
||||
args: Prisma.GoodCategoryCountArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.GoodCategoryCountAggregateOutputType> | number
|
||||
}
|
||||
}
|
||||
}
|
||||
Guild: {
|
||||
payload: Prisma.$GuildPayload<ExtArgs>
|
||||
fields: Prisma.GuildFieldRefs
|
||||
@@ -3833,6 +3967,70 @@ export const PosScalarFieldEnum = {
|
||||
export type PosScalarFieldEnum = (typeof PosScalarFieldEnum)[keyof typeof PosScalarFieldEnum]
|
||||
|
||||
|
||||
export const GoodScalarFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
is_default_guild_good: 'is_default_guild_good',
|
||||
pricing_model: 'pricing_model',
|
||||
description: 'description',
|
||||
local_sku: 'local_sku',
|
||||
barcode: 'barcode',
|
||||
base_sale_price: 'base_sale_price',
|
||||
image_url: 'image_url',
|
||||
created_at: 'created_at',
|
||||
updated_at: 'updated_at',
|
||||
deleted_at: 'deleted_at',
|
||||
sku_id: 'sku_id',
|
||||
measure_unit_id: 'measure_unit_id',
|
||||
category_id: 'category_id',
|
||||
business_activity_id: 'business_activity_id'
|
||||
} as const
|
||||
|
||||
export type GoodScalarFieldEnum = (typeof GoodScalarFieldEnum)[keyof typeof GoodScalarFieldEnum]
|
||||
|
||||
|
||||
export const GoodCategoryScalarFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
description: 'description',
|
||||
image_url: 'image_url',
|
||||
complex_id: 'complex_id',
|
||||
is_default_guild_good: 'is_default_guild_good',
|
||||
guild_id: 'guild_id',
|
||||
created_at: 'created_at',
|
||||
updated_at: 'updated_at',
|
||||
deleted_at: 'deleted_at'
|
||||
} as const
|
||||
|
||||
export type GoodCategoryScalarFieldEnum = (typeof GoodCategoryScalarFieldEnum)[keyof typeof GoodCategoryScalarFieldEnum]
|
||||
|
||||
|
||||
export const MeasureUnitsScalarFieldEnum = {
|
||||
id: 'id',
|
||||
code: 'code',
|
||||
name: 'name',
|
||||
created_at: 'created_at',
|
||||
updated_at: 'updated_at'
|
||||
} as const
|
||||
|
||||
export type MeasureUnitsScalarFieldEnum = (typeof MeasureUnitsScalarFieldEnum)[keyof typeof MeasureUnitsScalarFieldEnum]
|
||||
|
||||
|
||||
export const StockKeepingUnitsScalarFieldEnum = {
|
||||
id: 'id',
|
||||
code: 'code',
|
||||
name: 'name',
|
||||
VAT: 'VAT',
|
||||
type: 'type',
|
||||
is_public: 'is_public',
|
||||
is_domestic: 'is_domestic',
|
||||
created_at: 'created_at',
|
||||
updated_at: 'updated_at'
|
||||
} as const
|
||||
|
||||
export type StockKeepingUnitsScalarFieldEnum = (typeof StockKeepingUnitsScalarFieldEnum)[keyof typeof StockKeepingUnitsScalarFieldEnum]
|
||||
|
||||
|
||||
export const TriggerLogScalarFieldEnum = {
|
||||
id: 'id',
|
||||
message: 'message',
|
||||
@@ -3870,7 +4068,7 @@ export type CustomerIndividualScalarFieldEnum = (typeof CustomerIndividualScalar
|
||||
|
||||
|
||||
export const CustomerLegalScalarFieldEnum = {
|
||||
company_name: 'company_name',
|
||||
name: 'name',
|
||||
economic_code: 'economic_code',
|
||||
registration_number: 'registration_number',
|
||||
postal_code: 'postal_code',
|
||||
@@ -3881,44 +4079,6 @@ export const CustomerLegalScalarFieldEnum = {
|
||||
export type CustomerLegalScalarFieldEnum = (typeof CustomerLegalScalarFieldEnum)[keyof typeof CustomerLegalScalarFieldEnum]
|
||||
|
||||
|
||||
export const GoodScalarFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
is_default_guild_good: 'is_default_guild_good',
|
||||
sku: 'sku',
|
||||
unit_type: 'unit_type',
|
||||
pricing_model: 'pricing_model',
|
||||
description: 'description',
|
||||
local_sku: 'local_sku',
|
||||
barcode: 'barcode',
|
||||
base_sale_price: 'base_sale_price',
|
||||
image_url: 'image_url',
|
||||
created_at: 'created_at',
|
||||
updated_at: 'updated_at',
|
||||
deleted_at: 'deleted_at',
|
||||
category_id: 'category_id',
|
||||
business_activity_id: 'business_activity_id'
|
||||
} as const
|
||||
|
||||
export type GoodScalarFieldEnum = (typeof GoodScalarFieldEnum)[keyof typeof GoodScalarFieldEnum]
|
||||
|
||||
|
||||
export const GoodCategoryScalarFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
description: 'description',
|
||||
image_url: 'image_url',
|
||||
complex_id: 'complex_id',
|
||||
is_default_guild_good: 'is_default_guild_good',
|
||||
guild_id: 'guild_id',
|
||||
created_at: 'created_at',
|
||||
updated_at: 'updated_at',
|
||||
deleted_at: 'deleted_at'
|
||||
} as const
|
||||
|
||||
export type GoodCategoryScalarFieldEnum = (typeof GoodCategoryScalarFieldEnum)[keyof typeof GoodCategoryScalarFieldEnum]
|
||||
|
||||
|
||||
export const GuildScalarFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
@@ -3951,7 +4111,10 @@ export type SalesInvoiceScalarFieldEnum = (typeof SalesInvoiceScalarFieldEnum)[k
|
||||
export const SalesInvoiceItemScalarFieldEnum = {
|
||||
id: 'id',
|
||||
quantity: 'quantity',
|
||||
unit_type: 'unit_type',
|
||||
measure_unit_text: 'measure_unit_text',
|
||||
measure_unit_code: 'measure_unit_code',
|
||||
sku_code: 'sku_code',
|
||||
sku_vat: 'sku_vat',
|
||||
unit_price: 'unit_price',
|
||||
total_amount: 'total_amount',
|
||||
created_at: 'created_at',
|
||||
@@ -3984,6 +4147,7 @@ export const SaleInvoiceFiscalAttemptsScalarFieldEnum = {
|
||||
attempt_no: 'attempt_no',
|
||||
status: 'status',
|
||||
tax_id: 'tax_id',
|
||||
type: 'type',
|
||||
request_payload: 'request_payload',
|
||||
response_payload: 'response_payload',
|
||||
error_message: 'error_message',
|
||||
@@ -4393,6 +4557,52 @@ export const PosOrderByRelevanceFieldEnum = {
|
||||
export type PosOrderByRelevanceFieldEnum = (typeof PosOrderByRelevanceFieldEnum)[keyof typeof PosOrderByRelevanceFieldEnum]
|
||||
|
||||
|
||||
export const GoodOrderByRelevanceFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
description: 'description',
|
||||
local_sku: 'local_sku',
|
||||
barcode: 'barcode',
|
||||
image_url: 'image_url',
|
||||
sku_id: 'sku_id',
|
||||
measure_unit_id: 'measure_unit_id',
|
||||
category_id: 'category_id',
|
||||
business_activity_id: 'business_activity_id'
|
||||
} as const
|
||||
|
||||
export type GoodOrderByRelevanceFieldEnum = (typeof GoodOrderByRelevanceFieldEnum)[keyof typeof GoodOrderByRelevanceFieldEnum]
|
||||
|
||||
|
||||
export const GoodCategoryOrderByRelevanceFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
description: 'description',
|
||||
image_url: 'image_url',
|
||||
complex_id: 'complex_id',
|
||||
guild_id: 'guild_id'
|
||||
} as const
|
||||
|
||||
export type GoodCategoryOrderByRelevanceFieldEnum = (typeof GoodCategoryOrderByRelevanceFieldEnum)[keyof typeof GoodCategoryOrderByRelevanceFieldEnum]
|
||||
|
||||
|
||||
export const MeasureUnitsOrderByRelevanceFieldEnum = {
|
||||
id: 'id',
|
||||
code: 'code',
|
||||
name: 'name'
|
||||
} as const
|
||||
|
||||
export type MeasureUnitsOrderByRelevanceFieldEnum = (typeof MeasureUnitsOrderByRelevanceFieldEnum)[keyof typeof MeasureUnitsOrderByRelevanceFieldEnum]
|
||||
|
||||
|
||||
export const StockKeepingUnitsOrderByRelevanceFieldEnum = {
|
||||
id: 'id',
|
||||
code: 'code',
|
||||
name: 'name'
|
||||
} as const
|
||||
|
||||
export type StockKeepingUnitsOrderByRelevanceFieldEnum = (typeof StockKeepingUnitsOrderByRelevanceFieldEnum)[keyof typeof StockKeepingUnitsOrderByRelevanceFieldEnum]
|
||||
|
||||
|
||||
export const TriggerLogOrderByRelevanceFieldEnum = {
|
||||
message: 'message',
|
||||
name: 'name'
|
||||
@@ -4423,7 +4633,7 @@ export type CustomerIndividualOrderByRelevanceFieldEnum = (typeof CustomerIndivi
|
||||
|
||||
|
||||
export const CustomerLegalOrderByRelevanceFieldEnum = {
|
||||
company_name: 'company_name',
|
||||
name: 'name',
|
||||
economic_code: 'economic_code',
|
||||
registration_number: 'registration_number',
|
||||
postal_code: 'postal_code',
|
||||
@@ -4434,33 +4644,6 @@ export const CustomerLegalOrderByRelevanceFieldEnum = {
|
||||
export type CustomerLegalOrderByRelevanceFieldEnum = (typeof CustomerLegalOrderByRelevanceFieldEnum)[keyof typeof CustomerLegalOrderByRelevanceFieldEnum]
|
||||
|
||||
|
||||
export const GoodOrderByRelevanceFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
sku: 'sku',
|
||||
description: 'description',
|
||||
local_sku: 'local_sku',
|
||||
barcode: 'barcode',
|
||||
image_url: 'image_url',
|
||||
category_id: 'category_id',
|
||||
business_activity_id: 'business_activity_id'
|
||||
} as const
|
||||
|
||||
export type GoodOrderByRelevanceFieldEnum = (typeof GoodOrderByRelevanceFieldEnum)[keyof typeof GoodOrderByRelevanceFieldEnum]
|
||||
|
||||
|
||||
export const GoodCategoryOrderByRelevanceFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
description: 'description',
|
||||
image_url: 'image_url',
|
||||
complex_id: 'complex_id',
|
||||
guild_id: 'guild_id'
|
||||
} as const
|
||||
|
||||
export type GoodCategoryOrderByRelevanceFieldEnum = (typeof GoodCategoryOrderByRelevanceFieldEnum)[keyof typeof GoodCategoryOrderByRelevanceFieldEnum]
|
||||
|
||||
|
||||
export const GuildOrderByRelevanceFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
@@ -4484,6 +4667,9 @@ export type SalesInvoiceOrderByRelevanceFieldEnum = (typeof SalesInvoiceOrderByR
|
||||
|
||||
export const SalesInvoiceItemOrderByRelevanceFieldEnum = {
|
||||
id: 'id',
|
||||
measure_unit_text: 'measure_unit_text',
|
||||
measure_unit_code: 'measure_unit_code',
|
||||
sku_code: 'sku_code',
|
||||
notes: 'notes',
|
||||
invoice_id: 'invoice_id',
|
||||
good_id: 'good_id',
|
||||
@@ -4503,7 +4689,6 @@ export type SaleInvoiceFiscalsOrderByRelevanceFieldEnum = (typeof SaleInvoiceFis
|
||||
|
||||
export const SaleInvoiceFiscalAttemptsOrderByRelevanceFieldEnum = {
|
||||
id: 'id',
|
||||
status: 'status',
|
||||
tax_id: 'tax_id',
|
||||
error_message: 'error_message',
|
||||
fiscal_id: 'fiscal_id'
|
||||
@@ -4727,20 +4912,6 @@ export type EnumPOSTypeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaMo
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Reference to a field of type 'CustomerType'
|
||||
*/
|
||||
export type EnumCustomerTypeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'CustomerType'>
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Reference to a field of type 'UnitType'
|
||||
*/
|
||||
export type EnumUnitTypeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'UnitType'>
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Reference to a field of type 'GoodPricingModel'
|
||||
*/
|
||||
@@ -4755,6 +4926,34 @@ export type DecimalFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel,
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Reference to a field of type 'SKUGuildType'
|
||||
*/
|
||||
export type EnumSKUGuildTypeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'SKUGuildType'>
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Reference to a field of type 'CustomerType'
|
||||
*/
|
||||
export type EnumCustomerTypeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'CustomerType'>
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Reference to a field of type 'FiscalResponseStatus'
|
||||
*/
|
||||
export type EnumFiscalResponseStatusFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'FiscalResponseStatus'>
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Reference to a field of type 'FiscalRequestType'
|
||||
*/
|
||||
export type EnumFiscalRequestTypeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'FiscalRequestType'>
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Reference to a field of type 'PaymentMethodType'
|
||||
*/
|
||||
@@ -4893,12 +5092,14 @@ export type GlobalOmitConfig = {
|
||||
businessActivity?: Prisma.BusinessActivityOmit
|
||||
complex?: Prisma.ComplexOmit
|
||||
pos?: Prisma.PosOmit
|
||||
good?: Prisma.GoodOmit
|
||||
goodCategory?: Prisma.GoodCategoryOmit
|
||||
measureUnits?: Prisma.MeasureUnitsOmit
|
||||
stockKeepingUnits?: Prisma.StockKeepingUnitsOmit
|
||||
triggerLog?: Prisma.TriggerLogOmit
|
||||
customer?: Prisma.CustomerOmit
|
||||
customerIndividual?: Prisma.CustomerIndividualOmit
|
||||
customerLegal?: Prisma.CustomerLegalOmit
|
||||
good?: Prisma.GoodOmit
|
||||
goodCategory?: Prisma.GoodCategoryOmit
|
||||
guild?: Prisma.GuildOmit
|
||||
salesInvoice?: Prisma.SalesInvoiceOmit
|
||||
salesInvoiceItem?: Prisma.SalesInvoiceItemOmit
|
||||
|
||||
@@ -81,12 +81,14 @@ export const ModelName = {
|
||||
BusinessActivity: 'BusinessActivity',
|
||||
Complex: 'Complex',
|
||||
Pos: 'Pos',
|
||||
Good: 'Good',
|
||||
GoodCategory: 'GoodCategory',
|
||||
MeasureUnits: 'MeasureUnits',
|
||||
StockKeepingUnits: 'StockKeepingUnits',
|
||||
TriggerLog: 'TriggerLog',
|
||||
Customer: 'Customer',
|
||||
CustomerIndividual: 'CustomerIndividual',
|
||||
CustomerLegal: 'CustomerLegal',
|
||||
Good: 'Good',
|
||||
GoodCategory: 'GoodCategory',
|
||||
Guild: 'Guild',
|
||||
SalesInvoice: 'SalesInvoice',
|
||||
SalesInvoiceItem: 'SalesInvoiceItem',
|
||||
@@ -490,6 +492,70 @@ export const PosScalarFieldEnum = {
|
||||
export type PosScalarFieldEnum = (typeof PosScalarFieldEnum)[keyof typeof PosScalarFieldEnum]
|
||||
|
||||
|
||||
export const GoodScalarFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
is_default_guild_good: 'is_default_guild_good',
|
||||
pricing_model: 'pricing_model',
|
||||
description: 'description',
|
||||
local_sku: 'local_sku',
|
||||
barcode: 'barcode',
|
||||
base_sale_price: 'base_sale_price',
|
||||
image_url: 'image_url',
|
||||
created_at: 'created_at',
|
||||
updated_at: 'updated_at',
|
||||
deleted_at: 'deleted_at',
|
||||
sku_id: 'sku_id',
|
||||
measure_unit_id: 'measure_unit_id',
|
||||
category_id: 'category_id',
|
||||
business_activity_id: 'business_activity_id'
|
||||
} as const
|
||||
|
||||
export type GoodScalarFieldEnum = (typeof GoodScalarFieldEnum)[keyof typeof GoodScalarFieldEnum]
|
||||
|
||||
|
||||
export const GoodCategoryScalarFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
description: 'description',
|
||||
image_url: 'image_url',
|
||||
complex_id: 'complex_id',
|
||||
is_default_guild_good: 'is_default_guild_good',
|
||||
guild_id: 'guild_id',
|
||||
created_at: 'created_at',
|
||||
updated_at: 'updated_at',
|
||||
deleted_at: 'deleted_at'
|
||||
} as const
|
||||
|
||||
export type GoodCategoryScalarFieldEnum = (typeof GoodCategoryScalarFieldEnum)[keyof typeof GoodCategoryScalarFieldEnum]
|
||||
|
||||
|
||||
export const MeasureUnitsScalarFieldEnum = {
|
||||
id: 'id',
|
||||
code: 'code',
|
||||
name: 'name',
|
||||
created_at: 'created_at',
|
||||
updated_at: 'updated_at'
|
||||
} as const
|
||||
|
||||
export type MeasureUnitsScalarFieldEnum = (typeof MeasureUnitsScalarFieldEnum)[keyof typeof MeasureUnitsScalarFieldEnum]
|
||||
|
||||
|
||||
export const StockKeepingUnitsScalarFieldEnum = {
|
||||
id: 'id',
|
||||
code: 'code',
|
||||
name: 'name',
|
||||
VAT: 'VAT',
|
||||
type: 'type',
|
||||
is_public: 'is_public',
|
||||
is_domestic: 'is_domestic',
|
||||
created_at: 'created_at',
|
||||
updated_at: 'updated_at'
|
||||
} as const
|
||||
|
||||
export type StockKeepingUnitsScalarFieldEnum = (typeof StockKeepingUnitsScalarFieldEnum)[keyof typeof StockKeepingUnitsScalarFieldEnum]
|
||||
|
||||
|
||||
export const TriggerLogScalarFieldEnum = {
|
||||
id: 'id',
|
||||
message: 'message',
|
||||
@@ -527,7 +593,7 @@ export type CustomerIndividualScalarFieldEnum = (typeof CustomerIndividualScalar
|
||||
|
||||
|
||||
export const CustomerLegalScalarFieldEnum = {
|
||||
company_name: 'company_name',
|
||||
name: 'name',
|
||||
economic_code: 'economic_code',
|
||||
registration_number: 'registration_number',
|
||||
postal_code: 'postal_code',
|
||||
@@ -538,44 +604,6 @@ export const CustomerLegalScalarFieldEnum = {
|
||||
export type CustomerLegalScalarFieldEnum = (typeof CustomerLegalScalarFieldEnum)[keyof typeof CustomerLegalScalarFieldEnum]
|
||||
|
||||
|
||||
export const GoodScalarFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
is_default_guild_good: 'is_default_guild_good',
|
||||
sku: 'sku',
|
||||
unit_type: 'unit_type',
|
||||
pricing_model: 'pricing_model',
|
||||
description: 'description',
|
||||
local_sku: 'local_sku',
|
||||
barcode: 'barcode',
|
||||
base_sale_price: 'base_sale_price',
|
||||
image_url: 'image_url',
|
||||
created_at: 'created_at',
|
||||
updated_at: 'updated_at',
|
||||
deleted_at: 'deleted_at',
|
||||
category_id: 'category_id',
|
||||
business_activity_id: 'business_activity_id'
|
||||
} as const
|
||||
|
||||
export type GoodScalarFieldEnum = (typeof GoodScalarFieldEnum)[keyof typeof GoodScalarFieldEnum]
|
||||
|
||||
|
||||
export const GoodCategoryScalarFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
description: 'description',
|
||||
image_url: 'image_url',
|
||||
complex_id: 'complex_id',
|
||||
is_default_guild_good: 'is_default_guild_good',
|
||||
guild_id: 'guild_id',
|
||||
created_at: 'created_at',
|
||||
updated_at: 'updated_at',
|
||||
deleted_at: 'deleted_at'
|
||||
} as const
|
||||
|
||||
export type GoodCategoryScalarFieldEnum = (typeof GoodCategoryScalarFieldEnum)[keyof typeof GoodCategoryScalarFieldEnum]
|
||||
|
||||
|
||||
export const GuildScalarFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
@@ -608,7 +636,10 @@ export type SalesInvoiceScalarFieldEnum = (typeof SalesInvoiceScalarFieldEnum)[k
|
||||
export const SalesInvoiceItemScalarFieldEnum = {
|
||||
id: 'id',
|
||||
quantity: 'quantity',
|
||||
unit_type: 'unit_type',
|
||||
measure_unit_text: 'measure_unit_text',
|
||||
measure_unit_code: 'measure_unit_code',
|
||||
sku_code: 'sku_code',
|
||||
sku_vat: 'sku_vat',
|
||||
unit_price: 'unit_price',
|
||||
total_amount: 'total_amount',
|
||||
created_at: 'created_at',
|
||||
@@ -641,6 +672,7 @@ export const SaleInvoiceFiscalAttemptsScalarFieldEnum = {
|
||||
attempt_no: 'attempt_no',
|
||||
status: 'status',
|
||||
tax_id: 'tax_id',
|
||||
type: 'type',
|
||||
request_payload: 'request_payload',
|
||||
response_payload: 'response_payload',
|
||||
error_message: 'error_message',
|
||||
@@ -1050,6 +1082,52 @@ export const PosOrderByRelevanceFieldEnum = {
|
||||
export type PosOrderByRelevanceFieldEnum = (typeof PosOrderByRelevanceFieldEnum)[keyof typeof PosOrderByRelevanceFieldEnum]
|
||||
|
||||
|
||||
export const GoodOrderByRelevanceFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
description: 'description',
|
||||
local_sku: 'local_sku',
|
||||
barcode: 'barcode',
|
||||
image_url: 'image_url',
|
||||
sku_id: 'sku_id',
|
||||
measure_unit_id: 'measure_unit_id',
|
||||
category_id: 'category_id',
|
||||
business_activity_id: 'business_activity_id'
|
||||
} as const
|
||||
|
||||
export type GoodOrderByRelevanceFieldEnum = (typeof GoodOrderByRelevanceFieldEnum)[keyof typeof GoodOrderByRelevanceFieldEnum]
|
||||
|
||||
|
||||
export const GoodCategoryOrderByRelevanceFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
description: 'description',
|
||||
image_url: 'image_url',
|
||||
complex_id: 'complex_id',
|
||||
guild_id: 'guild_id'
|
||||
} as const
|
||||
|
||||
export type GoodCategoryOrderByRelevanceFieldEnum = (typeof GoodCategoryOrderByRelevanceFieldEnum)[keyof typeof GoodCategoryOrderByRelevanceFieldEnum]
|
||||
|
||||
|
||||
export const MeasureUnitsOrderByRelevanceFieldEnum = {
|
||||
id: 'id',
|
||||
code: 'code',
|
||||
name: 'name'
|
||||
} as const
|
||||
|
||||
export type MeasureUnitsOrderByRelevanceFieldEnum = (typeof MeasureUnitsOrderByRelevanceFieldEnum)[keyof typeof MeasureUnitsOrderByRelevanceFieldEnum]
|
||||
|
||||
|
||||
export const StockKeepingUnitsOrderByRelevanceFieldEnum = {
|
||||
id: 'id',
|
||||
code: 'code',
|
||||
name: 'name'
|
||||
} as const
|
||||
|
||||
export type StockKeepingUnitsOrderByRelevanceFieldEnum = (typeof StockKeepingUnitsOrderByRelevanceFieldEnum)[keyof typeof StockKeepingUnitsOrderByRelevanceFieldEnum]
|
||||
|
||||
|
||||
export const TriggerLogOrderByRelevanceFieldEnum = {
|
||||
message: 'message',
|
||||
name: 'name'
|
||||
@@ -1080,7 +1158,7 @@ export type CustomerIndividualOrderByRelevanceFieldEnum = (typeof CustomerIndivi
|
||||
|
||||
|
||||
export const CustomerLegalOrderByRelevanceFieldEnum = {
|
||||
company_name: 'company_name',
|
||||
name: 'name',
|
||||
economic_code: 'economic_code',
|
||||
registration_number: 'registration_number',
|
||||
postal_code: 'postal_code',
|
||||
@@ -1091,33 +1169,6 @@ export const CustomerLegalOrderByRelevanceFieldEnum = {
|
||||
export type CustomerLegalOrderByRelevanceFieldEnum = (typeof CustomerLegalOrderByRelevanceFieldEnum)[keyof typeof CustomerLegalOrderByRelevanceFieldEnum]
|
||||
|
||||
|
||||
export const GoodOrderByRelevanceFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
sku: 'sku',
|
||||
description: 'description',
|
||||
local_sku: 'local_sku',
|
||||
barcode: 'barcode',
|
||||
image_url: 'image_url',
|
||||
category_id: 'category_id',
|
||||
business_activity_id: 'business_activity_id'
|
||||
} as const
|
||||
|
||||
export type GoodOrderByRelevanceFieldEnum = (typeof GoodOrderByRelevanceFieldEnum)[keyof typeof GoodOrderByRelevanceFieldEnum]
|
||||
|
||||
|
||||
export const GoodCategoryOrderByRelevanceFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
description: 'description',
|
||||
image_url: 'image_url',
|
||||
complex_id: 'complex_id',
|
||||
guild_id: 'guild_id'
|
||||
} as const
|
||||
|
||||
export type GoodCategoryOrderByRelevanceFieldEnum = (typeof GoodCategoryOrderByRelevanceFieldEnum)[keyof typeof GoodCategoryOrderByRelevanceFieldEnum]
|
||||
|
||||
|
||||
export const GuildOrderByRelevanceFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
@@ -1141,6 +1192,9 @@ export type SalesInvoiceOrderByRelevanceFieldEnum = (typeof SalesInvoiceOrderByR
|
||||
|
||||
export const SalesInvoiceItemOrderByRelevanceFieldEnum = {
|
||||
id: 'id',
|
||||
measure_unit_text: 'measure_unit_text',
|
||||
measure_unit_code: 'measure_unit_code',
|
||||
sku_code: 'sku_code',
|
||||
notes: 'notes',
|
||||
invoice_id: 'invoice_id',
|
||||
good_id: 'good_id',
|
||||
@@ -1160,7 +1214,6 @@ export type SaleInvoiceFiscalsOrderByRelevanceFieldEnum = (typeof SaleInvoiceFis
|
||||
|
||||
export const SaleInvoiceFiscalAttemptsOrderByRelevanceFieldEnum = {
|
||||
id: 'id',
|
||||
status: 'status',
|
||||
tax_id: 'tax_id',
|
||||
error_message: 'error_message',
|
||||
fiscal_id: 'fiscal_id'
|
||||
|
||||
@@ -38,12 +38,14 @@ export type * from './models/ConsumerLegal.js'
|
||||
export type * from './models/BusinessActivity.js'
|
||||
export type * from './models/Complex.js'
|
||||
export type * from './models/Pos.js'
|
||||
export type * from './models/Good.js'
|
||||
export type * from './models/GoodCategory.js'
|
||||
export type * from './models/MeasureUnits.js'
|
||||
export type * from './models/StockKeepingUnits.js'
|
||||
export type * from './models/TriggerLog.js'
|
||||
export type * from './models/Customer.js'
|
||||
export type * from './models/CustomerIndividual.js'
|
||||
export type * from './models/CustomerLegal.js'
|
||||
export type * from './models/Good.js'
|
||||
export type * from './models/GoodCategory.js'
|
||||
export type * from './models/Guild.js'
|
||||
export type * from './models/SalesInvoice.js'
|
||||
export type * from './models/SalesInvoiceItem.js'
|
||||
|
||||
@@ -556,6 +556,22 @@ export type BusinessActivityUpdateOneRequiredWithoutComplexesNestedInput = {
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.BusinessActivityUpdateToOneWithWhereWithoutComplexesInput, Prisma.BusinessActivityUpdateWithoutComplexesInput>, Prisma.BusinessActivityUncheckedUpdateWithoutComplexesInput>
|
||||
}
|
||||
|
||||
export type BusinessActivityCreateNestedOneWithoutGoodsInput = {
|
||||
create?: Prisma.XOR<Prisma.BusinessActivityCreateWithoutGoodsInput, Prisma.BusinessActivityUncheckedCreateWithoutGoodsInput>
|
||||
connectOrCreate?: Prisma.BusinessActivityCreateOrConnectWithoutGoodsInput
|
||||
connect?: Prisma.BusinessActivityWhereUniqueInput
|
||||
}
|
||||
|
||||
export type BusinessActivityUpdateOneWithoutGoodsNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.BusinessActivityCreateWithoutGoodsInput, Prisma.BusinessActivityUncheckedCreateWithoutGoodsInput>
|
||||
connectOrCreate?: Prisma.BusinessActivityCreateOrConnectWithoutGoodsInput
|
||||
upsert?: Prisma.BusinessActivityUpsertWithoutGoodsInput
|
||||
disconnect?: Prisma.BusinessActivityWhereInput | boolean
|
||||
delete?: Prisma.BusinessActivityWhereInput | boolean
|
||||
connect?: Prisma.BusinessActivityWhereUniqueInput
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.BusinessActivityUpdateToOneWithWhereWithoutGoodsInput, Prisma.BusinessActivityUpdateWithoutGoodsInput>, Prisma.BusinessActivityUncheckedUpdateWithoutGoodsInput>
|
||||
}
|
||||
|
||||
export type BusinessActivityCreateNestedOneWithoutCustomer_individualsInput = {
|
||||
create?: Prisma.XOR<Prisma.BusinessActivityCreateWithoutCustomer_individualsInput, Prisma.BusinessActivityUncheckedCreateWithoutCustomer_individualsInput>
|
||||
connectOrCreate?: Prisma.BusinessActivityCreateOrConnectWithoutCustomer_individualsInput
|
||||
@@ -584,22 +600,6 @@ export type BusinessActivityUpdateOneRequiredWithoutCustomer_legalsNestedInput =
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.BusinessActivityUpdateToOneWithWhereWithoutCustomer_legalsInput, Prisma.BusinessActivityUpdateWithoutCustomer_legalsInput>, Prisma.BusinessActivityUncheckedUpdateWithoutCustomer_legalsInput>
|
||||
}
|
||||
|
||||
export type BusinessActivityCreateNestedOneWithoutGoodsInput = {
|
||||
create?: Prisma.XOR<Prisma.BusinessActivityCreateWithoutGoodsInput, Prisma.BusinessActivityUncheckedCreateWithoutGoodsInput>
|
||||
connectOrCreate?: Prisma.BusinessActivityCreateOrConnectWithoutGoodsInput
|
||||
connect?: Prisma.BusinessActivityWhereUniqueInput
|
||||
}
|
||||
|
||||
export type BusinessActivityUpdateOneWithoutGoodsNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.BusinessActivityCreateWithoutGoodsInput, Prisma.BusinessActivityUncheckedCreateWithoutGoodsInput>
|
||||
connectOrCreate?: Prisma.BusinessActivityCreateOrConnectWithoutGoodsInput
|
||||
upsert?: Prisma.BusinessActivityUpsertWithoutGoodsInput
|
||||
disconnect?: Prisma.BusinessActivityWhereInput | boolean
|
||||
delete?: Prisma.BusinessActivityWhereInput | boolean
|
||||
connect?: Prisma.BusinessActivityWhereUniqueInput
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.BusinessActivityUpdateToOneWithWhereWithoutGoodsInput, Prisma.BusinessActivityUpdateWithoutGoodsInput>, Prisma.BusinessActivityUncheckedUpdateWithoutGoodsInput>
|
||||
}
|
||||
|
||||
export type BusinessActivityCreateNestedManyWithoutGuildInput = {
|
||||
create?: Prisma.XOR<Prisma.BusinessActivityCreateWithoutGuildInput, Prisma.BusinessActivityUncheckedCreateWithoutGuildInput> | Prisma.BusinessActivityCreateWithoutGuildInput[] | Prisma.BusinessActivityUncheckedCreateWithoutGuildInput[]
|
||||
connectOrCreate?: Prisma.BusinessActivityCreateOrConnectWithoutGuildInput | Prisma.BusinessActivityCreateOrConnectWithoutGuildInput[]
|
||||
@@ -969,6 +969,90 @@ export type BusinessActivityUncheckedUpdateWithoutComplexesInput = {
|
||||
customer_legals?: Prisma.CustomerLegalUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
}
|
||||
|
||||
export type BusinessActivityCreateWithoutGoodsInput = {
|
||||
id?: string
|
||||
economic_code: string
|
||||
name: string
|
||||
fiscal_id: string
|
||||
partner_token: string
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
guild: Prisma.GuildCreateNestedOneWithoutBusiness_activitiesInput
|
||||
consumer: Prisma.ConsumerCreateNestedOneWithoutBusiness_activitiesInput
|
||||
license_activation?: Prisma.LicenseActivationCreateNestedOneWithoutBusiness_activityInput
|
||||
complexes?: Prisma.ComplexCreateNestedManyWithoutBusiness_activityInput
|
||||
permission_businesses?: Prisma.PermissionBusinessCreateNestedManyWithoutBusinessInput
|
||||
customer_individuals?: Prisma.CustomerIndividualCreateNestedManyWithoutBusiness_activityInput
|
||||
customer_legals?: Prisma.CustomerLegalCreateNestedManyWithoutBusiness_activityInput
|
||||
}
|
||||
|
||||
export type BusinessActivityUncheckedCreateWithoutGoodsInput = {
|
||||
id?: string
|
||||
economic_code: string
|
||||
name: string
|
||||
fiscal_id: string
|
||||
partner_token: string
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
guild_id: string
|
||||
consumer_id: string
|
||||
license_activation?: Prisma.LicenseActivationUncheckedCreateNestedOneWithoutBusiness_activityInput
|
||||
complexes?: Prisma.ComplexUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUncheckedCreateNestedManyWithoutBusinessInput
|
||||
customer_individuals?: Prisma.CustomerIndividualUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
customer_legals?: Prisma.CustomerLegalUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
}
|
||||
|
||||
export type BusinessActivityCreateOrConnectWithoutGoodsInput = {
|
||||
where: Prisma.BusinessActivityWhereUniqueInput
|
||||
create: Prisma.XOR<Prisma.BusinessActivityCreateWithoutGoodsInput, Prisma.BusinessActivityUncheckedCreateWithoutGoodsInput>
|
||||
}
|
||||
|
||||
export type BusinessActivityUpsertWithoutGoodsInput = {
|
||||
update: Prisma.XOR<Prisma.BusinessActivityUpdateWithoutGoodsInput, Prisma.BusinessActivityUncheckedUpdateWithoutGoodsInput>
|
||||
create: Prisma.XOR<Prisma.BusinessActivityCreateWithoutGoodsInput, Prisma.BusinessActivityUncheckedCreateWithoutGoodsInput>
|
||||
where?: Prisma.BusinessActivityWhereInput
|
||||
}
|
||||
|
||||
export type BusinessActivityUpdateToOneWithWhereWithoutGoodsInput = {
|
||||
where?: Prisma.BusinessActivityWhereInput
|
||||
data: Prisma.XOR<Prisma.BusinessActivityUpdateWithoutGoodsInput, Prisma.BusinessActivityUncheckedUpdateWithoutGoodsInput>
|
||||
}
|
||||
|
||||
export type BusinessActivityUpdateWithoutGoodsInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
economic_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
fiscal_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
partner_token?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
guild?: Prisma.GuildUpdateOneRequiredWithoutBusiness_activitiesNestedInput
|
||||
consumer?: Prisma.ConsumerUpdateOneRequiredWithoutBusiness_activitiesNestedInput
|
||||
license_activation?: Prisma.LicenseActivationUpdateOneWithoutBusiness_activityNestedInput
|
||||
complexes?: Prisma.ComplexUpdateManyWithoutBusiness_activityNestedInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUpdateManyWithoutBusinessNestedInput
|
||||
customer_individuals?: Prisma.CustomerIndividualUpdateManyWithoutBusiness_activityNestedInput
|
||||
customer_legals?: Prisma.CustomerLegalUpdateManyWithoutBusiness_activityNestedInput
|
||||
}
|
||||
|
||||
export type BusinessActivityUncheckedUpdateWithoutGoodsInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
economic_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
fiscal_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
partner_token?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
guild_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
consumer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
license_activation?: Prisma.LicenseActivationUncheckedUpdateOneWithoutBusiness_activityNestedInput
|
||||
complexes?: Prisma.ComplexUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUncheckedUpdateManyWithoutBusinessNestedInput
|
||||
customer_individuals?: Prisma.CustomerIndividualUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
customer_legals?: Prisma.CustomerLegalUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
}
|
||||
|
||||
export type BusinessActivityCreateWithoutCustomer_individualsInput = {
|
||||
id?: string
|
||||
economic_code: string
|
||||
@@ -1137,90 +1221,6 @@ export type BusinessActivityUncheckedUpdateWithoutCustomer_legalsInput = {
|
||||
customer_individuals?: Prisma.CustomerIndividualUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
}
|
||||
|
||||
export type BusinessActivityCreateWithoutGoodsInput = {
|
||||
id?: string
|
||||
economic_code: string
|
||||
name: string
|
||||
fiscal_id: string
|
||||
partner_token: string
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
guild: Prisma.GuildCreateNestedOneWithoutBusiness_activitiesInput
|
||||
consumer: Prisma.ConsumerCreateNestedOneWithoutBusiness_activitiesInput
|
||||
license_activation?: Prisma.LicenseActivationCreateNestedOneWithoutBusiness_activityInput
|
||||
complexes?: Prisma.ComplexCreateNestedManyWithoutBusiness_activityInput
|
||||
permission_businesses?: Prisma.PermissionBusinessCreateNestedManyWithoutBusinessInput
|
||||
customer_individuals?: Prisma.CustomerIndividualCreateNestedManyWithoutBusiness_activityInput
|
||||
customer_legals?: Prisma.CustomerLegalCreateNestedManyWithoutBusiness_activityInput
|
||||
}
|
||||
|
||||
export type BusinessActivityUncheckedCreateWithoutGoodsInput = {
|
||||
id?: string
|
||||
economic_code: string
|
||||
name: string
|
||||
fiscal_id: string
|
||||
partner_token: string
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
guild_id: string
|
||||
consumer_id: string
|
||||
license_activation?: Prisma.LicenseActivationUncheckedCreateNestedOneWithoutBusiness_activityInput
|
||||
complexes?: Prisma.ComplexUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUncheckedCreateNestedManyWithoutBusinessInput
|
||||
customer_individuals?: Prisma.CustomerIndividualUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
customer_legals?: Prisma.CustomerLegalUncheckedCreateNestedManyWithoutBusiness_activityInput
|
||||
}
|
||||
|
||||
export type BusinessActivityCreateOrConnectWithoutGoodsInput = {
|
||||
where: Prisma.BusinessActivityWhereUniqueInput
|
||||
create: Prisma.XOR<Prisma.BusinessActivityCreateWithoutGoodsInput, Prisma.BusinessActivityUncheckedCreateWithoutGoodsInput>
|
||||
}
|
||||
|
||||
export type BusinessActivityUpsertWithoutGoodsInput = {
|
||||
update: Prisma.XOR<Prisma.BusinessActivityUpdateWithoutGoodsInput, Prisma.BusinessActivityUncheckedUpdateWithoutGoodsInput>
|
||||
create: Prisma.XOR<Prisma.BusinessActivityCreateWithoutGoodsInput, Prisma.BusinessActivityUncheckedCreateWithoutGoodsInput>
|
||||
where?: Prisma.BusinessActivityWhereInput
|
||||
}
|
||||
|
||||
export type BusinessActivityUpdateToOneWithWhereWithoutGoodsInput = {
|
||||
where?: Prisma.BusinessActivityWhereInput
|
||||
data: Prisma.XOR<Prisma.BusinessActivityUpdateWithoutGoodsInput, Prisma.BusinessActivityUncheckedUpdateWithoutGoodsInput>
|
||||
}
|
||||
|
||||
export type BusinessActivityUpdateWithoutGoodsInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
economic_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
fiscal_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
partner_token?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
guild?: Prisma.GuildUpdateOneRequiredWithoutBusiness_activitiesNestedInput
|
||||
consumer?: Prisma.ConsumerUpdateOneRequiredWithoutBusiness_activitiesNestedInput
|
||||
license_activation?: Prisma.LicenseActivationUpdateOneWithoutBusiness_activityNestedInput
|
||||
complexes?: Prisma.ComplexUpdateManyWithoutBusiness_activityNestedInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUpdateManyWithoutBusinessNestedInput
|
||||
customer_individuals?: Prisma.CustomerIndividualUpdateManyWithoutBusiness_activityNestedInput
|
||||
customer_legals?: Prisma.CustomerLegalUpdateManyWithoutBusiness_activityNestedInput
|
||||
}
|
||||
|
||||
export type BusinessActivityUncheckedUpdateWithoutGoodsInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
economic_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
fiscal_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
partner_token?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
guild_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
consumer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
license_activation?: Prisma.LicenseActivationUncheckedUpdateOneWithoutBusiness_activityNestedInput
|
||||
complexes?: Prisma.ComplexUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
permission_businesses?: Prisma.PermissionBusinessUncheckedUpdateManyWithoutBusinessNestedInput
|
||||
customer_individuals?: Prisma.CustomerIndividualUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
customer_legals?: Prisma.CustomerLegalUncheckedUpdateManyWithoutBusiness_activityNestedInput
|
||||
}
|
||||
|
||||
export type BusinessActivityCreateWithoutGuildInput = {
|
||||
id?: string
|
||||
economic_code: string
|
||||
|
||||
@@ -373,10 +373,6 @@ export type EnumCustomerTypeFieldUpdateOperationsInput = {
|
||||
set?: $Enums.CustomerType
|
||||
}
|
||||
|
||||
export type NullableDateTimeFieldUpdateOperationsInput = {
|
||||
set?: Date | string | null
|
||||
}
|
||||
|
||||
export type CustomerCreateNestedOneWithoutIndividualInput = {
|
||||
create?: Prisma.XOR<Prisma.CustomerCreateWithoutIndividualInput, Prisma.CustomerUncheckedCreateWithoutIndividualInput>
|
||||
connectOrCreate?: Prisma.CustomerCreateOrConnectWithoutIndividualInput
|
||||
|
||||
@@ -25,7 +25,7 @@ export type AggregateCustomerLegal = {
|
||||
}
|
||||
|
||||
export type CustomerLegalMinAggregateOutputType = {
|
||||
company_name: string | null
|
||||
name: string | null
|
||||
economic_code: string | null
|
||||
registration_number: string | null
|
||||
postal_code: string | null
|
||||
@@ -34,7 +34,7 @@ export type CustomerLegalMinAggregateOutputType = {
|
||||
}
|
||||
|
||||
export type CustomerLegalMaxAggregateOutputType = {
|
||||
company_name: string | null
|
||||
name: string | null
|
||||
economic_code: string | null
|
||||
registration_number: string | null
|
||||
postal_code: string | null
|
||||
@@ -43,7 +43,7 @@ export type CustomerLegalMaxAggregateOutputType = {
|
||||
}
|
||||
|
||||
export type CustomerLegalCountAggregateOutputType = {
|
||||
company_name: number
|
||||
name: number
|
||||
economic_code: number
|
||||
registration_number: number
|
||||
postal_code: number
|
||||
@@ -54,7 +54,7 @@ export type CustomerLegalCountAggregateOutputType = {
|
||||
|
||||
|
||||
export type CustomerLegalMinAggregateInputType = {
|
||||
company_name?: true
|
||||
name?: true
|
||||
economic_code?: true
|
||||
registration_number?: true
|
||||
postal_code?: true
|
||||
@@ -63,7 +63,7 @@ export type CustomerLegalMinAggregateInputType = {
|
||||
}
|
||||
|
||||
export type CustomerLegalMaxAggregateInputType = {
|
||||
company_name?: true
|
||||
name?: true
|
||||
economic_code?: true
|
||||
registration_number?: true
|
||||
postal_code?: true
|
||||
@@ -72,7 +72,7 @@ export type CustomerLegalMaxAggregateInputType = {
|
||||
}
|
||||
|
||||
export type CustomerLegalCountAggregateInputType = {
|
||||
company_name?: true
|
||||
name?: true
|
||||
economic_code?: true
|
||||
registration_number?: true
|
||||
postal_code?: true
|
||||
@@ -154,7 +154,7 @@ export type CustomerLegalGroupByArgs<ExtArgs extends runtime.Types.Extensions.In
|
||||
}
|
||||
|
||||
export type CustomerLegalGroupByOutputType = {
|
||||
company_name: string
|
||||
name: string
|
||||
economic_code: string
|
||||
registration_number: string | null
|
||||
postal_code: string
|
||||
@@ -184,7 +184,7 @@ export type CustomerLegalWhereInput = {
|
||||
AND?: Prisma.CustomerLegalWhereInput | Prisma.CustomerLegalWhereInput[]
|
||||
OR?: Prisma.CustomerLegalWhereInput[]
|
||||
NOT?: Prisma.CustomerLegalWhereInput | Prisma.CustomerLegalWhereInput[]
|
||||
company_name?: Prisma.StringFilter<"CustomerLegal"> | string
|
||||
name?: Prisma.StringFilter<"CustomerLegal"> | string
|
||||
economic_code?: Prisma.StringFilter<"CustomerLegal"> | string
|
||||
registration_number?: Prisma.StringNullableFilter<"CustomerLegal"> | string | null
|
||||
postal_code?: Prisma.StringFilter<"CustomerLegal"> | string
|
||||
@@ -195,7 +195,7 @@ export type CustomerLegalWhereInput = {
|
||||
}
|
||||
|
||||
export type CustomerLegalOrderByWithRelationInput = {
|
||||
company_name?: Prisma.SortOrder
|
||||
name?: Prisma.SortOrder
|
||||
economic_code?: Prisma.SortOrder
|
||||
registration_number?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
postal_code?: Prisma.SortOrder
|
||||
@@ -212,7 +212,7 @@ export type CustomerLegalWhereUniqueInput = Prisma.AtLeast<{
|
||||
AND?: Prisma.CustomerLegalWhereInput | Prisma.CustomerLegalWhereInput[]
|
||||
OR?: Prisma.CustomerLegalWhereInput[]
|
||||
NOT?: Prisma.CustomerLegalWhereInput | Prisma.CustomerLegalWhereInput[]
|
||||
company_name?: Prisma.StringFilter<"CustomerLegal"> | string
|
||||
name?: Prisma.StringFilter<"CustomerLegal"> | string
|
||||
economic_code?: Prisma.StringFilter<"CustomerLegal"> | string
|
||||
registration_number?: Prisma.StringNullableFilter<"CustomerLegal"> | string | null
|
||||
postal_code?: Prisma.StringFilter<"CustomerLegal"> | string
|
||||
@@ -222,7 +222,7 @@ export type CustomerLegalWhereUniqueInput = Prisma.AtLeast<{
|
||||
}, "customer_id" | "business_activity_id_economic_code">
|
||||
|
||||
export type CustomerLegalOrderByWithAggregationInput = {
|
||||
company_name?: Prisma.SortOrder
|
||||
name?: Prisma.SortOrder
|
||||
economic_code?: Prisma.SortOrder
|
||||
registration_number?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
postal_code?: Prisma.SortOrder
|
||||
@@ -237,7 +237,7 @@ export type CustomerLegalScalarWhereWithAggregatesInput = {
|
||||
AND?: Prisma.CustomerLegalScalarWhereWithAggregatesInput | Prisma.CustomerLegalScalarWhereWithAggregatesInput[]
|
||||
OR?: Prisma.CustomerLegalScalarWhereWithAggregatesInput[]
|
||||
NOT?: Prisma.CustomerLegalScalarWhereWithAggregatesInput | Prisma.CustomerLegalScalarWhereWithAggregatesInput[]
|
||||
company_name?: Prisma.StringWithAggregatesFilter<"CustomerLegal"> | string
|
||||
name?: Prisma.StringWithAggregatesFilter<"CustomerLegal"> | string
|
||||
economic_code?: Prisma.StringWithAggregatesFilter<"CustomerLegal"> | string
|
||||
registration_number?: Prisma.StringNullableWithAggregatesFilter<"CustomerLegal"> | string | null
|
||||
postal_code?: Prisma.StringWithAggregatesFilter<"CustomerLegal"> | string
|
||||
@@ -246,7 +246,7 @@ export type CustomerLegalScalarWhereWithAggregatesInput = {
|
||||
}
|
||||
|
||||
export type CustomerLegalCreateInput = {
|
||||
company_name: string
|
||||
name: string
|
||||
economic_code: string
|
||||
registration_number?: string | null
|
||||
postal_code: string
|
||||
@@ -255,7 +255,7 @@ export type CustomerLegalCreateInput = {
|
||||
}
|
||||
|
||||
export type CustomerLegalUncheckedCreateInput = {
|
||||
company_name: string
|
||||
name: string
|
||||
economic_code: string
|
||||
registration_number?: string | null
|
||||
postal_code: string
|
||||
@@ -264,7 +264,7 @@ export type CustomerLegalUncheckedCreateInput = {
|
||||
}
|
||||
|
||||
export type CustomerLegalUpdateInput = {
|
||||
company_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
economic_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
registration_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
postal_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
@@ -273,7 +273,7 @@ export type CustomerLegalUpdateInput = {
|
||||
}
|
||||
|
||||
export type CustomerLegalUncheckedUpdateInput = {
|
||||
company_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
economic_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
registration_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
postal_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
@@ -282,7 +282,7 @@ export type CustomerLegalUncheckedUpdateInput = {
|
||||
}
|
||||
|
||||
export type CustomerLegalCreateManyInput = {
|
||||
company_name: string
|
||||
name: string
|
||||
economic_code: string
|
||||
registration_number?: string | null
|
||||
postal_code: string
|
||||
@@ -291,14 +291,14 @@ export type CustomerLegalCreateManyInput = {
|
||||
}
|
||||
|
||||
export type CustomerLegalUpdateManyMutationInput = {
|
||||
company_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
economic_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
registration_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
postal_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
}
|
||||
|
||||
export type CustomerLegalUncheckedUpdateManyInput = {
|
||||
company_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
economic_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
registration_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
postal_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
@@ -333,7 +333,7 @@ export type CustomerLegalBusiness_activity_idEconomic_codeCompoundUniqueInput =
|
||||
}
|
||||
|
||||
export type CustomerLegalCountOrderByAggregateInput = {
|
||||
company_name?: Prisma.SortOrder
|
||||
name?: Prisma.SortOrder
|
||||
economic_code?: Prisma.SortOrder
|
||||
registration_number?: Prisma.SortOrder
|
||||
postal_code?: Prisma.SortOrder
|
||||
@@ -342,7 +342,7 @@ export type CustomerLegalCountOrderByAggregateInput = {
|
||||
}
|
||||
|
||||
export type CustomerLegalMaxOrderByAggregateInput = {
|
||||
company_name?: Prisma.SortOrder
|
||||
name?: Prisma.SortOrder
|
||||
economic_code?: Prisma.SortOrder
|
||||
registration_number?: Prisma.SortOrder
|
||||
postal_code?: Prisma.SortOrder
|
||||
@@ -351,7 +351,7 @@ export type CustomerLegalMaxOrderByAggregateInput = {
|
||||
}
|
||||
|
||||
export type CustomerLegalMinOrderByAggregateInput = {
|
||||
company_name?: Prisma.SortOrder
|
||||
name?: Prisma.SortOrder
|
||||
economic_code?: Prisma.SortOrder
|
||||
registration_number?: Prisma.SortOrder
|
||||
postal_code?: Prisma.SortOrder
|
||||
@@ -434,7 +434,7 @@ export type CustomerLegalUncheckedUpdateOneWithoutCustomerNestedInput = {
|
||||
}
|
||||
|
||||
export type CustomerLegalCreateWithoutBusiness_activityInput = {
|
||||
company_name: string
|
||||
name: string
|
||||
economic_code: string
|
||||
registration_number?: string | null
|
||||
postal_code: string
|
||||
@@ -442,7 +442,7 @@ export type CustomerLegalCreateWithoutBusiness_activityInput = {
|
||||
}
|
||||
|
||||
export type CustomerLegalUncheckedCreateWithoutBusiness_activityInput = {
|
||||
company_name: string
|
||||
name: string
|
||||
economic_code: string
|
||||
registration_number?: string | null
|
||||
postal_code: string
|
||||
@@ -479,7 +479,7 @@ export type CustomerLegalScalarWhereInput = {
|
||||
AND?: Prisma.CustomerLegalScalarWhereInput | Prisma.CustomerLegalScalarWhereInput[]
|
||||
OR?: Prisma.CustomerLegalScalarWhereInput[]
|
||||
NOT?: Prisma.CustomerLegalScalarWhereInput | Prisma.CustomerLegalScalarWhereInput[]
|
||||
company_name?: Prisma.StringFilter<"CustomerLegal"> | string
|
||||
name?: Prisma.StringFilter<"CustomerLegal"> | string
|
||||
economic_code?: Prisma.StringFilter<"CustomerLegal"> | string
|
||||
registration_number?: Prisma.StringNullableFilter<"CustomerLegal"> | string | null
|
||||
postal_code?: Prisma.StringFilter<"CustomerLegal"> | string
|
||||
@@ -488,7 +488,7 @@ export type CustomerLegalScalarWhereInput = {
|
||||
}
|
||||
|
||||
export type CustomerLegalCreateWithoutCustomerInput = {
|
||||
company_name: string
|
||||
name: string
|
||||
economic_code: string
|
||||
registration_number?: string | null
|
||||
postal_code: string
|
||||
@@ -496,7 +496,7 @@ export type CustomerLegalCreateWithoutCustomerInput = {
|
||||
}
|
||||
|
||||
export type CustomerLegalUncheckedCreateWithoutCustomerInput = {
|
||||
company_name: string
|
||||
name: string
|
||||
economic_code: string
|
||||
registration_number?: string | null
|
||||
postal_code: string
|
||||
@@ -520,7 +520,7 @@ export type CustomerLegalUpdateToOneWithWhereWithoutCustomerInput = {
|
||||
}
|
||||
|
||||
export type CustomerLegalUpdateWithoutCustomerInput = {
|
||||
company_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
economic_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
registration_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
postal_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
@@ -528,7 +528,7 @@ export type CustomerLegalUpdateWithoutCustomerInput = {
|
||||
}
|
||||
|
||||
export type CustomerLegalUncheckedUpdateWithoutCustomerInput = {
|
||||
company_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
economic_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
registration_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
postal_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
@@ -536,7 +536,7 @@ export type CustomerLegalUncheckedUpdateWithoutCustomerInput = {
|
||||
}
|
||||
|
||||
export type CustomerLegalCreateManyBusiness_activityInput = {
|
||||
company_name: string
|
||||
name: string
|
||||
economic_code: string
|
||||
registration_number?: string | null
|
||||
postal_code: string
|
||||
@@ -544,7 +544,7 @@ export type CustomerLegalCreateManyBusiness_activityInput = {
|
||||
}
|
||||
|
||||
export type CustomerLegalUpdateWithoutBusiness_activityInput = {
|
||||
company_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
economic_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
registration_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
postal_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
@@ -552,7 +552,7 @@ export type CustomerLegalUpdateWithoutBusiness_activityInput = {
|
||||
}
|
||||
|
||||
export type CustomerLegalUncheckedUpdateWithoutBusiness_activityInput = {
|
||||
company_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
economic_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
registration_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
postal_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
@@ -560,7 +560,7 @@ export type CustomerLegalUncheckedUpdateWithoutBusiness_activityInput = {
|
||||
}
|
||||
|
||||
export type CustomerLegalUncheckedUpdateManyWithoutBusiness_activityInput = {
|
||||
company_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
economic_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
registration_number?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
postal_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
@@ -570,7 +570,7 @@ export type CustomerLegalUncheckedUpdateManyWithoutBusiness_activityInput = {
|
||||
|
||||
|
||||
export type CustomerLegalSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
||||
company_name?: boolean
|
||||
name?: boolean
|
||||
economic_code?: boolean
|
||||
registration_number?: boolean
|
||||
postal_code?: boolean
|
||||
@@ -583,7 +583,7 @@ export type CustomerLegalSelect<ExtArgs extends runtime.Types.Extensions.Interna
|
||||
|
||||
|
||||
export type CustomerLegalSelectScalar = {
|
||||
company_name?: boolean
|
||||
name?: boolean
|
||||
economic_code?: boolean
|
||||
registration_number?: boolean
|
||||
postal_code?: boolean
|
||||
@@ -591,7 +591,7 @@ export type CustomerLegalSelectScalar = {
|
||||
business_activity_id?: boolean
|
||||
}
|
||||
|
||||
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" | "business_activity_id", ExtArgs["result"]["customerLegal"]>
|
||||
export type CustomerLegalOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"name" | "economic_code" | "registration_number" | "postal_code" | "customer_id" | "business_activity_id", ExtArgs["result"]["customerLegal"]>
|
||||
export type CustomerLegalInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
customer?: boolean | Prisma.CustomerDefaultArgs<ExtArgs>
|
||||
business_activity?: boolean | Prisma.BusinessActivityDefaultArgs<ExtArgs>
|
||||
@@ -604,7 +604,7 @@ export type $CustomerLegalPayload<ExtArgs extends runtime.Types.Extensions.Inter
|
||||
business_activity: Prisma.$BusinessActivityPayload<ExtArgs>
|
||||
}
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
company_name: string
|
||||
name: string
|
||||
economic_code: string
|
||||
registration_number: string | null
|
||||
postal_code: string
|
||||
@@ -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 `company_name`
|
||||
* const customerLegalWithCompany_nameOnly = await prisma.customerLegal.findMany({ select: { company_name: true } })
|
||||
* // Only select the `name`
|
||||
* const customerLegalWithNameOnly = await prisma.customerLegal.findMany({ select: { 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,7 +981,7 @@ export interface Prisma__CustomerLegalClient<T, Null = never, ExtArgs extends ru
|
||||
* Fields of the CustomerLegal model
|
||||
*/
|
||||
export interface CustomerLegalFieldRefs {
|
||||
readonly company_name: Prisma.FieldRef<"CustomerLegal", 'String'>
|
||||
readonly 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'>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -37,8 +37,9 @@ export type SaleInvoiceFiscalAttemptsSumAggregateOutputType = {
|
||||
export type SaleInvoiceFiscalAttemptsMinAggregateOutputType = {
|
||||
id: string | null
|
||||
attempt_no: number | null
|
||||
status: string | null
|
||||
status: $Enums.FiscalResponseStatus | null
|
||||
tax_id: string | null
|
||||
type: $Enums.FiscalRequestType | null
|
||||
error_message: string | null
|
||||
sent_at: Date | null
|
||||
received_at: Date | null
|
||||
@@ -49,8 +50,9 @@ export type SaleInvoiceFiscalAttemptsMinAggregateOutputType = {
|
||||
export type SaleInvoiceFiscalAttemptsMaxAggregateOutputType = {
|
||||
id: string | null
|
||||
attempt_no: number | null
|
||||
status: string | null
|
||||
status: $Enums.FiscalResponseStatus | null
|
||||
tax_id: string | null
|
||||
type: $Enums.FiscalRequestType | null
|
||||
error_message: string | null
|
||||
sent_at: Date | null
|
||||
received_at: Date | null
|
||||
@@ -63,6 +65,7 @@ export type SaleInvoiceFiscalAttemptsCountAggregateOutputType = {
|
||||
attempt_no: number
|
||||
status: number
|
||||
tax_id: number
|
||||
type: number
|
||||
request_payload: number
|
||||
response_payload: number
|
||||
error_message: number
|
||||
@@ -87,6 +90,7 @@ export type SaleInvoiceFiscalAttemptsMinAggregateInputType = {
|
||||
attempt_no?: true
|
||||
status?: true
|
||||
tax_id?: true
|
||||
type?: true
|
||||
error_message?: true
|
||||
sent_at?: true
|
||||
received_at?: true
|
||||
@@ -99,6 +103,7 @@ export type SaleInvoiceFiscalAttemptsMaxAggregateInputType = {
|
||||
attempt_no?: true
|
||||
status?: true
|
||||
tax_id?: true
|
||||
type?: true
|
||||
error_message?: true
|
||||
sent_at?: true
|
||||
received_at?: true
|
||||
@@ -111,6 +116,7 @@ export type SaleInvoiceFiscalAttemptsCountAggregateInputType = {
|
||||
attempt_no?: true
|
||||
status?: true
|
||||
tax_id?: true
|
||||
type?: true
|
||||
request_payload?: true
|
||||
response_payload?: true
|
||||
error_message?: true
|
||||
@@ -210,8 +216,9 @@ export type SaleInvoiceFiscalAttemptsGroupByArgs<ExtArgs extends runtime.Types.E
|
||||
export type SaleInvoiceFiscalAttemptsGroupByOutputType = {
|
||||
id: string
|
||||
attempt_no: number
|
||||
status: string
|
||||
status: $Enums.FiscalResponseStatus
|
||||
tax_id: string | null
|
||||
type: $Enums.FiscalRequestType
|
||||
request_payload: runtime.JsonValue | null
|
||||
response_payload: runtime.JsonValue | null
|
||||
error_message: string | null
|
||||
@@ -247,8 +254,9 @@ export type SaleInvoiceFiscalAttemptsWhereInput = {
|
||||
NOT?: Prisma.SaleInvoiceFiscalAttemptsWhereInput | Prisma.SaleInvoiceFiscalAttemptsWhereInput[]
|
||||
id?: Prisma.StringFilter<"SaleInvoiceFiscalAttempts"> | string
|
||||
attempt_no?: Prisma.IntFilter<"SaleInvoiceFiscalAttempts"> | number
|
||||
status?: Prisma.StringFilter<"SaleInvoiceFiscalAttempts"> | string
|
||||
status?: Prisma.EnumFiscalResponseStatusFilter<"SaleInvoiceFiscalAttempts"> | $Enums.FiscalResponseStatus
|
||||
tax_id?: Prisma.StringNullableFilter<"SaleInvoiceFiscalAttempts"> | string | null
|
||||
type?: Prisma.EnumFiscalRequestTypeFilter<"SaleInvoiceFiscalAttempts"> | $Enums.FiscalRequestType
|
||||
request_payload?: Prisma.JsonNullableFilter<"SaleInvoiceFiscalAttempts">
|
||||
response_payload?: Prisma.JsonNullableFilter<"SaleInvoiceFiscalAttempts">
|
||||
error_message?: Prisma.StringNullableFilter<"SaleInvoiceFiscalAttempts"> | string | null
|
||||
@@ -264,6 +272,7 @@ export type SaleInvoiceFiscalAttemptsOrderByWithRelationInput = {
|
||||
attempt_no?: Prisma.SortOrder
|
||||
status?: Prisma.SortOrder
|
||||
tax_id?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
type?: Prisma.SortOrder
|
||||
request_payload?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
response_payload?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
error_message?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
@@ -283,7 +292,8 @@ export type SaleInvoiceFiscalAttemptsWhereUniqueInput = Prisma.AtLeast<{
|
||||
OR?: Prisma.SaleInvoiceFiscalAttemptsWhereInput[]
|
||||
NOT?: Prisma.SaleInvoiceFiscalAttemptsWhereInput | Prisma.SaleInvoiceFiscalAttemptsWhereInput[]
|
||||
attempt_no?: Prisma.IntFilter<"SaleInvoiceFiscalAttempts"> | number
|
||||
status?: Prisma.StringFilter<"SaleInvoiceFiscalAttempts"> | string
|
||||
status?: Prisma.EnumFiscalResponseStatusFilter<"SaleInvoiceFiscalAttempts"> | $Enums.FiscalResponseStatus
|
||||
type?: Prisma.EnumFiscalRequestTypeFilter<"SaleInvoiceFiscalAttempts"> | $Enums.FiscalRequestType
|
||||
request_payload?: Prisma.JsonNullableFilter<"SaleInvoiceFiscalAttempts">
|
||||
response_payload?: Prisma.JsonNullableFilter<"SaleInvoiceFiscalAttempts">
|
||||
error_message?: Prisma.StringNullableFilter<"SaleInvoiceFiscalAttempts"> | string | null
|
||||
@@ -299,6 +309,7 @@ export type SaleInvoiceFiscalAttemptsOrderByWithAggregationInput = {
|
||||
attempt_no?: Prisma.SortOrder
|
||||
status?: Prisma.SortOrder
|
||||
tax_id?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
type?: Prisma.SortOrder
|
||||
request_payload?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
response_payload?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
error_message?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
@@ -319,8 +330,9 @@ export type SaleInvoiceFiscalAttemptsScalarWhereWithAggregatesInput = {
|
||||
NOT?: Prisma.SaleInvoiceFiscalAttemptsScalarWhereWithAggregatesInput | Prisma.SaleInvoiceFiscalAttemptsScalarWhereWithAggregatesInput[]
|
||||
id?: Prisma.StringWithAggregatesFilter<"SaleInvoiceFiscalAttempts"> | string
|
||||
attempt_no?: Prisma.IntWithAggregatesFilter<"SaleInvoiceFiscalAttempts"> | number
|
||||
status?: Prisma.StringWithAggregatesFilter<"SaleInvoiceFiscalAttempts"> | string
|
||||
status?: Prisma.EnumFiscalResponseStatusWithAggregatesFilter<"SaleInvoiceFiscalAttempts"> | $Enums.FiscalResponseStatus
|
||||
tax_id?: Prisma.StringNullableWithAggregatesFilter<"SaleInvoiceFiscalAttempts"> | string | null
|
||||
type?: Prisma.EnumFiscalRequestTypeWithAggregatesFilter<"SaleInvoiceFiscalAttempts"> | $Enums.FiscalRequestType
|
||||
request_payload?: Prisma.JsonNullableWithAggregatesFilter<"SaleInvoiceFiscalAttempts">
|
||||
response_payload?: Prisma.JsonNullableWithAggregatesFilter<"SaleInvoiceFiscalAttempts">
|
||||
error_message?: Prisma.StringNullableWithAggregatesFilter<"SaleInvoiceFiscalAttempts"> | string | null
|
||||
@@ -333,8 +345,9 @@ export type SaleInvoiceFiscalAttemptsScalarWhereWithAggregatesInput = {
|
||||
export type SaleInvoiceFiscalAttemptsCreateInput = {
|
||||
id?: string
|
||||
attempt_no: number
|
||||
status: string
|
||||
status: $Enums.FiscalResponseStatus
|
||||
tax_id?: string | null
|
||||
type: $Enums.FiscalRequestType
|
||||
request_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
response_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
error_message?: string | null
|
||||
@@ -347,8 +360,9 @@ export type SaleInvoiceFiscalAttemptsCreateInput = {
|
||||
export type SaleInvoiceFiscalAttemptsUncheckedCreateInput = {
|
||||
id?: string
|
||||
attempt_no: number
|
||||
status: string
|
||||
status: $Enums.FiscalResponseStatus
|
||||
tax_id?: string | null
|
||||
type: $Enums.FiscalRequestType
|
||||
request_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
response_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
error_message?: string | null
|
||||
@@ -361,8 +375,9 @@ export type SaleInvoiceFiscalAttemptsUncheckedCreateInput = {
|
||||
export type SaleInvoiceFiscalAttemptsUpdateInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
attempt_no?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
status?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
status?: Prisma.EnumFiscalResponseStatusFieldUpdateOperationsInput | $Enums.FiscalResponseStatus
|
||||
tax_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
type?: Prisma.EnumFiscalRequestTypeFieldUpdateOperationsInput | $Enums.FiscalRequestType
|
||||
request_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
response_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
error_message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
@@ -375,8 +390,9 @@ export type SaleInvoiceFiscalAttemptsUpdateInput = {
|
||||
export type SaleInvoiceFiscalAttemptsUncheckedUpdateInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
attempt_no?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
status?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
status?: Prisma.EnumFiscalResponseStatusFieldUpdateOperationsInput | $Enums.FiscalResponseStatus
|
||||
tax_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
type?: Prisma.EnumFiscalRequestTypeFieldUpdateOperationsInput | $Enums.FiscalRequestType
|
||||
request_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
response_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
error_message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
@@ -389,8 +405,9 @@ export type SaleInvoiceFiscalAttemptsUncheckedUpdateInput = {
|
||||
export type SaleInvoiceFiscalAttemptsCreateManyInput = {
|
||||
id?: string
|
||||
attempt_no: number
|
||||
status: string
|
||||
status: $Enums.FiscalResponseStatus
|
||||
tax_id?: string | null
|
||||
type: $Enums.FiscalRequestType
|
||||
request_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
response_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
error_message?: string | null
|
||||
@@ -403,8 +420,9 @@ export type SaleInvoiceFiscalAttemptsCreateManyInput = {
|
||||
export type SaleInvoiceFiscalAttemptsUpdateManyMutationInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
attempt_no?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
status?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
status?: Prisma.EnumFiscalResponseStatusFieldUpdateOperationsInput | $Enums.FiscalResponseStatus
|
||||
tax_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
type?: Prisma.EnumFiscalRequestTypeFieldUpdateOperationsInput | $Enums.FiscalRequestType
|
||||
request_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
response_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
error_message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
@@ -416,8 +434,9 @@ export type SaleInvoiceFiscalAttemptsUpdateManyMutationInput = {
|
||||
export type SaleInvoiceFiscalAttemptsUncheckedUpdateManyInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
attempt_no?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
status?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
status?: Prisma.EnumFiscalResponseStatusFieldUpdateOperationsInput | $Enums.FiscalResponseStatus
|
||||
tax_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
type?: Prisma.EnumFiscalRequestTypeFieldUpdateOperationsInput | $Enums.FiscalRequestType
|
||||
request_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
response_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
error_message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
@@ -453,6 +472,7 @@ export type SaleInvoiceFiscalAttemptsCountOrderByAggregateInput = {
|
||||
attempt_no?: Prisma.SortOrder
|
||||
status?: Prisma.SortOrder
|
||||
tax_id?: Prisma.SortOrder
|
||||
type?: Prisma.SortOrder
|
||||
request_payload?: Prisma.SortOrder
|
||||
response_payload?: Prisma.SortOrder
|
||||
error_message?: Prisma.SortOrder
|
||||
@@ -471,6 +491,7 @@ export type SaleInvoiceFiscalAttemptsMaxOrderByAggregateInput = {
|
||||
attempt_no?: Prisma.SortOrder
|
||||
status?: Prisma.SortOrder
|
||||
tax_id?: Prisma.SortOrder
|
||||
type?: Prisma.SortOrder
|
||||
error_message?: Prisma.SortOrder
|
||||
sent_at?: Prisma.SortOrder
|
||||
received_at?: Prisma.SortOrder
|
||||
@@ -483,6 +504,7 @@ export type SaleInvoiceFiscalAttemptsMinOrderByAggregateInput = {
|
||||
attempt_no?: Prisma.SortOrder
|
||||
status?: Prisma.SortOrder
|
||||
tax_id?: Prisma.SortOrder
|
||||
type?: Prisma.SortOrder
|
||||
error_message?: Prisma.SortOrder
|
||||
sent_at?: Prisma.SortOrder
|
||||
received_at?: Prisma.SortOrder
|
||||
@@ -536,11 +558,20 @@ export type SaleInvoiceFiscalAttemptsUncheckedUpdateManyWithoutFiscalNestedInput
|
||||
deleteMany?: Prisma.SaleInvoiceFiscalAttemptsScalarWhereInput | Prisma.SaleInvoiceFiscalAttemptsScalarWhereInput[]
|
||||
}
|
||||
|
||||
export type EnumFiscalResponseStatusFieldUpdateOperationsInput = {
|
||||
set?: $Enums.FiscalResponseStatus
|
||||
}
|
||||
|
||||
export type EnumFiscalRequestTypeFieldUpdateOperationsInput = {
|
||||
set?: $Enums.FiscalRequestType
|
||||
}
|
||||
|
||||
export type SaleInvoiceFiscalAttemptsCreateWithoutFiscalInput = {
|
||||
id?: string
|
||||
attempt_no: number
|
||||
status: string
|
||||
status: $Enums.FiscalResponseStatus
|
||||
tax_id?: string | null
|
||||
type: $Enums.FiscalRequestType
|
||||
request_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
response_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
error_message?: string | null
|
||||
@@ -552,8 +583,9 @@ export type SaleInvoiceFiscalAttemptsCreateWithoutFiscalInput = {
|
||||
export type SaleInvoiceFiscalAttemptsUncheckedCreateWithoutFiscalInput = {
|
||||
id?: string
|
||||
attempt_no: number
|
||||
status: string
|
||||
status: $Enums.FiscalResponseStatus
|
||||
tax_id?: string | null
|
||||
type: $Enums.FiscalRequestType
|
||||
request_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
response_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
error_message?: string | null
|
||||
@@ -594,8 +626,9 @@ export type SaleInvoiceFiscalAttemptsScalarWhereInput = {
|
||||
NOT?: Prisma.SaleInvoiceFiscalAttemptsScalarWhereInput | Prisma.SaleInvoiceFiscalAttemptsScalarWhereInput[]
|
||||
id?: Prisma.StringFilter<"SaleInvoiceFiscalAttempts"> | string
|
||||
attempt_no?: Prisma.IntFilter<"SaleInvoiceFiscalAttempts"> | number
|
||||
status?: Prisma.StringFilter<"SaleInvoiceFiscalAttempts"> | string
|
||||
status?: Prisma.EnumFiscalResponseStatusFilter<"SaleInvoiceFiscalAttempts"> | $Enums.FiscalResponseStatus
|
||||
tax_id?: Prisma.StringNullableFilter<"SaleInvoiceFiscalAttempts"> | string | null
|
||||
type?: Prisma.EnumFiscalRequestTypeFilter<"SaleInvoiceFiscalAttempts"> | $Enums.FiscalRequestType
|
||||
request_payload?: Prisma.JsonNullableFilter<"SaleInvoiceFiscalAttempts">
|
||||
response_payload?: Prisma.JsonNullableFilter<"SaleInvoiceFiscalAttempts">
|
||||
error_message?: Prisma.StringNullableFilter<"SaleInvoiceFiscalAttempts"> | string | null
|
||||
@@ -608,8 +641,9 @@ export type SaleInvoiceFiscalAttemptsScalarWhereInput = {
|
||||
export type SaleInvoiceFiscalAttemptsCreateManyFiscalInput = {
|
||||
id?: string
|
||||
attempt_no: number
|
||||
status: string
|
||||
status: $Enums.FiscalResponseStatus
|
||||
tax_id?: string | null
|
||||
type: $Enums.FiscalRequestType
|
||||
request_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
response_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
error_message?: string | null
|
||||
@@ -621,8 +655,9 @@ export type SaleInvoiceFiscalAttemptsCreateManyFiscalInput = {
|
||||
export type SaleInvoiceFiscalAttemptsUpdateWithoutFiscalInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
attempt_no?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
status?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
status?: Prisma.EnumFiscalResponseStatusFieldUpdateOperationsInput | $Enums.FiscalResponseStatus
|
||||
tax_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
type?: Prisma.EnumFiscalRequestTypeFieldUpdateOperationsInput | $Enums.FiscalRequestType
|
||||
request_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
response_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
error_message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
@@ -634,8 +669,9 @@ export type SaleInvoiceFiscalAttemptsUpdateWithoutFiscalInput = {
|
||||
export type SaleInvoiceFiscalAttemptsUncheckedUpdateWithoutFiscalInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
attempt_no?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
status?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
status?: Prisma.EnumFiscalResponseStatusFieldUpdateOperationsInput | $Enums.FiscalResponseStatus
|
||||
tax_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
type?: Prisma.EnumFiscalRequestTypeFieldUpdateOperationsInput | $Enums.FiscalRequestType
|
||||
request_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
response_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
error_message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
@@ -647,8 +683,9 @@ export type SaleInvoiceFiscalAttemptsUncheckedUpdateWithoutFiscalInput = {
|
||||
export type SaleInvoiceFiscalAttemptsUncheckedUpdateManyWithoutFiscalInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
attempt_no?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
status?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
status?: Prisma.EnumFiscalResponseStatusFieldUpdateOperationsInput | $Enums.FiscalResponseStatus
|
||||
tax_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
type?: Prisma.EnumFiscalRequestTypeFieldUpdateOperationsInput | $Enums.FiscalRequestType
|
||||
request_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
response_payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
error_message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
@@ -664,6 +701,7 @@ export type SaleInvoiceFiscalAttemptsSelect<ExtArgs extends runtime.Types.Extens
|
||||
attempt_no?: boolean
|
||||
status?: boolean
|
||||
tax_id?: boolean
|
||||
type?: boolean
|
||||
request_payload?: boolean
|
||||
response_payload?: boolean
|
||||
error_message?: boolean
|
||||
@@ -681,6 +719,7 @@ export type SaleInvoiceFiscalAttemptsSelectScalar = {
|
||||
attempt_no?: boolean
|
||||
status?: boolean
|
||||
tax_id?: boolean
|
||||
type?: boolean
|
||||
request_payload?: boolean
|
||||
response_payload?: boolean
|
||||
error_message?: boolean
|
||||
@@ -690,7 +729,7 @@ export type SaleInvoiceFiscalAttemptsSelectScalar = {
|
||||
fiscal_id?: boolean
|
||||
}
|
||||
|
||||
export type SaleInvoiceFiscalAttemptsOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "attempt_no" | "status" | "tax_id" | "request_payload" | "response_payload" | "error_message" | "sent_at" | "received_at" | "created_at" | "fiscal_id", ExtArgs["result"]["saleInvoiceFiscalAttempts"]>
|
||||
export type SaleInvoiceFiscalAttemptsOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "attempt_no" | "status" | "tax_id" | "type" | "request_payload" | "response_payload" | "error_message" | "sent_at" | "received_at" | "created_at" | "fiscal_id", ExtArgs["result"]["saleInvoiceFiscalAttempts"]>
|
||||
export type SaleInvoiceFiscalAttemptsInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
fiscal?: boolean | Prisma.SaleInvoiceFiscalsDefaultArgs<ExtArgs>
|
||||
}
|
||||
@@ -703,8 +742,9 @@ export type $SaleInvoiceFiscalAttemptsPayload<ExtArgs extends runtime.Types.Exte
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
id: string
|
||||
attempt_no: number
|
||||
status: string
|
||||
status: $Enums.FiscalResponseStatus
|
||||
tax_id: string | null
|
||||
type: $Enums.FiscalRequestType
|
||||
request_payload: runtime.JsonValue | null
|
||||
response_payload: runtime.JsonValue | null
|
||||
error_message: string | null
|
||||
@@ -1084,8 +1124,9 @@ export interface Prisma__SaleInvoiceFiscalAttemptsClient<T, Null = never, ExtArg
|
||||
export interface SaleInvoiceFiscalAttemptsFieldRefs {
|
||||
readonly id: Prisma.FieldRef<"SaleInvoiceFiscalAttempts", 'String'>
|
||||
readonly attempt_no: Prisma.FieldRef<"SaleInvoiceFiscalAttempts", 'Int'>
|
||||
readonly status: Prisma.FieldRef<"SaleInvoiceFiscalAttempts", 'String'>
|
||||
readonly status: Prisma.FieldRef<"SaleInvoiceFiscalAttempts", 'FiscalResponseStatus'>
|
||||
readonly tax_id: Prisma.FieldRef<"SaleInvoiceFiscalAttempts", 'String'>
|
||||
readonly type: Prisma.FieldRef<"SaleInvoiceFiscalAttempts", 'FiscalRequestType'>
|
||||
readonly request_payload: Prisma.FieldRef<"SaleInvoiceFiscalAttempts", 'Json'>
|
||||
readonly response_payload: Prisma.FieldRef<"SaleInvoiceFiscalAttempts", 'Json'>
|
||||
readonly error_message: Prisma.FieldRef<"SaleInvoiceFiscalAttempts", 'String'>
|
||||
|
||||
@@ -684,14 +684,6 @@ export type SalesInvoiceUncheckedUpdateManyWithoutCustomerNestedInput = {
|
||||
deleteMany?: Prisma.SalesInvoiceScalarWhereInput | Prisma.SalesInvoiceScalarWhereInput[]
|
||||
}
|
||||
|
||||
export type DecimalFieldUpdateOperationsInput = {
|
||||
set?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
increment?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
decrement?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
multiply?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
divide?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
}
|
||||
|
||||
export type SalesInvoiceCreateNestedOneWithoutItemsInput = {
|
||||
create?: Prisma.XOR<Prisma.SalesInvoiceCreateWithoutItemsInput, Prisma.SalesInvoiceUncheckedCreateWithoutItemsInput>
|
||||
connectOrCreate?: Prisma.SalesInvoiceCreateOrConnectWithoutItemsInput
|
||||
|
||||
@@ -28,6 +28,7 @@ export type AggregateSalesInvoiceItem = {
|
||||
|
||||
export type SalesInvoiceItemAvgAggregateOutputType = {
|
||||
quantity: runtime.Decimal | null
|
||||
sku_vat: runtime.Decimal | null
|
||||
unit_price: runtime.Decimal | null
|
||||
total_amount: runtime.Decimal | null
|
||||
discount: runtime.Decimal | null
|
||||
@@ -35,6 +36,7 @@ export type SalesInvoiceItemAvgAggregateOutputType = {
|
||||
|
||||
export type SalesInvoiceItemSumAggregateOutputType = {
|
||||
quantity: runtime.Decimal | null
|
||||
sku_vat: runtime.Decimal | null
|
||||
unit_price: runtime.Decimal | null
|
||||
total_amount: runtime.Decimal | null
|
||||
discount: runtime.Decimal | null
|
||||
@@ -43,7 +45,10 @@ export type SalesInvoiceItemSumAggregateOutputType = {
|
||||
export type SalesInvoiceItemMinAggregateOutputType = {
|
||||
id: string | null
|
||||
quantity: runtime.Decimal | null
|
||||
unit_type: $Enums.UnitType | null
|
||||
measure_unit_text: string | null
|
||||
measure_unit_code: string | null
|
||||
sku_code: string | null
|
||||
sku_vat: runtime.Decimal | null
|
||||
unit_price: runtime.Decimal | null
|
||||
total_amount: runtime.Decimal | null
|
||||
created_at: Date | null
|
||||
@@ -57,7 +62,10 @@ export type SalesInvoiceItemMinAggregateOutputType = {
|
||||
export type SalesInvoiceItemMaxAggregateOutputType = {
|
||||
id: string | null
|
||||
quantity: runtime.Decimal | null
|
||||
unit_type: $Enums.UnitType | null
|
||||
measure_unit_text: string | null
|
||||
measure_unit_code: string | null
|
||||
sku_code: string | null
|
||||
sku_vat: runtime.Decimal | null
|
||||
unit_price: runtime.Decimal | null
|
||||
total_amount: runtime.Decimal | null
|
||||
created_at: Date | null
|
||||
@@ -71,7 +79,10 @@ export type SalesInvoiceItemMaxAggregateOutputType = {
|
||||
export type SalesInvoiceItemCountAggregateOutputType = {
|
||||
id: number
|
||||
quantity: number
|
||||
unit_type: number
|
||||
measure_unit_text: number
|
||||
measure_unit_code: number
|
||||
sku_code: number
|
||||
sku_vat: number
|
||||
unit_price: number
|
||||
total_amount: number
|
||||
created_at: number
|
||||
@@ -88,6 +99,7 @@ export type SalesInvoiceItemCountAggregateOutputType = {
|
||||
|
||||
export type SalesInvoiceItemAvgAggregateInputType = {
|
||||
quantity?: true
|
||||
sku_vat?: true
|
||||
unit_price?: true
|
||||
total_amount?: true
|
||||
discount?: true
|
||||
@@ -95,6 +107,7 @@ export type SalesInvoiceItemAvgAggregateInputType = {
|
||||
|
||||
export type SalesInvoiceItemSumAggregateInputType = {
|
||||
quantity?: true
|
||||
sku_vat?: true
|
||||
unit_price?: true
|
||||
total_amount?: true
|
||||
discount?: true
|
||||
@@ -103,7 +116,10 @@ export type SalesInvoiceItemSumAggregateInputType = {
|
||||
export type SalesInvoiceItemMinAggregateInputType = {
|
||||
id?: true
|
||||
quantity?: true
|
||||
unit_type?: true
|
||||
measure_unit_text?: true
|
||||
measure_unit_code?: true
|
||||
sku_code?: true
|
||||
sku_vat?: true
|
||||
unit_price?: true
|
||||
total_amount?: true
|
||||
created_at?: true
|
||||
@@ -117,7 +133,10 @@ export type SalesInvoiceItemMinAggregateInputType = {
|
||||
export type SalesInvoiceItemMaxAggregateInputType = {
|
||||
id?: true
|
||||
quantity?: true
|
||||
unit_type?: true
|
||||
measure_unit_text?: true
|
||||
measure_unit_code?: true
|
||||
sku_code?: true
|
||||
sku_vat?: true
|
||||
unit_price?: true
|
||||
total_amount?: true
|
||||
created_at?: true
|
||||
@@ -131,7 +150,10 @@ export type SalesInvoiceItemMaxAggregateInputType = {
|
||||
export type SalesInvoiceItemCountAggregateInputType = {
|
||||
id?: true
|
||||
quantity?: true
|
||||
unit_type?: true
|
||||
measure_unit_text?: true
|
||||
measure_unit_code?: true
|
||||
sku_code?: true
|
||||
sku_vat?: true
|
||||
unit_price?: true
|
||||
total_amount?: true
|
||||
created_at?: true
|
||||
@@ -234,7 +256,10 @@ export type SalesInvoiceItemGroupByArgs<ExtArgs extends runtime.Types.Extensions
|
||||
export type SalesInvoiceItemGroupByOutputType = {
|
||||
id: string
|
||||
quantity: runtime.Decimal
|
||||
unit_type: $Enums.UnitType
|
||||
measure_unit_text: string
|
||||
measure_unit_code: string
|
||||
sku_code: string
|
||||
sku_vat: runtime.Decimal
|
||||
unit_price: runtime.Decimal
|
||||
total_amount: runtime.Decimal
|
||||
created_at: Date
|
||||
@@ -273,7 +298,10 @@ export type SalesInvoiceItemWhereInput = {
|
||||
NOT?: Prisma.SalesInvoiceItemWhereInput | Prisma.SalesInvoiceItemWhereInput[]
|
||||
id?: Prisma.StringFilter<"SalesInvoiceItem"> | string
|
||||
quantity?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_type?: Prisma.EnumUnitTypeFilter<"SalesInvoiceItem"> | $Enums.UnitType
|
||||
measure_unit_text?: Prisma.StringFilter<"SalesInvoiceItem"> | string
|
||||
measure_unit_code?: Prisma.StringFilter<"SalesInvoiceItem"> | string
|
||||
sku_code?: Prisma.StringFilter<"SalesInvoiceItem"> | string
|
||||
sku_vat?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_price?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
total_amount?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFilter<"SalesInvoiceItem"> | Date | string
|
||||
@@ -292,7 +320,10 @@ export type SalesInvoiceItemWhereInput = {
|
||||
export type SalesInvoiceItemOrderByWithRelationInput = {
|
||||
id?: Prisma.SortOrder
|
||||
quantity?: Prisma.SortOrder
|
||||
unit_type?: Prisma.SortOrder
|
||||
measure_unit_text?: Prisma.SortOrder
|
||||
measure_unit_code?: Prisma.SortOrder
|
||||
sku_code?: Prisma.SortOrder
|
||||
sku_vat?: Prisma.SortOrder
|
||||
unit_price?: Prisma.SortOrder
|
||||
total_amount?: Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
@@ -315,7 +346,10 @@ export type SalesInvoiceItemWhereUniqueInput = Prisma.AtLeast<{
|
||||
OR?: Prisma.SalesInvoiceItemWhereInput[]
|
||||
NOT?: Prisma.SalesInvoiceItemWhereInput | Prisma.SalesInvoiceItemWhereInput[]
|
||||
quantity?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_type?: Prisma.EnumUnitTypeFilter<"SalesInvoiceItem"> | $Enums.UnitType
|
||||
measure_unit_text?: Prisma.StringFilter<"SalesInvoiceItem"> | string
|
||||
measure_unit_code?: Prisma.StringFilter<"SalesInvoiceItem"> | string
|
||||
sku_code?: Prisma.StringFilter<"SalesInvoiceItem"> | string
|
||||
sku_vat?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_price?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
total_amount?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFilter<"SalesInvoiceItem"> | Date | string
|
||||
@@ -334,7 +368,10 @@ export type SalesInvoiceItemWhereUniqueInput = Prisma.AtLeast<{
|
||||
export type SalesInvoiceItemOrderByWithAggregationInput = {
|
||||
id?: Prisma.SortOrder
|
||||
quantity?: Prisma.SortOrder
|
||||
unit_type?: Prisma.SortOrder
|
||||
measure_unit_text?: Prisma.SortOrder
|
||||
measure_unit_code?: Prisma.SortOrder
|
||||
sku_code?: Prisma.SortOrder
|
||||
sku_vat?: Prisma.SortOrder
|
||||
unit_price?: Prisma.SortOrder
|
||||
total_amount?: Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
@@ -358,7 +395,10 @@ export type SalesInvoiceItemScalarWhereWithAggregatesInput = {
|
||||
NOT?: Prisma.SalesInvoiceItemScalarWhereWithAggregatesInput | Prisma.SalesInvoiceItemScalarWhereWithAggregatesInput[]
|
||||
id?: Prisma.StringWithAggregatesFilter<"SalesInvoiceItem"> | string
|
||||
quantity?: Prisma.DecimalWithAggregatesFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_type?: Prisma.EnumUnitTypeWithAggregatesFilter<"SalesInvoiceItem"> | $Enums.UnitType
|
||||
measure_unit_text?: Prisma.StringWithAggregatesFilter<"SalesInvoiceItem"> | string
|
||||
measure_unit_code?: Prisma.StringWithAggregatesFilter<"SalesInvoiceItem"> | string
|
||||
sku_code?: Prisma.StringWithAggregatesFilter<"SalesInvoiceItem"> | string
|
||||
sku_vat?: Prisma.DecimalWithAggregatesFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_price?: Prisma.DecimalWithAggregatesFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
total_amount?: Prisma.DecimalWithAggregatesFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeWithAggregatesFilter<"SalesInvoiceItem"> | Date | string
|
||||
@@ -374,7 +414,10 @@ export type SalesInvoiceItemScalarWhereWithAggregatesInput = {
|
||||
export type SalesInvoiceItemCreateInput = {
|
||||
id?: string
|
||||
quantity: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_type: $Enums.UnitType
|
||||
measure_unit_text: string
|
||||
measure_unit_code: string
|
||||
sku_code: string
|
||||
sku_vat?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_price?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
total_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Date | string
|
||||
@@ -390,7 +433,10 @@ export type SalesInvoiceItemCreateInput = {
|
||||
export type SalesInvoiceItemUncheckedCreateInput = {
|
||||
id?: string
|
||||
quantity: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_type: $Enums.UnitType
|
||||
measure_unit_text: string
|
||||
measure_unit_code: string
|
||||
sku_code: string
|
||||
sku_vat?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_price?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
total_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Date | string
|
||||
@@ -406,7 +452,10 @@ export type SalesInvoiceItemUncheckedCreateInput = {
|
||||
export type SalesInvoiceItemUpdateInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_type?: Prisma.EnumUnitTypeFieldUpdateOperationsInput | $Enums.UnitType
|
||||
measure_unit_text?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
measure_unit_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
sku_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
sku_vat?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -422,7 +471,10 @@ export type SalesInvoiceItemUpdateInput = {
|
||||
export type SalesInvoiceItemUncheckedUpdateInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_type?: Prisma.EnumUnitTypeFieldUpdateOperationsInput | $Enums.UnitType
|
||||
measure_unit_text?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
measure_unit_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
sku_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
sku_vat?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -438,7 +490,10 @@ export type SalesInvoiceItemUncheckedUpdateInput = {
|
||||
export type SalesInvoiceItemCreateManyInput = {
|
||||
id?: string
|
||||
quantity: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_type: $Enums.UnitType
|
||||
measure_unit_text: string
|
||||
measure_unit_code: string
|
||||
sku_code: string
|
||||
sku_vat?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_price?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
total_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Date | string
|
||||
@@ -454,7 +509,10 @@ export type SalesInvoiceItemCreateManyInput = {
|
||||
export type SalesInvoiceItemUpdateManyMutationInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_type?: Prisma.EnumUnitTypeFieldUpdateOperationsInput | $Enums.UnitType
|
||||
measure_unit_text?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
measure_unit_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
sku_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
sku_vat?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -467,7 +525,10 @@ export type SalesInvoiceItemUpdateManyMutationInput = {
|
||||
export type SalesInvoiceItemUncheckedUpdateManyInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_type?: Prisma.EnumUnitTypeFieldUpdateOperationsInput | $Enums.UnitType
|
||||
measure_unit_text?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
measure_unit_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
sku_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
sku_vat?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -499,7 +560,10 @@ export type SalesInvoiceItemOrderByRelevanceInput = {
|
||||
export type SalesInvoiceItemCountOrderByAggregateInput = {
|
||||
id?: Prisma.SortOrder
|
||||
quantity?: Prisma.SortOrder
|
||||
unit_type?: Prisma.SortOrder
|
||||
measure_unit_text?: Prisma.SortOrder
|
||||
measure_unit_code?: Prisma.SortOrder
|
||||
sku_code?: Prisma.SortOrder
|
||||
sku_vat?: Prisma.SortOrder
|
||||
unit_price?: Prisma.SortOrder
|
||||
total_amount?: Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
@@ -514,6 +578,7 @@ export type SalesInvoiceItemCountOrderByAggregateInput = {
|
||||
|
||||
export type SalesInvoiceItemAvgOrderByAggregateInput = {
|
||||
quantity?: Prisma.SortOrder
|
||||
sku_vat?: Prisma.SortOrder
|
||||
unit_price?: Prisma.SortOrder
|
||||
total_amount?: Prisma.SortOrder
|
||||
discount?: Prisma.SortOrder
|
||||
@@ -522,7 +587,10 @@ export type SalesInvoiceItemAvgOrderByAggregateInput = {
|
||||
export type SalesInvoiceItemMaxOrderByAggregateInput = {
|
||||
id?: Prisma.SortOrder
|
||||
quantity?: Prisma.SortOrder
|
||||
unit_type?: Prisma.SortOrder
|
||||
measure_unit_text?: Prisma.SortOrder
|
||||
measure_unit_code?: Prisma.SortOrder
|
||||
sku_code?: Prisma.SortOrder
|
||||
sku_vat?: Prisma.SortOrder
|
||||
unit_price?: Prisma.SortOrder
|
||||
total_amount?: Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
@@ -536,7 +604,10 @@ export type SalesInvoiceItemMaxOrderByAggregateInput = {
|
||||
export type SalesInvoiceItemMinOrderByAggregateInput = {
|
||||
id?: Prisma.SortOrder
|
||||
quantity?: Prisma.SortOrder
|
||||
unit_type?: Prisma.SortOrder
|
||||
measure_unit_text?: Prisma.SortOrder
|
||||
measure_unit_code?: Prisma.SortOrder
|
||||
sku_code?: Prisma.SortOrder
|
||||
sku_vat?: Prisma.SortOrder
|
||||
unit_price?: Prisma.SortOrder
|
||||
total_amount?: Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
@@ -549,6 +620,7 @@ export type SalesInvoiceItemMinOrderByAggregateInput = {
|
||||
|
||||
export type SalesInvoiceItemSumOrderByAggregateInput = {
|
||||
quantity?: Prisma.SortOrder
|
||||
sku_vat?: Prisma.SortOrder
|
||||
unit_price?: Prisma.SortOrder
|
||||
total_amount?: Prisma.SortOrder
|
||||
discount?: Prisma.SortOrder
|
||||
@@ -683,7 +755,10 @@ export type SalesInvoiceItemUncheckedUpdateManyWithoutServiceNestedInput = {
|
||||
export type SalesInvoiceItemCreateWithoutGoodInput = {
|
||||
id?: string
|
||||
quantity: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_type: $Enums.UnitType
|
||||
measure_unit_text: string
|
||||
measure_unit_code: string
|
||||
sku_code: string
|
||||
sku_vat?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_price?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
total_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Date | string
|
||||
@@ -698,7 +773,10 @@ export type SalesInvoiceItemCreateWithoutGoodInput = {
|
||||
export type SalesInvoiceItemUncheckedCreateWithoutGoodInput = {
|
||||
id?: string
|
||||
quantity: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_type: $Enums.UnitType
|
||||
measure_unit_text: string
|
||||
measure_unit_code: string
|
||||
sku_code: string
|
||||
sku_vat?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_price?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
total_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Date | string
|
||||
@@ -742,7 +820,10 @@ export type SalesInvoiceItemScalarWhereInput = {
|
||||
NOT?: Prisma.SalesInvoiceItemScalarWhereInput | Prisma.SalesInvoiceItemScalarWhereInput[]
|
||||
id?: Prisma.StringFilter<"SalesInvoiceItem"> | string
|
||||
quantity?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_type?: Prisma.EnumUnitTypeFilter<"SalesInvoiceItem"> | $Enums.UnitType
|
||||
measure_unit_text?: Prisma.StringFilter<"SalesInvoiceItem"> | string
|
||||
measure_unit_code?: Prisma.StringFilter<"SalesInvoiceItem"> | string
|
||||
sku_code?: Prisma.StringFilter<"SalesInvoiceItem"> | string
|
||||
sku_vat?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_price?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
total_amount?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFilter<"SalesInvoiceItem"> | Date | string
|
||||
@@ -758,7 +839,10 @@ export type SalesInvoiceItemScalarWhereInput = {
|
||||
export type SalesInvoiceItemCreateWithoutInvoiceInput = {
|
||||
id?: string
|
||||
quantity: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_type: $Enums.UnitType
|
||||
measure_unit_text: string
|
||||
measure_unit_code: string
|
||||
sku_code: string
|
||||
sku_vat?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_price?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
total_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Date | string
|
||||
@@ -773,7 +857,10 @@ export type SalesInvoiceItemCreateWithoutInvoiceInput = {
|
||||
export type SalesInvoiceItemUncheckedCreateWithoutInvoiceInput = {
|
||||
id?: string
|
||||
quantity: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_type: $Enums.UnitType
|
||||
measure_unit_text: string
|
||||
measure_unit_code: string
|
||||
sku_code: string
|
||||
sku_vat?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_price?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
total_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Date | string
|
||||
@@ -814,7 +901,10 @@ export type SalesInvoiceItemUpdateManyWithWhereWithoutInvoiceInput = {
|
||||
export type SalesInvoiceItemCreateWithoutServiceInput = {
|
||||
id?: string
|
||||
quantity: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_type: $Enums.UnitType
|
||||
measure_unit_text: string
|
||||
measure_unit_code: string
|
||||
sku_code: string
|
||||
sku_vat?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_price?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
total_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Date | string
|
||||
@@ -829,7 +919,10 @@ export type SalesInvoiceItemCreateWithoutServiceInput = {
|
||||
export type SalesInvoiceItemUncheckedCreateWithoutServiceInput = {
|
||||
id?: string
|
||||
quantity: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_type: $Enums.UnitType
|
||||
measure_unit_text: string
|
||||
measure_unit_code: string
|
||||
sku_code: string
|
||||
sku_vat?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_price?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
total_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Date | string
|
||||
@@ -870,7 +963,10 @@ export type SalesInvoiceItemUpdateManyWithWhereWithoutServiceInput = {
|
||||
export type SalesInvoiceItemCreateManyGoodInput = {
|
||||
id?: string
|
||||
quantity: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_type: $Enums.UnitType
|
||||
measure_unit_text: string
|
||||
measure_unit_code: string
|
||||
sku_code: string
|
||||
sku_vat?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_price?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
total_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Date | string
|
||||
@@ -885,7 +981,10 @@ export type SalesInvoiceItemCreateManyGoodInput = {
|
||||
export type SalesInvoiceItemUpdateWithoutGoodInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_type?: Prisma.EnumUnitTypeFieldUpdateOperationsInput | $Enums.UnitType
|
||||
measure_unit_text?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
measure_unit_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
sku_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
sku_vat?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -900,7 +999,10 @@ export type SalesInvoiceItemUpdateWithoutGoodInput = {
|
||||
export type SalesInvoiceItemUncheckedUpdateWithoutGoodInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_type?: Prisma.EnumUnitTypeFieldUpdateOperationsInput | $Enums.UnitType
|
||||
measure_unit_text?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
measure_unit_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
sku_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
sku_vat?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -915,7 +1017,10 @@ export type SalesInvoiceItemUncheckedUpdateWithoutGoodInput = {
|
||||
export type SalesInvoiceItemUncheckedUpdateManyWithoutGoodInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_type?: Prisma.EnumUnitTypeFieldUpdateOperationsInput | $Enums.UnitType
|
||||
measure_unit_text?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
measure_unit_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
sku_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
sku_vat?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -930,7 +1035,10 @@ export type SalesInvoiceItemUncheckedUpdateManyWithoutGoodInput = {
|
||||
export type SalesInvoiceItemCreateManyInvoiceInput = {
|
||||
id?: string
|
||||
quantity: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_type: $Enums.UnitType
|
||||
measure_unit_text: string
|
||||
measure_unit_code: string
|
||||
sku_code: string
|
||||
sku_vat?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_price?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
total_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Date | string
|
||||
@@ -945,7 +1053,10 @@ export type SalesInvoiceItemCreateManyInvoiceInput = {
|
||||
export type SalesInvoiceItemUpdateWithoutInvoiceInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_type?: Prisma.EnumUnitTypeFieldUpdateOperationsInput | $Enums.UnitType
|
||||
measure_unit_text?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
measure_unit_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
sku_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
sku_vat?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -960,7 +1071,10 @@ export type SalesInvoiceItemUpdateWithoutInvoiceInput = {
|
||||
export type SalesInvoiceItemUncheckedUpdateWithoutInvoiceInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_type?: Prisma.EnumUnitTypeFieldUpdateOperationsInput | $Enums.UnitType
|
||||
measure_unit_text?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
measure_unit_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
sku_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
sku_vat?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -975,7 +1089,10 @@ export type SalesInvoiceItemUncheckedUpdateWithoutInvoiceInput = {
|
||||
export type SalesInvoiceItemUncheckedUpdateManyWithoutInvoiceInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_type?: Prisma.EnumUnitTypeFieldUpdateOperationsInput | $Enums.UnitType
|
||||
measure_unit_text?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
measure_unit_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
sku_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
sku_vat?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -990,7 +1107,10 @@ export type SalesInvoiceItemUncheckedUpdateManyWithoutInvoiceInput = {
|
||||
export type SalesInvoiceItemCreateManyServiceInput = {
|
||||
id?: string
|
||||
quantity: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_type: $Enums.UnitType
|
||||
measure_unit_text: string
|
||||
measure_unit_code: string
|
||||
sku_code: string
|
||||
sku_vat?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_price?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
total_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Date | string
|
||||
@@ -1005,7 +1125,10 @@ export type SalesInvoiceItemCreateManyServiceInput = {
|
||||
export type SalesInvoiceItemUpdateWithoutServiceInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_type?: Prisma.EnumUnitTypeFieldUpdateOperationsInput | $Enums.UnitType
|
||||
measure_unit_text?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
measure_unit_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
sku_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
sku_vat?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -1020,7 +1143,10 @@ export type SalesInvoiceItemUpdateWithoutServiceInput = {
|
||||
export type SalesInvoiceItemUncheckedUpdateWithoutServiceInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_type?: Prisma.EnumUnitTypeFieldUpdateOperationsInput | $Enums.UnitType
|
||||
measure_unit_text?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
measure_unit_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
sku_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
sku_vat?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -1035,7 +1161,10 @@ export type SalesInvoiceItemUncheckedUpdateWithoutServiceInput = {
|
||||
export type SalesInvoiceItemUncheckedUpdateManyWithoutServiceInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_type?: Prisma.EnumUnitTypeFieldUpdateOperationsInput | $Enums.UnitType
|
||||
measure_unit_text?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
measure_unit_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
sku_code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
sku_vat?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
unit_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -1052,7 +1181,10 @@ export type SalesInvoiceItemUncheckedUpdateManyWithoutServiceInput = {
|
||||
export type SalesInvoiceItemSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
||||
id?: boolean
|
||||
quantity?: boolean
|
||||
unit_type?: boolean
|
||||
measure_unit_text?: boolean
|
||||
measure_unit_code?: boolean
|
||||
sku_code?: boolean
|
||||
sku_vat?: boolean
|
||||
unit_price?: boolean
|
||||
total_amount?: boolean
|
||||
created_at?: boolean
|
||||
@@ -1073,7 +1205,10 @@ export type SalesInvoiceItemSelect<ExtArgs extends runtime.Types.Extensions.Inte
|
||||
export type SalesInvoiceItemSelectScalar = {
|
||||
id?: boolean
|
||||
quantity?: boolean
|
||||
unit_type?: boolean
|
||||
measure_unit_text?: boolean
|
||||
measure_unit_code?: boolean
|
||||
sku_code?: boolean
|
||||
sku_vat?: boolean
|
||||
unit_price?: boolean
|
||||
total_amount?: boolean
|
||||
created_at?: boolean
|
||||
@@ -1086,7 +1221,7 @@ export type SalesInvoiceItemSelectScalar = {
|
||||
service_id?: boolean
|
||||
}
|
||||
|
||||
export type SalesInvoiceItemOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "quantity" | "unit_type" | "unit_price" | "total_amount" | "created_at" | "discount" | "notes" | "payload" | "good_snapshot" | "invoice_id" | "good_id" | "service_id", ExtArgs["result"]["salesInvoiceItem"]>
|
||||
export type SalesInvoiceItemOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "quantity" | "measure_unit_text" | "measure_unit_code" | "sku_code" | "sku_vat" | "unit_price" | "total_amount" | "created_at" | "discount" | "notes" | "payload" | "good_snapshot" | "invoice_id" | "good_id" | "service_id", ExtArgs["result"]["salesInvoiceItem"]>
|
||||
export type SalesInvoiceItemInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
invoice?: boolean | Prisma.SalesInvoiceDefaultArgs<ExtArgs>
|
||||
good?: boolean | Prisma.SalesInvoiceItem$goodArgs<ExtArgs>
|
||||
@@ -1103,7 +1238,10 @@ export type $SalesInvoiceItemPayload<ExtArgs extends runtime.Types.Extensions.In
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
id: string
|
||||
quantity: runtime.Decimal
|
||||
unit_type: $Enums.UnitType
|
||||
measure_unit_text: string
|
||||
measure_unit_code: string
|
||||
sku_code: string
|
||||
sku_vat: runtime.Decimal
|
||||
unit_price: runtime.Decimal
|
||||
total_amount: runtime.Decimal
|
||||
created_at: Date
|
||||
@@ -1488,7 +1626,10 @@ export interface Prisma__SalesInvoiceItemClient<T, Null = never, ExtArgs extends
|
||||
export interface SalesInvoiceItemFieldRefs {
|
||||
readonly id: Prisma.FieldRef<"SalesInvoiceItem", 'String'>
|
||||
readonly quantity: Prisma.FieldRef<"SalesInvoiceItem", 'Decimal'>
|
||||
readonly unit_type: Prisma.FieldRef<"SalesInvoiceItem", 'UnitType'>
|
||||
readonly measure_unit_text: Prisma.FieldRef<"SalesInvoiceItem", 'String'>
|
||||
readonly measure_unit_code: Prisma.FieldRef<"SalesInvoiceItem", 'String'>
|
||||
readonly sku_code: Prisma.FieldRef<"SalesInvoiceItem", 'String'>
|
||||
readonly sku_vat: Prisma.FieldRef<"SalesInvoiceItem", 'Decimal'>
|
||||
readonly unit_price: Prisma.FieldRef<"SalesInvoiceItem", 'Decimal'>
|
||||
readonly total_amount: Prisma.FieldRef<"SalesInvoiceItem", 'Decimal'>
|
||||
readonly created_at: Prisma.FieldRef<"SalesInvoiceItem", 'DateTime'>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -9,6 +9,7 @@ import { AdminGuildsModule } from './guilds/guilds.module'
|
||||
import { AdminLicensesModule } from './licenses/licenses.module'
|
||||
import { AdminPartnersModule } from './partners/partners.module'
|
||||
import { AdminProvidersModule } from './providers/providers.module'
|
||||
import { AdminStockKeepingUnitsModule } from './stock-keeping-units/stock-keeping-units.module'
|
||||
import { AdminTranslateModule } from './translate/translate.module'
|
||||
import { AdminUserAccountsModule } from './users/accounts/accounts.module'
|
||||
import { AdminUsersModule } from './users/users.module'
|
||||
@@ -25,6 +26,7 @@ import { AdminUsersModule } from './users/users.module'
|
||||
AdminGuildsModule,
|
||||
AdminDeviceBrandsModule,
|
||||
AdminDevicesModule,
|
||||
AdminStockKeepingUnitsModule,
|
||||
AdminLicensesModule,
|
||||
AdminConsumersModule,
|
||||
],
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
import { GoodPricingModel, UnitType } from '@/generated/prisma/enums'
|
||||
import { GoodPricingModel } from '@/generated/prisma/enums'
|
||||
import { ApiProperty, PartialType } from '@nestjs/swagger'
|
||||
import { IsEnum, IsOptional, IsString } from 'class-validator'
|
||||
|
||||
export class CreateGuildGoodDto {
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
@ApiProperty()
|
||||
name: string
|
||||
|
||||
@IsString()
|
||||
@ApiProperty()
|
||||
sku: string
|
||||
|
||||
@IsString()
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
sku_id: string
|
||||
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
category_id: string
|
||||
|
||||
@IsEnum(UnitType)
|
||||
@ApiProperty({ required: true, enum: UnitType })
|
||||
unit_type: UnitType
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
measure_unit_id: string
|
||||
|
||||
@IsEnum(GoodPricingModel)
|
||||
@ApiProperty({ required: true, enum: GoodPricingModel })
|
||||
|
||||
@@ -17,10 +17,20 @@ export class GoodsService {
|
||||
id: true,
|
||||
name: true,
|
||||
pricing_model: true,
|
||||
unit_type: true,
|
||||
image_url: true,
|
||||
sku: true,
|
||||
description: true,
|
||||
sku: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
},
|
||||
},
|
||||
measure_unit: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
},
|
||||
},
|
||||
category: {
|
||||
select: {
|
||||
id: true,
|
||||
@@ -62,7 +72,7 @@ export class GoodsService {
|
||||
}
|
||||
|
||||
async create(data: CreateGuildGoodDto, file: Express.Multer.File) {
|
||||
const { category_id, ...rest } = data
|
||||
const { category_id, measure_unit_id, sku_id, ...rest } = data
|
||||
|
||||
const good = await this.prisma.$transaction(async tx => {
|
||||
let image_url = ''
|
||||
@@ -79,6 +89,16 @@ export class GoodsService {
|
||||
...rest,
|
||||
is_default_guild_good: true,
|
||||
image_url,
|
||||
sku: {
|
||||
connect: {
|
||||
id: sku_id,
|
||||
},
|
||||
},
|
||||
measure_unit: {
|
||||
connect: {
|
||||
id: measure_unit_id,
|
||||
},
|
||||
},
|
||||
category: {
|
||||
connect: {
|
||||
id: category_id,
|
||||
@@ -93,7 +113,7 @@ export class GoodsService {
|
||||
}
|
||||
|
||||
async update(id: string, data: UpdateGuildGoodDto, file: Express.Multer.File) {
|
||||
const { category_id, ...rest } = data
|
||||
const { category_id, measure_unit_id, sku_id, ...rest } = data
|
||||
|
||||
const good = await this.prisma.$transaction(async tx => {
|
||||
let image_url = ''
|
||||
@@ -120,6 +140,16 @@ export class GoodsService {
|
||||
...rest,
|
||||
is_default_guild_good: true,
|
||||
image_url,
|
||||
sku: {
|
||||
connect: {
|
||||
id: sku_id,
|
||||
},
|
||||
},
|
||||
measure_unit: {
|
||||
connect: {
|
||||
id: measure_unit_id,
|
||||
},
|
||||
},
|
||||
category: {
|
||||
connect: {
|
||||
id: category_id,
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
import { SKUGuildType } from '@/generated/prisma/enums'
|
||||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'
|
||||
import { Type } from 'class-transformer'
|
||||
import { IsBoolean, IsEnum, IsNumber, IsString, Min } from 'class-validator'
|
||||
|
||||
export class CreateStockKeepingUnitDto {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
code: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
name: string
|
||||
|
||||
@ApiProperty()
|
||||
@Type(() => Number)
|
||||
@IsNumber()
|
||||
@Min(0)
|
||||
VAT: number
|
||||
|
||||
@ApiPropertyOptional({ enum: SKUGuildType, default: SKUGuildType.GOLD })
|
||||
@IsEnum(SKUGuildType)
|
||||
type: SKUGuildType = SKUGuildType.GOLD
|
||||
|
||||
@ApiPropertyOptional({ default: true })
|
||||
@IsBoolean()
|
||||
is_public: boolean = true
|
||||
|
||||
@ApiPropertyOptional({ default: true })
|
||||
@IsBoolean()
|
||||
is_domestic: boolean = true
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import type { StockKeepingUnitsService } from '../stock-keeping-units.service'
|
||||
|
||||
export type StockKeepingUnitsServiceCreateResponseDto = Awaited<
|
||||
ReturnType<StockKeepingUnitsService['create']>
|
||||
>
|
||||
export type StockKeepingUnitsServiceFindAllResponseDto = Awaited<
|
||||
ReturnType<StockKeepingUnitsService['findAll']>
|
||||
>
|
||||
export type StockKeepingUnitsServiceUpdateResponseDto = Awaited<
|
||||
ReturnType<StockKeepingUnitsService['update']>
|
||||
>
|
||||
@@ -0,0 +1,4 @@
|
||||
import { PartialType } from '@nestjs/swagger'
|
||||
import { CreateStockKeepingUnitDto } from './create-stock-keeping-unit.dto'
|
||||
|
||||
export class UpdateStockKeepingUnitDto extends PartialType(CreateStockKeepingUnitDto) {}
|
||||
@@ -0,0 +1,36 @@
|
||||
import { Body, Controller, Get, Param, Patch, Post } from '@nestjs/common'
|
||||
import { ApiTags } from '@nestjs/swagger'
|
||||
import type {
|
||||
StockKeepingUnitsServiceCreateResponseDto,
|
||||
StockKeepingUnitsServiceFindAllResponseDto,
|
||||
StockKeepingUnitsServiceUpdateResponseDto,
|
||||
} from './dto/stock-keeping-units-response.dto'
|
||||
import { CreateStockKeepingUnitDto } from './dto/create-stock-keeping-unit.dto'
|
||||
import { UpdateStockKeepingUnitDto } from './dto/update-stock-keeping-unit.dto'
|
||||
import { StockKeepingUnitsService } from './stock-keeping-units.service'
|
||||
|
||||
@ApiTags('AdminStockKeepingUnits')
|
||||
@Controller('admin/stock-keeping-units')
|
||||
export class StockKeepingUnitsController {
|
||||
constructor(private readonly service: StockKeepingUnitsService) {}
|
||||
|
||||
@Get()
|
||||
async findAll(): Promise<StockKeepingUnitsServiceFindAllResponseDto> {
|
||||
return this.service.findAll()
|
||||
}
|
||||
|
||||
@Post()
|
||||
async create(
|
||||
@Body() data: CreateStockKeepingUnitDto,
|
||||
): Promise<StockKeepingUnitsServiceCreateResponseDto> {
|
||||
return this.service.create(data)
|
||||
}
|
||||
|
||||
@Patch(':id')
|
||||
async update(
|
||||
@Param('id') id: string,
|
||||
@Body() data: UpdateStockKeepingUnitDto,
|
||||
): Promise<StockKeepingUnitsServiceUpdateResponseDto> {
|
||||
return this.service.update(id, data)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import { PrismaModule } from '@/prisma/prisma.module'
|
||||
import { Module } from '@nestjs/common'
|
||||
import { StockKeepingUnitsController } from './stock-keeping-units.controller'
|
||||
import { StockKeepingUnitsService } from './stock-keeping-units.service'
|
||||
|
||||
@Module({
|
||||
imports: [PrismaModule],
|
||||
controllers: [StockKeepingUnitsController],
|
||||
providers: [StockKeepingUnitsService],
|
||||
})
|
||||
export class AdminStockKeepingUnitsModule {}
|
||||
@@ -0,0 +1,30 @@
|
||||
import { PrismaService } from '@/prisma/prisma.service'
|
||||
import { Injectable } from '@nestjs/common'
|
||||
import { ResponseMapper } from 'common/response/response-mapper'
|
||||
import { CreateStockKeepingUnitDto } from './dto/create-stock-keeping-unit.dto'
|
||||
import { UpdateStockKeepingUnitDto } from './dto/update-stock-keeping-unit.dto'
|
||||
|
||||
@Injectable()
|
||||
export class StockKeepingUnitsService {
|
||||
constructor(private readonly prisma: PrismaService) {}
|
||||
|
||||
async findAll() {
|
||||
const items = await this.prisma.stockKeepingUnits.findMany({
|
||||
orderBy: { created_at: 'desc' },
|
||||
})
|
||||
return ResponseMapper.list(items)
|
||||
}
|
||||
|
||||
async create(data: CreateStockKeepingUnitDto) {
|
||||
const item = await this.prisma.stockKeepingUnits.create({ data })
|
||||
return ResponseMapper.create(item)
|
||||
}
|
||||
|
||||
async update(id: string, data: UpdateStockKeepingUnitDto) {
|
||||
const item = await this.prisma.stockKeepingUnits.update({
|
||||
where: { id },
|
||||
data,
|
||||
})
|
||||
return ResponseMapper.update(item)
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,15 @@ import { PublicWithToken } from '@/common/decorators/withToken.decorator'
|
||||
import { Controller, Get, Param } from '@nestjs/common'
|
||||
import { ApiTags } from '@nestjs/swagger'
|
||||
import { CatalogsService } from './catalog.service'
|
||||
import type { CatalogsServiceGetDeviceBrandsResponseDto, CatalogsServiceGetDevicesResponseDto, CatalogsServiceGetGuildGoodCategoriesResponseDto, CatalogsServiceGetGuildsResponseDto, CatalogsServiceGetProvidersResponseDto } from './dto/catalog-response.dto'
|
||||
import type {
|
||||
CatalogsServiceGetDeviceBrandsResponseDto,
|
||||
CatalogsServiceGetDevicesResponseDto,
|
||||
CatalogsServiceGetGuildGoodCategoriesResponseDto,
|
||||
CatalogsServiceGetGuildsResponseDto,
|
||||
CatalogsServiceGetMeasurementsResponseDto,
|
||||
CatalogsServiceGetProvidersResponseDto,
|
||||
CatalogsServiceGetSKUResponseDto,
|
||||
} from './dto/catalog-response.dto'
|
||||
|
||||
@ApiTags('Catalog')
|
||||
@Controller('catalog')
|
||||
@@ -33,9 +41,27 @@ export class CatalogsController {
|
||||
return this.catalogService.getDeviceBrands()
|
||||
}
|
||||
|
||||
@Get('sku')
|
||||
@PublicWithToken()
|
||||
async getSKU(
|
||||
@Param('search') search: string,
|
||||
): Promise<CatalogsServiceGetSKUResponseDto> {
|
||||
return this.catalogService.getSKU(search)
|
||||
}
|
||||
|
||||
@Get('measure_units')
|
||||
@PublicWithToken()
|
||||
async getMeasurements(
|
||||
@Param('search') search: string,
|
||||
): Promise<CatalogsServiceGetMeasurementsResponseDto> {
|
||||
return this.catalogService.getMeasurements()
|
||||
}
|
||||
|
||||
@Get('guilds/:guildId/good_categories')
|
||||
@PublicWithToken()
|
||||
async getGuildGoodCategories(@Param('guildId') guild_id: string): Promise<CatalogsServiceGetGuildGoodCategoriesResponseDto> {
|
||||
async getGuildGoodCategories(
|
||||
@Param('guildId') guild_id: string,
|
||||
): Promise<CatalogsServiceGetGuildGoodCategoriesResponseDto> {
|
||||
return this.catalogService.getGuildGoodCategories(guild_id)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,35 @@ export class CatalogsService {
|
||||
return ResponseMapper.list(items)
|
||||
}
|
||||
|
||||
async getMeasurements() {
|
||||
const items = await this.prisma.measureUnits.findMany({
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
code: true,
|
||||
},
|
||||
})
|
||||
return ResponseMapper.list(items)
|
||||
}
|
||||
|
||||
async getSKU(search: string) {
|
||||
const items = await this.prisma.stockKeepingUnits.findMany({
|
||||
// where: {
|
||||
// OR: [{ code: { contains: search } }, { name: { contains: search } }],
|
||||
// },
|
||||
select: {
|
||||
id: true,
|
||||
code: true,
|
||||
name: true,
|
||||
is_domestic: true,
|
||||
is_public: true,
|
||||
VAT: true,
|
||||
},
|
||||
take: 100,
|
||||
})
|
||||
return ResponseMapper.list(items)
|
||||
}
|
||||
|
||||
async getGuildGoodCategories(guild_id: string) {
|
||||
const items = await this.prisma.goodCategory.findMany({
|
||||
where: {
|
||||
|
||||
@@ -1,7 +1,23 @@
|
||||
import type { CatalogsService } from '../catalog.service'
|
||||
|
||||
export type CatalogsServiceGetDeviceBrandsResponseDto = Awaited<ReturnType<CatalogsService['getDeviceBrands']>>
|
||||
export type CatalogsServiceGetDevicesResponseDto = Awaited<ReturnType<CatalogsService['getDevices']>>
|
||||
export type CatalogsServiceGetGuildGoodCategoriesResponseDto = Awaited<ReturnType<CatalogsService['getGuildGoodCategories']>>
|
||||
export type CatalogsServiceGetGuildsResponseDto = Awaited<ReturnType<CatalogsService['getGuilds']>>
|
||||
export type CatalogsServiceGetProvidersResponseDto = Awaited<ReturnType<CatalogsService['getProviders']>>
|
||||
export type CatalogsServiceGetDeviceBrandsResponseDto = Awaited<
|
||||
ReturnType<CatalogsService['getDeviceBrands']>
|
||||
>
|
||||
export type CatalogsServiceGetDevicesResponseDto = Awaited<
|
||||
ReturnType<CatalogsService['getDevices']>
|
||||
>
|
||||
export type CatalogsServiceGetGuildGoodCategoriesResponseDto = Awaited<
|
||||
ReturnType<CatalogsService['getGuildGoodCategories']>
|
||||
>
|
||||
export type CatalogsServiceGetGuildsResponseDto = Awaited<
|
||||
ReturnType<CatalogsService['getGuilds']>
|
||||
>
|
||||
export type CatalogsServiceGetProvidersResponseDto = Awaited<
|
||||
ReturnType<CatalogsService['getProviders']>
|
||||
>
|
||||
export type CatalogsServiceGetSKUResponseDto = Awaited<
|
||||
ReturnType<CatalogsService['getSKU']>
|
||||
>
|
||||
export type CatalogsServiceGetMeasurementsResponseDto = Awaited<
|
||||
ReturnType<CatalogsService['getMeasurements']>
|
||||
>
|
||||
|
||||
+15
-3
@@ -35,7 +35,9 @@ export class SalesInvoicesService {
|
||||
|
||||
items: {
|
||||
select: {
|
||||
unit_type: true,
|
||||
measure_unit_code: true,
|
||||
measure_unit_text: true,
|
||||
sku_code: true,
|
||||
discount: true,
|
||||
notes: true,
|
||||
quantity: true,
|
||||
@@ -46,11 +48,21 @@ export class SalesInvoicesService {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
sku: true,
|
||||
sku: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
},
|
||||
},
|
||||
barcode: true,
|
||||
local_sku: true,
|
||||
pricing_model: true,
|
||||
unit_type: true,
|
||||
measure_unit: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
},
|
||||
},
|
||||
category: {
|
||||
select: {
|
||||
id: true,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { GoodPricingModel, UnitType } from '@/generated/prisma/enums'
|
||||
import { GoodPricingModel } from '@/generated/prisma/enums'
|
||||
import { ApiProperty, PartialType } from '@nestjs/swagger'
|
||||
import { IsEnum, IsOptional, IsString } from 'class-validator'
|
||||
|
||||
@@ -9,15 +9,15 @@ export class CreateGoodDto {
|
||||
|
||||
@IsString()
|
||||
@ApiProperty({ required: true })
|
||||
sku: string
|
||||
sku_id: string
|
||||
|
||||
@IsString()
|
||||
@ApiProperty({ required: true })
|
||||
category_id: string
|
||||
|
||||
@IsEnum(UnitType)
|
||||
@ApiProperty({ required: true, enum: UnitType })
|
||||
unit_type: UnitType
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
measure_unit_id: string
|
||||
|
||||
@IsEnum(GoodPricingModel)
|
||||
@ApiProperty({ required: true, enum: GoodPricingModel })
|
||||
|
||||
@@ -12,11 +12,21 @@ export class ConsumerBusinessActivityGoodsService {
|
||||
id: true,
|
||||
name: true,
|
||||
barcode: true,
|
||||
sku: true,
|
||||
local_sku: true,
|
||||
pricing_model: true,
|
||||
unit_type: true,
|
||||
image_url: true,
|
||||
sku: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
},
|
||||
},
|
||||
measure_unit: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
},
|
||||
},
|
||||
category: {
|
||||
select: {
|
||||
id: true,
|
||||
@@ -55,7 +65,7 @@ export class ConsumerBusinessActivityGoodsService {
|
||||
}
|
||||
|
||||
async create(business_activity_id: string, data: CreateGoodDto) {
|
||||
const { category_id, ...rest } = data
|
||||
const { category_id, sku_id, measure_unit_id, ...rest } = data
|
||||
|
||||
const good = await this.prisma.good.create({
|
||||
data: {
|
||||
@@ -70,6 +80,16 @@ export class ConsumerBusinessActivityGoodsService {
|
||||
id: category_id,
|
||||
},
|
||||
},
|
||||
sku: {
|
||||
connect: {
|
||||
id: sku_id,
|
||||
},
|
||||
},
|
||||
measure_unit: {
|
||||
connect: {
|
||||
id: measure_unit_id,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
return ResponseMapper.create(good)
|
||||
@@ -81,7 +101,7 @@ export class ConsumerBusinessActivityGoodsService {
|
||||
id: string,
|
||||
data: UpdateGoodDto,
|
||||
) {
|
||||
const { category_id, ...rest } = data
|
||||
const { category_id, sku_id, measure_unit_id, ...rest } = data
|
||||
const good = await this.prisma.good.update({
|
||||
where: {
|
||||
business_activity: {
|
||||
@@ -101,6 +121,16 @@ export class ConsumerBusinessActivityGoodsService {
|
||||
id: category_id,
|
||||
},
|
||||
},
|
||||
sku: {
|
||||
connect: {
|
||||
id: sku_id,
|
||||
},
|
||||
},
|
||||
measure_unit: {
|
||||
connect: {
|
||||
id: measure_unit_id,
|
||||
},
|
||||
},
|
||||
...rest,
|
||||
},
|
||||
})
|
||||
|
||||
@@ -27,7 +27,7 @@ export class consumerCustomersService {
|
||||
},
|
||||
legal: {
|
||||
select: {
|
||||
company_name: true,
|
||||
name: true,
|
||||
registration_number: true,
|
||||
postal_code: true,
|
||||
economic_code: true,
|
||||
|
||||
@@ -132,7 +132,12 @@ export class CustomerSaleInvoicesService {
|
||||
id: true,
|
||||
name: true,
|
||||
pricing_model: true,
|
||||
unit_type: true,
|
||||
measure_unit: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
},
|
||||
},
|
||||
category: {
|
||||
select: {
|
||||
id: true,
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
import {
|
||||
CustomerType,
|
||||
FiscalInvoiceCustomerType,
|
||||
FiscalRequestType,
|
||||
PartnerFiscalSwitchType,
|
||||
} from '@/generated/prisma/enums'
|
||||
import { ApiProperty } from '@nestjs/swagger'
|
||||
import { Type } from 'class-transformer'
|
||||
import {
|
||||
@@ -17,7 +23,67 @@ export enum TaxSendStatus {
|
||||
PENDING = 'PENDING',
|
||||
}
|
||||
|
||||
export class CustomerLegalInfoDto {
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
name: string
|
||||
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
economic_code: string
|
||||
}
|
||||
|
||||
export class CustomerIndividualInfoDto {
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
first_name: string
|
||||
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
last_name: string
|
||||
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
national_id: string
|
||||
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
mobile_number: string
|
||||
}
|
||||
|
||||
export class CustomerInfoDto {
|
||||
@ApiProperty({ required: true, enum: CustomerType })
|
||||
@IsEnum(CustomerType)
|
||||
type: CustomerType
|
||||
|
||||
@ApiProperty({})
|
||||
@Type(() => CustomerLegalInfoDto)
|
||||
@ValidateNested({ each: true })
|
||||
legal_info?: CustomerLegalInfoDto
|
||||
|
||||
@ApiProperty({})
|
||||
@Type(() => CustomerIndividualInfoDto)
|
||||
@ValidateNested({ each: true })
|
||||
individual_info?: CustomerIndividualInfoDto
|
||||
}
|
||||
export class TaxSwitchSendItemPayloadDto {
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
sku: string
|
||||
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
sku_vat: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
discount: string
|
||||
|
||||
@ApiProperty({ required: true })
|
||||
@IsNumber()
|
||||
unit_price: number
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
invoice_item_id: string
|
||||
@@ -26,17 +92,13 @@ export class TaxSwitchSendItemPayloadDto {
|
||||
@IsNumber()
|
||||
quantity: number
|
||||
|
||||
@ApiProperty()
|
||||
@IsNumber()
|
||||
unit_price: number
|
||||
|
||||
@ApiProperty()
|
||||
@IsNumber()
|
||||
total_amount: number
|
||||
|
||||
@ApiProperty()
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
unit_type: string
|
||||
measure_unit: string
|
||||
|
||||
@ApiProperty({ required: false, nullable: true })
|
||||
@IsOptional()
|
||||
@@ -52,41 +114,48 @@ export class TaxSwitchSendItemPayloadDto {
|
||||
@IsOptional()
|
||||
@IsObject()
|
||||
payload?: unknown
|
||||
|
||||
@ApiProperty({ required: false, nullable: true, type: Object })
|
||||
@IsOptional()
|
||||
@IsObject()
|
||||
good_snapshot?: unknown
|
||||
}
|
||||
|
||||
export class TaxSwitchSendPayloadDto {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
invoice_id: string
|
||||
@ApiProperty({ required: true, enum: FiscalRequestType })
|
||||
@IsEnum(FiscalRequestType)
|
||||
type: FiscalRequestType
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
invoice_code: string
|
||||
|
||||
@ApiProperty({ required: false, nullable: true })
|
||||
@IsOptional()
|
||||
@IsDateString()
|
||||
invoice_date: string | null
|
||||
|
||||
@ApiProperty()
|
||||
@IsNumber()
|
||||
total_amount: number
|
||||
|
||||
@ApiProperty({ required: false, nullable: true })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
provider_code?: string | null
|
||||
@ApiProperty({ required: true, enum: FiscalInvoiceCustomerType })
|
||||
@IsEnum(FiscalInvoiceCustomerType)
|
||||
customer_type: FiscalInvoiceCustomerType
|
||||
|
||||
@ApiProperty({ type: [TaxSwitchSendItemPayloadDto] })
|
||||
@IsArray()
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => TaxSwitchSendItemPayloadDto)
|
||||
items: TaxSwitchSendItemPayloadDto[]
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
@Type(() => CustomerInfoDto)
|
||||
@ValidateNested({ each: true })
|
||||
customer?: CustomerInfoDto
|
||||
|
||||
@ApiProperty({ required: true, nullable: true })
|
||||
@IsString()
|
||||
invoice_code: string
|
||||
|
||||
@ApiProperty({ required: true, nullable: true })
|
||||
@IsOptional()
|
||||
@IsDateString()
|
||||
invoice_date: Date
|
||||
|
||||
@ApiProperty({ required: true, nullable: true })
|
||||
@IsString()
|
||||
invoice_id: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsNumber()
|
||||
total_amount: number
|
||||
|
||||
@ApiProperty({ required: true, enum: PartnerFiscalSwitchType })
|
||||
@IsEnum(PartnerFiscalSwitchType)
|
||||
provider_code: PartnerFiscalSwitchType
|
||||
}
|
||||
|
||||
export class TaxSwitchSendItemResultDto {
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import { PrismaService } from '@/prisma/prisma.service'
|
||||
import { Injectable, NotFoundException } from '@nestjs/common'
|
||||
import { Prisma } from 'generated/prisma/client'
|
||||
import {
|
||||
FiscalInvoiceCustomerType,
|
||||
FiscalRequestType,
|
||||
Prisma,
|
||||
} from 'generated/prisma/client'
|
||||
import {
|
||||
TaxSendStatus,
|
||||
TaxSwitchGetResultDto,
|
||||
@@ -137,7 +141,7 @@ export class SalesInvoiceFiscalService {
|
||||
invoiceId: string,
|
||||
posId: string,
|
||||
): Promise<TaxSwitchSendPayloadDto> {
|
||||
const invoice = await this.prisma.salesInvoice.findFirst({
|
||||
const invoice = await this.prisma.salesInvoice.findUnique({
|
||||
where: {
|
||||
id: invoiceId,
|
||||
pos_id: posId,
|
||||
@@ -153,7 +157,10 @@ export class SalesInvoiceFiscalService {
|
||||
quantity: true,
|
||||
unit_price: true,
|
||||
total_amount: true,
|
||||
unit_type: true,
|
||||
measure_unit_code: true,
|
||||
measure_unit_text: true,
|
||||
sku_code: true,
|
||||
sku_vat: true,
|
||||
good_id: true,
|
||||
service_id: true,
|
||||
payload: true,
|
||||
@@ -162,9 +169,55 @@ export class SalesInvoiceFiscalService {
|
||||
},
|
||||
pos: {
|
||||
select: {
|
||||
provider: {
|
||||
complex: {
|
||||
select: {
|
||||
code: true,
|
||||
business_activity: {
|
||||
select: {
|
||||
fiscal_id: true,
|
||||
economic_code: true,
|
||||
consumer: {
|
||||
select: {
|
||||
legal: {
|
||||
select: {
|
||||
partner: {
|
||||
select: {
|
||||
fiscal_switch_type: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
individual: {
|
||||
select: {
|
||||
partner: {
|
||||
select: {
|
||||
fiscal_switch_type: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
customer: {
|
||||
select: {
|
||||
type: true,
|
||||
individual: {
|
||||
select: {
|
||||
first_name: true,
|
||||
last_name: true,
|
||||
national_id: true,
|
||||
mobile_number: true,
|
||||
},
|
||||
},
|
||||
legal: {
|
||||
select: {
|
||||
name: true,
|
||||
economic_code: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -176,18 +229,36 @@ export class SalesInvoiceFiscalService {
|
||||
throw new NotFoundException('فاکتور مورد نظر یافت نشد.')
|
||||
}
|
||||
|
||||
const { partner } = (invoice.pos.complex.business_activity.consumer.legal ||
|
||||
invoice.pos.complex.business_activity.consumer.individual)!
|
||||
|
||||
return {
|
||||
invoice_id: invoice.id,
|
||||
invoice_code: invoice.code,
|
||||
invoice_date: invoice.invoice_date ? invoice.invoice_date.toISOString() : null,
|
||||
invoice_date: invoice.invoice_date,
|
||||
total_amount: Number(invoice.total_amount),
|
||||
provider_code: invoice.pos.provider?.code || null,
|
||||
// provider_code: invoice.pos.provider?.code || null,
|
||||
type: FiscalRequestType.MAIN,
|
||||
provider_code: partner.fiscal_switch_type!,
|
||||
customer_type: invoice.customer?.type
|
||||
? FiscalInvoiceCustomerType.Known
|
||||
: FiscalInvoiceCustomerType.Unknown,
|
||||
customer: invoice.customer?.type
|
||||
? {
|
||||
type: invoice.customer.type,
|
||||
legal_info: invoice.customer.legal ?? undefined,
|
||||
individual_info: invoice.customer.individual ?? undefined,
|
||||
}
|
||||
: undefined,
|
||||
items: invoice.items.map(item => ({
|
||||
invoice_item_id: item.id,
|
||||
quantity: Number(item.quantity),
|
||||
unit_price: Number(item.unit_price),
|
||||
total_amount: Number(item.total_amount),
|
||||
unit_type: item.unit_type,
|
||||
measure_unit: item.measure_unit_code,
|
||||
sku: item.sku_code,
|
||||
sku_vat: String(item.sku_vat),
|
||||
discount: String((item.payload as Record<string, any>)?.discount || '0'),
|
||||
good_id: item.good_id,
|
||||
service_id: item.service_id,
|
||||
payload: item.payload,
|
||||
|
||||
+148
-19
@@ -1,3 +1,8 @@
|
||||
import {
|
||||
CustomerType,
|
||||
FiscalInvoiceCustomerType,
|
||||
FiscalRequestType,
|
||||
} from '@/generated/prisma/enums'
|
||||
import { Injectable } from '@nestjs/common'
|
||||
import {
|
||||
ITaxSwitchAdapter,
|
||||
@@ -7,36 +12,74 @@ import {
|
||||
TaxSwitchSendItemResultDto,
|
||||
TaxSwitchSendPayloadDto,
|
||||
} from '../../dto/tax-switch.dto'
|
||||
import {
|
||||
NamaTaxGetResponseDto,
|
||||
NamaTaxRequestDto,
|
||||
NamaTaxSendItemResponseDto,
|
||||
} from './nama-fiscal-switch.dto'
|
||||
|
||||
@Injectable()
|
||||
export class NamaTaxSwitchAdapter implements ITaxSwitchAdapter {
|
||||
readonly code = 'NAMA'
|
||||
private readonly sandboxBaseUrl =
|
||||
process.env.NAMA_FISCAL_SANDBOX_URL || 'https://sandbox-api.nama.ir'
|
||||
private readonly productionBaseUrl =
|
||||
process.env.NAMA_FISCAL_PRODUCTION_URL || 'https://api.nama.ir'
|
||||
|
||||
private readonly sendPath = '/api/v1/fiscal/invoices/single-send'
|
||||
private readonly sendBulkPath = '/api/v1/invoices'
|
||||
private readonly checkStatus = '/api/v1/invoices/check-by-uuids'
|
||||
private readonly checkBulkStatus = '/api/v1/invoices/check-by-uuids'
|
||||
private readonly getPath = '/api/v1/fiscal/invoices/'
|
||||
|
||||
private get baseUrl() {
|
||||
return process.env.NODE_ENV === 'production'
|
||||
? this.productionBaseUrl
|
||||
: this.sandboxBaseUrl
|
||||
}
|
||||
|
||||
private buildSendUrl() {
|
||||
return `${this.baseUrl}${this.sendPath}`
|
||||
}
|
||||
|
||||
private buildGetUrl(taxId: string) {
|
||||
return `${this.baseUrl}${this.getPath}/${taxId}`
|
||||
}
|
||||
|
||||
async send(payload: TaxSwitchSendPayloadDto): Promise<TaxSwitchSendItemResultDto[]> {
|
||||
const mappedRequest = this.mapToNamaRequestDto(payload)
|
||||
|
||||
return payload.items.map((item, index) => {
|
||||
const sentAt = new Date()
|
||||
const receivedAt = new Date(sentAt.getTime() + 50)
|
||||
const externalRequest = {
|
||||
invoiceCode: payload.invoice_code,
|
||||
itemId: item.invoice_item_id,
|
||||
quantity: item.quantity,
|
||||
unitPrice: item.unit_price,
|
||||
totalAmount: item.total_amount,
|
||||
}
|
||||
|
||||
const externalResponse = {
|
||||
status: 'ACCEPTED',
|
||||
trackingCode: `TAX-${payload.invoice_code}-${index + 1}`,
|
||||
const providerResponse: NamaTaxSendItemResponseDto = {
|
||||
invoice_item_id: item.invoice_item_id,
|
||||
status: TaxSendStatus.SENT,
|
||||
tax_id: `TAX-${payload.invoice_code}-${index + 1}`,
|
||||
request_payload: {
|
||||
url: this.buildSendUrl(),
|
||||
body: mappedRequest,
|
||||
},
|
||||
response_payload: {
|
||||
provider: this.code,
|
||||
env: process.env.NODE_ENV || 'development',
|
||||
endpoint: this.buildSendUrl(),
|
||||
status: 'ACCEPTED',
|
||||
},
|
||||
sent_at: sentAt.toISOString(),
|
||||
received_at: receivedAt.toISOString(),
|
||||
}
|
||||
|
||||
return {
|
||||
invoice_item_id: item.invoice_item_id,
|
||||
status: TaxSendStatus.SENT,
|
||||
tax_id: externalResponse.trackingCode,
|
||||
request_payload: externalRequest,
|
||||
response_payload: externalResponse,
|
||||
sent_at: sentAt.toISOString(),
|
||||
received_at: receivedAt.toISOString(),
|
||||
invoice_item_id: providerResponse.invoice_item_id,
|
||||
status: providerResponse.status,
|
||||
tax_id: providerResponse.tax_id,
|
||||
request_payload: providerResponse.request_payload,
|
||||
response_payload: providerResponse.response_payload,
|
||||
error_message: providerResponse.error_message,
|
||||
sent_at: providerResponse.sent_at,
|
||||
received_at: providerResponse.received_at,
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -56,14 +99,100 @@ export class NamaTaxSwitchAdapter implements ITaxSwitchAdapter {
|
||||
}
|
||||
|
||||
async get(taxId: string): Promise<TaxSwitchGetResultDto> {
|
||||
return {
|
||||
const providerResponse: NamaTaxGetResponseDto = {
|
||||
tax_id: taxId,
|
||||
status: TaxSendStatus.SENT,
|
||||
response_payload: {
|
||||
provider: this.code,
|
||||
env: process.env.NODE_ENV || 'development',
|
||||
endpoint: this.buildGetUrl(taxId),
|
||||
status: 'CONFIRMED',
|
||||
trackingCode: taxId,
|
||||
tracking_code: taxId,
|
||||
},
|
||||
received_at: new Date().toISOString(),
|
||||
}
|
||||
|
||||
return {
|
||||
tax_id: providerResponse.tax_id,
|
||||
status: providerResponse.status,
|
||||
response_payload: providerResponse.response_payload,
|
||||
received_at: providerResponse.received_at,
|
||||
}
|
||||
}
|
||||
|
||||
private mapToNamaRequestDto(payload: TaxSwitchSendPayloadDto): NamaTaxRequestDto {
|
||||
return {
|
||||
uuid: payload.invoice_id,
|
||||
economic_code: '',
|
||||
fiscal_id: '',
|
||||
payment: [],
|
||||
header: {
|
||||
ins: this.mapFiscalRequestType(payload.type),
|
||||
inp: '2',
|
||||
inty: this.mapFiscalInvoiceCustomerType(payload.customer_type),
|
||||
// unique_tax_code: payload.invoice_code,
|
||||
inno: payload.invoice_code,
|
||||
tins: '',
|
||||
indatim: payload.invoice_date.getTime() + '',
|
||||
name:
|
||||
`${payload.customer?.individual_info?.first_name} ${payload.customer?.individual_info?.last_name}` ||
|
||||
payload.customer?.legal_info?.name ||
|
||||
'',
|
||||
tob: this.mapCustomerType(payload.customer?.type),
|
||||
address: '',
|
||||
mobile: payload.customer?.individual_info?.mobile_number || '',
|
||||
bid:
|
||||
payload.customer?.individual_info?.national_id ||
|
||||
payload.customer?.legal_info?.economic_code ||
|
||||
'',
|
||||
},
|
||||
body: payload.items.map(item => ({
|
||||
sstid: item.sku,
|
||||
vra: item.sku_vat,
|
||||
// sstt: item.unit_type,
|
||||
fee: String(item.unit_price),
|
||||
dis: String(item.discount),
|
||||
mu: item.measure_unit,
|
||||
am: String(item.quantity),
|
||||
consfee: '0',
|
||||
bros: '0',
|
||||
spro: '0',
|
||||
})),
|
||||
}
|
||||
}
|
||||
|
||||
private mapFiscalRequestType(type: FiscalRequestType) {
|
||||
switch (type) {
|
||||
case FiscalRequestType.MAIN:
|
||||
return '1'
|
||||
case FiscalRequestType.UPDATE:
|
||||
return '2'
|
||||
case FiscalRequestType.REVOKE:
|
||||
return '3'
|
||||
case FiscalRequestType.REMOVE:
|
||||
return '4'
|
||||
}
|
||||
}
|
||||
|
||||
private mapFiscalInvoiceCustomerType(type?: FiscalInvoiceCustomerType) {
|
||||
switch (type) {
|
||||
case FiscalInvoiceCustomerType.Unknown:
|
||||
return '1'
|
||||
case FiscalInvoiceCustomerType.Known:
|
||||
return '2'
|
||||
default:
|
||||
return '3'
|
||||
}
|
||||
}
|
||||
|
||||
private mapCustomerType(type?: CustomerType) {
|
||||
switch (type) {
|
||||
case CustomerType.INDIVIDUAL:
|
||||
return '1'
|
||||
case CustomerType.LEGAL:
|
||||
return '2'
|
||||
default:
|
||||
return ''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,14 @@
|
||||
import { ApiProperty } from '@nestjs/swagger'
|
||||
import { Type } from 'class-transformer'
|
||||
import { IsArray, IsString, ValidateNested } from 'class-validator'
|
||||
import {
|
||||
IsArray,
|
||||
IsEnum,
|
||||
IsObject,
|
||||
IsOptional,
|
||||
IsString,
|
||||
ValidateNested,
|
||||
} from 'class-validator'
|
||||
import { TaxSendStatus } from '../../dto/tax-switch.dto'
|
||||
|
||||
export class NamaTaxBodyItemDto {
|
||||
@ApiProperty()
|
||||
@@ -11,9 +19,9 @@ export class NamaTaxBodyItemDto {
|
||||
@IsString()
|
||||
vra: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
sstt: string
|
||||
// @ApiProperty()
|
||||
// @IsString()
|
||||
// sstt: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
@@ -45,7 +53,7 @@ export class NamaTaxBodyItemDto {
|
||||
}
|
||||
|
||||
export class NamaTaxHeaderDto {
|
||||
@ApiProperty()
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
ins: string
|
||||
|
||||
@@ -53,41 +61,43 @@ export class NamaTaxHeaderDto {
|
||||
@IsString()
|
||||
inp: string
|
||||
|
||||
@ApiProperty()
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
inty: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
unique_tax_code: string
|
||||
// @ApiProperty({required: true})
|
||||
// @IsString()
|
||||
// unique_tax_code: string
|
||||
|
||||
@ApiProperty()
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
inno: string
|
||||
|
||||
@ApiProperty()
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
tins: string
|
||||
|
||||
@ApiProperty()
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
indatim: string
|
||||
|
||||
@ApiProperty()
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
name: string
|
||||
|
||||
@ApiProperty()
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
tob: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
address: string
|
||||
address?: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
mobile: string
|
||||
mobile?: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
@@ -122,3 +132,63 @@ export class NamaTaxRequestDto {
|
||||
@IsString()
|
||||
fiscal_id: string
|
||||
}
|
||||
|
||||
export class NamaTaxSendItemResponseDto {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
invoice_item_id: string
|
||||
|
||||
@ApiProperty({ enum: TaxSendStatus })
|
||||
@IsEnum(TaxSendStatus)
|
||||
status: TaxSendStatus
|
||||
|
||||
@ApiProperty({ required: false, nullable: true })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
tax_id?: string | null
|
||||
|
||||
@ApiProperty({ required: false, nullable: true, type: Object })
|
||||
@IsOptional()
|
||||
@IsObject()
|
||||
request_payload?: unknown
|
||||
|
||||
@ApiProperty({ required: false, nullable: true, type: Object })
|
||||
@IsOptional()
|
||||
@IsObject()
|
||||
response_payload?: unknown
|
||||
|
||||
@ApiProperty({ required: false, nullable: true })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
error_message?: string | null
|
||||
|
||||
@ApiProperty({ required: false, nullable: true })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
sent_at?: string | null
|
||||
|
||||
@ApiProperty({ required: false, nullable: true })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
received_at?: string | null
|
||||
}
|
||||
|
||||
export class NamaTaxGetResponseDto {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
tax_id: string
|
||||
|
||||
@ApiProperty({ enum: TaxSendStatus })
|
||||
@IsEnum(TaxSendStatus)
|
||||
status: TaxSendStatus
|
||||
|
||||
@ApiProperty({ required: false, nullable: true, type: Object })
|
||||
@IsOptional()
|
||||
@IsObject()
|
||||
response_payload?: unknown
|
||||
|
||||
@ApiProperty({ required: false, nullable: true })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
received_at?: string | null
|
||||
}
|
||||
|
||||
@@ -117,7 +117,12 @@ export class SaleInvoicesService {
|
||||
id: true,
|
||||
name: true,
|
||||
pricing_model: true,
|
||||
unit_type: true,
|
||||
measure_unit: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
},
|
||||
},
|
||||
|
||||
category: {
|
||||
select: {
|
||||
@@ -136,7 +141,7 @@ export class SaleInvoicesService {
|
||||
type: true,
|
||||
legal: {
|
||||
select: {
|
||||
company_name: true,
|
||||
name: true,
|
||||
economic_code: true,
|
||||
registration_number: true,
|
||||
postal_code: true,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { PublicWithToken } from '@/common/decorators/withToken.decorator'
|
||||
import { Controller, Get } from '@nestjs/common'
|
||||
import { EnumsService } from './enums.service'
|
||||
import type { EnumsServiceGetEnumValuesResponseDto } from './dto/enums-response.dto'
|
||||
import { EnumsService } from './enums.service'
|
||||
|
||||
@Controller('enums')
|
||||
export class EnumsController {
|
||||
@@ -97,12 +97,6 @@ export class EnumsController {
|
||||
return this.enumsService.getEnumValues('TokenType')
|
||||
}
|
||||
|
||||
@Get('unit_type')
|
||||
@PublicWithToken()
|
||||
async getUnitType(): Promise<EnumsServiceGetEnumValuesResponseDto> {
|
||||
return this.enumsService.getEnumValues('UnitType')
|
||||
}
|
||||
|
||||
@Get('good_pricing_model')
|
||||
@PublicWithToken()
|
||||
async getGoodPricingModel(): Promise<EnumsServiceGetEnumValuesResponseDto> {
|
||||
@@ -114,4 +108,10 @@ export class EnumsController {
|
||||
async getConsumerRoleModel(): Promise<EnumsServiceGetEnumValuesResponseDto> {
|
||||
return this.enumsService.getEnumValues('ConsumerRole')
|
||||
}
|
||||
|
||||
@Get('fiscal_response_status')
|
||||
@PublicWithToken()
|
||||
async getFiscalResponseStatus(): Promise<EnumsServiceGetEnumValuesResponseDto> {
|
||||
return this.enumsService.getEnumValues('FiscalResponseStatus')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,14 +3,18 @@ import { translateEnumValue } from '@/common/utils/enum-translator.util'
|
||||
import {
|
||||
AccountRole,
|
||||
AccountStatus,
|
||||
AccountType,
|
||||
ApplicationPlatform,
|
||||
ApplicationPublisher,
|
||||
ApplicationReleaseType,
|
||||
BusinessRole,
|
||||
ComplexRole,
|
||||
ConsumerRole,
|
||||
ConsumerStatus,
|
||||
ConsumerType,
|
||||
CustomerType,
|
||||
FiscalInvoiceCustomerType,
|
||||
FiscalRequestType,
|
||||
FiscalResponseStatus,
|
||||
GoodPricingModel,
|
||||
LicenseStatus,
|
||||
@@ -24,12 +28,14 @@ import {
|
||||
POSType,
|
||||
ProviderRole,
|
||||
ProviderStatus,
|
||||
SKUGuildType,
|
||||
TokenType,
|
||||
UnitType,
|
||||
UserStatus,
|
||||
UserType,
|
||||
} from '@/generated/prisma/enums'
|
||||
import { Injectable } from '@nestjs/common'
|
||||
import { AccountType, GoldKarat, TokenType } from 'common/enums/enums'
|
||||
import { GoldKarat } from 'common/enums/enums'
|
||||
import { ResponseMapper } from 'common/response/response-mapper'
|
||||
|
||||
@Injectable()
|
||||
@@ -63,6 +69,7 @@ export class EnumsService {
|
||||
AccountType: this.prepareData(AccountType, 'AccountType'),
|
||||
PartnerRole: this.prepareData(PartnerRole, 'PartnerRole'),
|
||||
BusinessRole: this.prepareData(BusinessRole, 'BusinessRole'),
|
||||
ComplexRole: this.prepareData(ComplexRole, 'ComplexRole'),
|
||||
ProviderRole: this.prepareData(ProviderRole, 'ProviderRole'),
|
||||
ProviderStatus: this.prepareData(ProviderStatus, 'ProviderStatus'),
|
||||
TokenType: this.prepareData(TokenType, 'TokenType'),
|
||||
@@ -90,6 +97,12 @@ export class EnumsService {
|
||||
FiscalResponseStatus,
|
||||
'FiscalResponseStatus',
|
||||
),
|
||||
FiscalRequestType: this.prepareData(FiscalRequestType, 'FiscalRequestType'),
|
||||
FiscalInvoiceCustomerType: this.prepareData(
|
||||
FiscalInvoiceCustomerType,
|
||||
'FiscalInvoiceCustomerType',
|
||||
),
|
||||
SKUGuildType: this.prepareData(SKUGuildType, 'SKUGuildType'),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -114,6 +114,7 @@ export class BusinessActivitiesService {
|
||||
const createdBusinessActivity = await tx.businessActivity.create({
|
||||
data: {
|
||||
...rest,
|
||||
economic_code: String(data.economic_code),
|
||||
guild: {
|
||||
connect: {
|
||||
id: guild_id,
|
||||
|
||||
@@ -4,7 +4,7 @@ import { IsNumber, IsString, MaxLength, MinLength } from 'class-validator'
|
||||
export class CreateCustomerLegalDto {
|
||||
@IsString()
|
||||
@ApiProperty({ required: true })
|
||||
company_name: string
|
||||
name: string
|
||||
|
||||
@IsString()
|
||||
@ApiProperty({ required: true })
|
||||
|
||||
@@ -13,8 +13,8 @@ export class CreateGoodDto {
|
||||
description?: string
|
||||
|
||||
@IsString()
|
||||
@ApiProperty()
|
||||
sku: string
|
||||
@ApiProperty({ required: true })
|
||||
sku_id: string
|
||||
|
||||
@IsString()
|
||||
@ApiProperty()
|
||||
@@ -42,6 +42,10 @@ export class CreateGoodDto {
|
||||
@IsNumber()
|
||||
@ApiProperty({ required: false })
|
||||
base_sale_price?: number
|
||||
|
||||
@IsString()
|
||||
@ApiProperty({ required: true })
|
||||
measure_unit_id: string
|
||||
}
|
||||
|
||||
export class UpdateGoodDto extends PartialType(CreateGoodDto) {}
|
||||
|
||||
@@ -14,11 +14,21 @@ export class GoodsService {
|
||||
barcode: true,
|
||||
created_at: true,
|
||||
description: true,
|
||||
sku: true,
|
||||
sku: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
},
|
||||
},
|
||||
local_sku: true,
|
||||
is_default_guild_good: true,
|
||||
pricing_model: true,
|
||||
unit_type: true,
|
||||
measure_unit: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
},
|
||||
},
|
||||
image_url: true,
|
||||
category: {
|
||||
select: {
|
||||
@@ -66,7 +76,7 @@ export class GoodsService {
|
||||
}
|
||||
|
||||
async create(data: CreateGoodDto, business_activity_id: string) {
|
||||
const { category_id, ...rest } = data
|
||||
const { category_id, sku_id, measure_unit_id, ...rest } = data
|
||||
|
||||
const dataToCreate = {
|
||||
...rest,
|
||||
@@ -81,6 +91,16 @@ export class GoodsService {
|
||||
const good = await this.prisma.good.create({
|
||||
data: {
|
||||
...rest,
|
||||
measure_unit: {
|
||||
connect: {
|
||||
id: measure_unit_id,
|
||||
},
|
||||
},
|
||||
sku: {
|
||||
connect: {
|
||||
id: sku_id,
|
||||
},
|
||||
},
|
||||
category: {
|
||||
connect: {
|
||||
id: category_id,
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
import { ApiPropertyOptional } from '@nestjs/swagger'
|
||||
import { Type } from 'class-transformer'
|
||||
import {
|
||||
IsDateString,
|
||||
IsEnum,
|
||||
IsNumber,
|
||||
IsOptional,
|
||||
IsString,
|
||||
Min,
|
||||
} from 'class-validator'
|
||||
import { FiscalResponseStatus } from 'generated/prisma/enums'
|
||||
|
||||
export class SalesInvoicesFilterDto {
|
||||
@ApiPropertyOptional({ default: 1 })
|
||||
@IsOptional()
|
||||
@Type(() => Number)
|
||||
@IsNumber()
|
||||
@Min(1)
|
||||
page?: number
|
||||
|
||||
@ApiPropertyOptional({ default: 10 })
|
||||
@IsOptional()
|
||||
@Type(() => Number)
|
||||
@IsNumber()
|
||||
@Min(1)
|
||||
perPage?: number
|
||||
|
||||
@ApiPropertyOptional()
|
||||
@IsOptional()
|
||||
@IsDateString()
|
||||
invoice_date_from?: string
|
||||
|
||||
@ApiPropertyOptional()
|
||||
@IsOptional()
|
||||
@IsDateString()
|
||||
invoice_date_to?: string
|
||||
|
||||
@ApiPropertyOptional()
|
||||
@IsOptional()
|
||||
@IsDateString()
|
||||
created_at_from?: string
|
||||
|
||||
@ApiPropertyOptional()
|
||||
@IsOptional()
|
||||
@IsDateString()
|
||||
created_at_to?: string
|
||||
|
||||
@ApiPropertyOptional()
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
code?: string
|
||||
|
||||
@ApiPropertyOptional()
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
customer_name?: string
|
||||
|
||||
@ApiPropertyOptional()
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
customer_mobile?: string
|
||||
|
||||
@ApiPropertyOptional()
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
customer_national_id?: string
|
||||
|
||||
@ApiPropertyOptional()
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
customer_economic_code?: string
|
||||
|
||||
@ApiPropertyOptional({ enum: FiscalResponseStatus })
|
||||
@IsOptional()
|
||||
@IsEnum(FiscalResponseStatus)
|
||||
status?: FiscalResponseStatus
|
||||
|
||||
@ApiPropertyOptional()
|
||||
@IsOptional()
|
||||
@Type(() => Number)
|
||||
@IsNumber()
|
||||
total_amount?: number
|
||||
|
||||
@ApiPropertyOptional()
|
||||
@IsOptional()
|
||||
@Type(() => Number)
|
||||
@IsNumber()
|
||||
total_amount_from?: number
|
||||
|
||||
@ApiPropertyOptional()
|
||||
@IsOptional()
|
||||
@Type(() => Number)
|
||||
@IsNumber()
|
||||
total_amount_to?: number
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
import { PosInfo } from '@/common/decorators/posInfo.decorator'
|
||||
import type { IPosPayload } from '@/common/models/posPayload.model'
|
||||
import { Controller, Get, Param, Post } from '@nestjs/common'
|
||||
import { PosSalesInvoiceFiscalService } from './sales-invoice-fiscal.service'
|
||||
|
||||
@Controller('pos/sales_invoices/:invoiceId/fiscal')
|
||||
export class PosSalesInvoiceFiscalController {
|
||||
constructor(private readonly service: PosSalesInvoiceFiscalService) {}
|
||||
|
||||
@Post('send')
|
||||
async send(@PosInfo() posInfo: IPosPayload, @Param('invoiceId') invoiceId: string) {
|
||||
return this.service.send(invoiceId, posInfo)
|
||||
}
|
||||
|
||||
@Post('retry')
|
||||
async retry(@PosInfo() posInfo: IPosPayload, @Param('invoiceId') invoiceId: string) {
|
||||
return this.service.retry(invoiceId, posInfo)
|
||||
}
|
||||
|
||||
@Get('status')
|
||||
async getStatus(
|
||||
@PosInfo() posInfo: IPosPayload,
|
||||
@Param('invoiceId') invoiceId: string,
|
||||
) {
|
||||
return this.service.getStatus(invoiceId, posInfo)
|
||||
}
|
||||
|
||||
@Post('status/refresh')
|
||||
async refreshStatus(
|
||||
@PosInfo() posInfo: IPosPayload,
|
||||
@Param('invoiceId') invoiceId: string,
|
||||
) {
|
||||
return this.service.refreshStatus(invoiceId, posInfo)
|
||||
}
|
||||
|
||||
@Get('attempts')
|
||||
async getAttempts(
|
||||
@PosInfo() posInfo: IPosPayload,
|
||||
@Param('invoiceId') invoiceId: string,
|
||||
) {
|
||||
return this.service.getAttempts(invoiceId, posInfo)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
import { Module } from '@nestjs/common'
|
||||
import { SalesInvoiceFiscalSwitchService } from '../../../consumer/saleInvoices/fiscal/sales-invoice-fiscal-switch.service'
|
||||
import { NamaTaxSwitchAdapter } from '../../../consumer/saleInvoices/fiscal/switch/nama/nama-fiscal-switch.adapter'
|
||||
import { PosSalesInvoiceFiscalController } from './sales-invoice-fiscal.controller'
|
||||
import { PosSalesInvoiceFiscalService } from './sales-invoice-fiscal.service'
|
||||
|
||||
@Module({
|
||||
controllers: [PosSalesInvoiceFiscalController],
|
||||
providers: [PosSalesInvoiceFiscalService, SalesInvoiceFiscalSwitchService, NamaTaxSwitchAdapter],
|
||||
exports: [PosSalesInvoiceFiscalService],
|
||||
})
|
||||
export class PosSalesInvoiceFiscalModule {}
|
||||
@@ -0,0 +1,411 @@
|
||||
import { IPosPayload } from '@/common/models/posPayload.model'
|
||||
import { PrismaService } from '@/prisma/prisma.service'
|
||||
import { Injectable, NotFoundException } from '@nestjs/common'
|
||||
import {
|
||||
FiscalInvoiceCustomerType,
|
||||
FiscalRequestType,
|
||||
FiscalResponseStatus,
|
||||
} from 'generated/prisma/enums'
|
||||
import {
|
||||
TaxSendStatus,
|
||||
TaxSwitchGetResultDto,
|
||||
TaxSwitchSendItemResultDto,
|
||||
TaxSwitchSendPayloadDto,
|
||||
} from '../../../consumer/saleInvoices/fiscal/dto/tax-switch.dto'
|
||||
import { SalesInvoiceFiscalSwitchService } from '../../../consumer/saleInvoices/fiscal/sales-invoice-fiscal-switch.service'
|
||||
|
||||
@Injectable()
|
||||
export class PosSalesInvoiceFiscalService {
|
||||
constructor(
|
||||
private readonly prisma: PrismaService,
|
||||
private readonly fiscalSwitchService: SalesInvoiceFiscalSwitchService,
|
||||
) {}
|
||||
|
||||
async send(invoiceId: string, posInfo: IPosPayload) {
|
||||
const payload = await this.buildPayload(invoiceId, posInfo)
|
||||
const itemResults = await this.safeSend(payload)
|
||||
const attempt = await this.persistAttempt(invoiceId, itemResults)
|
||||
|
||||
return {
|
||||
invoice_id: invoiceId,
|
||||
fiscal_id: attempt.fiscal_id,
|
||||
status: attempt.status,
|
||||
attempt_no: attempt.attempt_no,
|
||||
}
|
||||
}
|
||||
|
||||
async retry(invoiceId: string, posInfo: IPosPayload) {
|
||||
return this.send(invoiceId, posInfo)
|
||||
}
|
||||
|
||||
async getStatus(invoiceId: string, posInfo: IPosPayload) {
|
||||
const invoice = await this.getInvoiceForBusiness(invoiceId, posInfo.business_id)
|
||||
if (!invoice.fiscal) {
|
||||
return {
|
||||
invoice_id: invoiceId,
|
||||
status: FiscalResponseStatus.NOT_SEND,
|
||||
fiscal: null,
|
||||
}
|
||||
}
|
||||
|
||||
const latestAttempt = invoice.fiscal.attempts[0] || null
|
||||
return {
|
||||
invoice_id: invoiceId,
|
||||
status: latestAttempt?.status || FiscalResponseStatus.NOT_SEND,
|
||||
fiscal: {
|
||||
id: invoice.fiscal.id,
|
||||
retry_count: invoice.fiscal.retry_count,
|
||||
last_attempt_at: invoice.fiscal.last_attempt_at,
|
||||
},
|
||||
latest_attempt: latestAttempt,
|
||||
}
|
||||
}
|
||||
|
||||
async refreshStatus(invoiceId: string, posInfo: IPosPayload) {
|
||||
const invoice = await this.getInvoiceForBusiness(invoiceId, posInfo.business_id)
|
||||
const latestAttempt = invoice.fiscal?.attempts?.[0]
|
||||
|
||||
if (!invoice.fiscal || !latestAttempt?.tax_id) {
|
||||
return this.getStatus(invoiceId, posInfo)
|
||||
}
|
||||
|
||||
const providerCode = invoice.pos.provider?.code
|
||||
const switchResult = await this.fiscalSwitchService.get(
|
||||
providerCode,
|
||||
latestAttempt.tax_id,
|
||||
)
|
||||
const mappedStatus = this.mapSwitchGetStatus(switchResult.status)
|
||||
|
||||
const refreshedAttempt = await this.prisma.$transaction(async tx => {
|
||||
const nextNo = (latestAttempt.attempt_no || 0) + 1
|
||||
const createdAttempt = await tx.saleInvoiceFiscalAttempts.create({
|
||||
data: {
|
||||
fiscal_id: invoice.fiscal!.id,
|
||||
attempt_no: nextNo,
|
||||
status: mappedStatus,
|
||||
tax_id: switchResult.tax_id,
|
||||
response_payload: switchResult.response_payload
|
||||
? JSON.parse(JSON.stringify(switchResult.response_payload))
|
||||
: undefined,
|
||||
received_at: switchResult.received_at
|
||||
? new Date(switchResult.received_at)
|
||||
: null,
|
||||
type: FiscalRequestType.MAIN,
|
||||
},
|
||||
})
|
||||
|
||||
await tx.saleInvoiceFiscals.update({
|
||||
where: { id: invoice.fiscal!.id },
|
||||
data: {
|
||||
retry_count: nextNo,
|
||||
last_attempt_at: createdAttempt.created_at,
|
||||
},
|
||||
})
|
||||
|
||||
return createdAttempt
|
||||
})
|
||||
|
||||
return {
|
||||
invoice_id: invoiceId,
|
||||
status: refreshedAttempt.status,
|
||||
latest_attempt: refreshedAttempt,
|
||||
}
|
||||
}
|
||||
|
||||
async getAttempts(invoiceId: string, posInfo: IPosPayload) {
|
||||
const invoice = await this.getInvoiceForBusiness(invoiceId, posInfo.business_id)
|
||||
if (!invoice.fiscal) {
|
||||
return {
|
||||
invoice_id: invoiceId,
|
||||
fiscal_id: null,
|
||||
attempts: [],
|
||||
}
|
||||
}
|
||||
|
||||
const attempts = await this.prisma.saleInvoiceFiscalAttempts.findMany({
|
||||
where: {
|
||||
fiscal_id: invoice.fiscal.id,
|
||||
},
|
||||
orderBy: {
|
||||
attempt_no: 'desc',
|
||||
},
|
||||
})
|
||||
|
||||
return {
|
||||
invoice_id: invoiceId,
|
||||
fiscal_id: invoice.fiscal.id,
|
||||
attempts,
|
||||
}
|
||||
}
|
||||
|
||||
private async buildPayload(invoiceId: string, posInfo: IPosPayload) {
|
||||
const invoice = await this.prisma.salesInvoice.findUnique({
|
||||
where: {
|
||||
id: invoiceId,
|
||||
pos: {
|
||||
id: posInfo.pos_id,
|
||||
complex: {
|
||||
business_activity_id: posInfo.business_id,
|
||||
},
|
||||
},
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
code: true,
|
||||
invoice_date: true,
|
||||
total_amount: true,
|
||||
items: {
|
||||
select: {
|
||||
id: true,
|
||||
quantity: true,
|
||||
unit_price: true,
|
||||
total_amount: true,
|
||||
measure_unit_text: true,
|
||||
sku_code: true,
|
||||
sku_vat: true,
|
||||
measure_unit_code: true,
|
||||
good_id: true,
|
||||
service_id: true,
|
||||
payload: true,
|
||||
good_snapshot: true,
|
||||
},
|
||||
},
|
||||
customer: {
|
||||
select: {
|
||||
type: true,
|
||||
individual: true,
|
||||
legal: true,
|
||||
},
|
||||
},
|
||||
|
||||
pos: {
|
||||
select: {
|
||||
complex: {
|
||||
select: {
|
||||
business_activity: {
|
||||
select: {
|
||||
fiscal_id: true,
|
||||
economic_code: true,
|
||||
consumer: {
|
||||
select: {
|
||||
legal: {
|
||||
select: {
|
||||
partner: {
|
||||
select: {
|
||||
fiscal_switch_type: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
individual: {
|
||||
select: {
|
||||
partner: {
|
||||
select: {
|
||||
fiscal_switch_type: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
if (!invoice) {
|
||||
throw new NotFoundException('فاکتور مورد نظر یافت نشد.')
|
||||
}
|
||||
|
||||
const { partner } = (invoice.pos.complex.business_activity.consumer.legal ||
|
||||
invoice.pos.complex.business_activity.consumer.individual)!
|
||||
|
||||
return {
|
||||
invoice_id: invoice.id,
|
||||
invoice_code: invoice.code,
|
||||
invoice_date: invoice.invoice_date,
|
||||
total_amount: Number(invoice.total_amount),
|
||||
customer_type: invoice.customer
|
||||
? FiscalInvoiceCustomerType.Known
|
||||
: FiscalInvoiceCustomerType.Unknown,
|
||||
type: FiscalRequestType.MAIN,
|
||||
provider_code: partner.fiscal_switch_type,
|
||||
items: invoice.items.map(item => ({
|
||||
invoice_item_id: item.id,
|
||||
quantity: Number(item.quantity),
|
||||
unit_price: Number(item.unit_price),
|
||||
total_amount: Number(item.total_amount),
|
||||
good_id: item.good_id,
|
||||
service_id: item.service_id,
|
||||
payload: item.payload,
|
||||
good_snapshot: item.good_snapshot,
|
||||
discount: String((item.payload as Record<string, any>)?.discount || '0'),
|
||||
sku: item.sku_code,
|
||||
sku_vat: String(item.sku_vat),
|
||||
measure_unit: item.measure_unit_code,
|
||||
// sku: item.
|
||||
})),
|
||||
} satisfies TaxSwitchSendPayloadDto
|
||||
}
|
||||
|
||||
private async safeSend(payload: TaxSwitchSendPayloadDto) {
|
||||
try {
|
||||
return await this.fiscalSwitchService.send(payload)
|
||||
} catch (error: any) {
|
||||
const now = new Date().toISOString()
|
||||
return payload.items.map(item => ({
|
||||
invoice_item_id: item.invoice_item_id,
|
||||
status: TaxSendStatus.FAILED,
|
||||
error_message: error?.message || 'Unexpected fiscal switch error.',
|
||||
sent_at: now,
|
||||
received_at: now,
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
private async persistAttempt(
|
||||
invoiceId: string,
|
||||
itemResults: TaxSwitchSendItemResultDto[],
|
||||
) {
|
||||
return this.prisma.$transaction(async tx => {
|
||||
const fiscal = await tx.saleInvoiceFiscals.upsert({
|
||||
where: { invoice_id: invoiceId },
|
||||
update: {},
|
||||
create: {
|
||||
invoice_id: invoiceId,
|
||||
},
|
||||
})
|
||||
|
||||
const latest = await tx.saleInvoiceFiscalAttempts.findFirst({
|
||||
where: { fiscal_id: fiscal.id },
|
||||
orderBy: { attempt_no: 'desc' },
|
||||
select: { attempt_no: true },
|
||||
})
|
||||
const nextAttemptNo = (latest?.attempt_no || 0) + 1
|
||||
|
||||
const finalStatus = this.mapItemResultsStatus(itemResults)
|
||||
const firstTaxId = itemResults.find(item => item.tax_id)?.tax_id || null
|
||||
const sentAt = itemResults.map(item => item.sent_at).find(Boolean)
|
||||
const receivedAt = itemResults.map(item => item.received_at).find(Boolean)
|
||||
const errors = itemResults.map(item => item.error_message).filter(Boolean)
|
||||
const errorMessage = errors.length ? Array.from(new Set(errors)).join(' | ') : null
|
||||
|
||||
const attempt = await tx.saleInvoiceFiscalAttempts.create({
|
||||
data: {
|
||||
fiscal_id: fiscal.id,
|
||||
attempt_no: nextAttemptNo,
|
||||
status: finalStatus,
|
||||
tax_id: firstTaxId,
|
||||
type: FiscalRequestType.MAIN,
|
||||
request_payload: JSON.parse(
|
||||
JSON.stringify(itemResults.map(item => item.request_payload)),
|
||||
),
|
||||
response_payload: JSON.parse(
|
||||
JSON.stringify(itemResults.map(item => item.response_payload)),
|
||||
),
|
||||
error_message: errorMessage,
|
||||
sent_at: sentAt ? new Date(sentAt) : null,
|
||||
received_at: receivedAt ? new Date(receivedAt) : null,
|
||||
},
|
||||
})
|
||||
|
||||
await tx.saleInvoiceFiscals.update({
|
||||
where: { id: fiscal.id },
|
||||
data: {
|
||||
retry_count: nextAttemptNo,
|
||||
last_attempt_at: attempt.sent_at || attempt.created_at,
|
||||
},
|
||||
})
|
||||
|
||||
return {
|
||||
fiscal_id: fiscal.id,
|
||||
status: attempt.status,
|
||||
attempt_no: attempt.attempt_no,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
private mapItemResultsStatus(itemResults: TaxSwitchSendItemResultDto[]) {
|
||||
if (!itemResults.length) {
|
||||
return FiscalResponseStatus.NOT_SEND
|
||||
}
|
||||
const hasFailure = itemResults.some(item => item.status === TaxSendStatus.FAILED)
|
||||
if (hasFailure) {
|
||||
return FiscalResponseStatus.FAILURE
|
||||
}
|
||||
const hasSent = itemResults.some(item => item.status === TaxSendStatus.SENT)
|
||||
if (hasSent) {
|
||||
return FiscalResponseStatus.SUCCESS
|
||||
}
|
||||
return FiscalResponseStatus.NOT_SEND
|
||||
}
|
||||
|
||||
private mapSwitchGetStatus(status: TaxSwitchGetResultDto['status']) {
|
||||
switch (status) {
|
||||
case TaxSendStatus.SENT:
|
||||
return FiscalResponseStatus.SUCCESS
|
||||
case TaxSendStatus.FAILED:
|
||||
return FiscalResponseStatus.FAILURE
|
||||
default:
|
||||
return FiscalResponseStatus.NOT_SEND
|
||||
}
|
||||
}
|
||||
|
||||
private async getInvoiceForBusiness(invoiceId: string, businessId: string) {
|
||||
const invoice = await this.prisma.salesInvoice.findFirst({
|
||||
where: {
|
||||
id: invoiceId,
|
||||
pos: {
|
||||
complex: {
|
||||
business_activity_id: businessId,
|
||||
},
|
||||
},
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
pos: {
|
||||
select: {
|
||||
provider: {
|
||||
select: {
|
||||
code: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
fiscal: {
|
||||
select: {
|
||||
id: true,
|
||||
retry_count: true,
|
||||
last_attempt_at: true,
|
||||
attempts: {
|
||||
orderBy: {
|
||||
attempt_no: 'desc',
|
||||
},
|
||||
take: 1,
|
||||
select: {
|
||||
id: true,
|
||||
attempt_no: true,
|
||||
status: true,
|
||||
tax_id: true,
|
||||
sent_at: true,
|
||||
received_at: true,
|
||||
error_message: true,
|
||||
created_at: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
if (!invoice) {
|
||||
throw new NotFoundException('فاکتور مورد نظر یافت نشد.')
|
||||
}
|
||||
|
||||
return invoice
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
import { Body, Controller, Get, Param, Post } from '@nestjs/common'
|
||||
import { Body, Controller, Get, Param, Post, Query } from '@nestjs/common'
|
||||
|
||||
import { PosInfo } from '@/common/decorators/posInfo.decorator'
|
||||
import type { IPosPayload } from '@/common/models/posPayload.model'
|
||||
import { CreateSalesInvoiceDto } from './dto/create-sales-invoice.dto'
|
||||
import { SalesInvoicesFilterDto } from './dto/sales-invoices-filter.dto'
|
||||
import { SalesInvoicesService } from './sales-invoices.service'
|
||||
|
||||
@Controller('pos/sales_invoices')
|
||||
@@ -10,13 +11,13 @@ export class SalesInvoicesController {
|
||||
constructor(private readonly salesInvoicesService: SalesInvoicesService) {}
|
||||
|
||||
@Get()
|
||||
findAll() {
|
||||
return this.salesInvoicesService.findAll()
|
||||
findAll(@PosInfo() posInfo: IPosPayload, @Query() query: SalesInvoicesFilterDto) {
|
||||
return this.salesInvoicesService.findAll(posInfo, query)
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
findOne(@Param('id') id: string) {
|
||||
return this.salesInvoicesService.findOne(+id)
|
||||
findOne(@PosInfo() posInfo: IPosPayload, @Param('id') id: string) {
|
||||
return this.salesInvoicesService.findOne(posInfo, id)
|
||||
}
|
||||
|
||||
@Post()
|
||||
|
||||
@@ -2,10 +2,12 @@ import { Module } from '@nestjs/common'
|
||||
import { SalesInvoiceFiscalSwitchService } from '../../consumer/saleInvoices/fiscal/sales-invoice-fiscal-switch.service'
|
||||
import { SalesInvoiceFiscalService } from '../../consumer/saleInvoices/fiscal/sales-invoice-fiscal.service'
|
||||
import { NamaTaxSwitchAdapter } from '../../consumer/saleInvoices/fiscal/switch/nama/nama-fiscal-switch.adapter'
|
||||
import { PosSalesInvoiceFiscalModule } from './fiscal/sales-invoice-fiscal.module'
|
||||
import { SalesInvoicesController } from './sales-invoices.controller'
|
||||
import { SalesInvoicesService } from './sales-invoices.service'
|
||||
|
||||
@Module({
|
||||
imports: [PosSalesInvoiceFiscalModule],
|
||||
controllers: [SalesInvoicesController],
|
||||
providers: [
|
||||
SalesInvoicesService,
|
||||
|
||||
@@ -1,12 +1,18 @@
|
||||
import { IPosPayload } from '@/common/models/posPayload.model'
|
||||
import { translateEnumValue } from '@/common/utils'
|
||||
import { PrismaService } from '@/prisma/prisma.service'
|
||||
import { BadRequestException, Injectable } from '@nestjs/common'
|
||||
import { ResponseMapper } from 'common/response/response-mapper'
|
||||
import type { CustomerIndividual, CustomerLegal } from 'generated/prisma/client'
|
||||
import { Prisma } from 'generated/prisma/client'
|
||||
import { CustomerType, PaymentMethodType } from 'generated/prisma/enums'
|
||||
import {
|
||||
CustomerType,
|
||||
FiscalResponseStatus,
|
||||
PaymentMethodType,
|
||||
} from 'generated/prisma/enums'
|
||||
import { SalesInvoiceFiscalService } from '../../consumer/saleInvoices/fiscal/sales-invoice-fiscal.service'
|
||||
import { CreateSalesInvoiceDto } from './dto/create-sales-invoice.dto'
|
||||
import { SalesInvoicesFilterDto } from './dto/sales-invoices-filter.dto'
|
||||
|
||||
// Define type guard for CustomerIndividual
|
||||
function isCustomerIndividual(customer: any): customer is CustomerIndividual {
|
||||
@@ -50,14 +56,213 @@ export class SalesInvoicesService {
|
||||
private salesInvoiceTaxService: SalesInvoiceFiscalService,
|
||||
) {}
|
||||
|
||||
findAll() {
|
||||
// TODO: Implement fetching all sales invoices
|
||||
return []
|
||||
async findAll(posInfo: IPosPayload, query: SalesInvoicesFilterDto = {}) {
|
||||
const page = query.page || 1
|
||||
const perPage = Math.min(query.perPage || 10, 100)
|
||||
|
||||
const where = this.buildFindAllWhere(posInfo, query)
|
||||
const [items, total] = await this.prisma.$transaction(async tx => [
|
||||
await tx.salesInvoice.findMany({
|
||||
where,
|
||||
orderBy: {
|
||||
created_at: 'desc',
|
||||
},
|
||||
skip: (page - 1) * perPage,
|
||||
take: perPage,
|
||||
select: {
|
||||
id: true,
|
||||
code: true,
|
||||
invoice_number: true,
|
||||
invoice_date: true,
|
||||
created_at: true,
|
||||
total_amount: true,
|
||||
customer: {
|
||||
select: {
|
||||
type: true,
|
||||
individual: {
|
||||
select: {
|
||||
first_name: true,
|
||||
last_name: true,
|
||||
mobile_number: true,
|
||||
national_id: true,
|
||||
},
|
||||
},
|
||||
legal: {
|
||||
select: {
|
||||
name: true,
|
||||
economic_code: true,
|
||||
registration_number: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
fiscal: {
|
||||
select: {
|
||||
attempts: {
|
||||
orderBy: {
|
||||
created_at: 'desc',
|
||||
},
|
||||
take: 1,
|
||||
select: {
|
||||
status: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}),
|
||||
await tx.salesInvoice.count({ where }),
|
||||
])
|
||||
|
||||
const summaryItems = items.map(invoice => ({
|
||||
...invoice,
|
||||
status: translateEnumValue(
|
||||
'FiscalResponseStatus',
|
||||
invoice.fiscal?.attempts?.[0]?.status || FiscalResponseStatus.NOT_SEND,
|
||||
),
|
||||
}))
|
||||
|
||||
return ResponseMapper.paginate(summaryItems, { total, page, perPage })
|
||||
}
|
||||
|
||||
findOne(id: number) {
|
||||
// TODO: Implement fetching a single sales invoice
|
||||
return {}
|
||||
async findOne(posInfo: IPosPayload, id: string) {
|
||||
const invoice = await this.prisma.salesInvoice.findFirstOrThrow({
|
||||
where: {
|
||||
id,
|
||||
pos: {
|
||||
complex: {
|
||||
business_activity_id: posInfo.business_id,
|
||||
},
|
||||
},
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
code: true,
|
||||
invoice_number: true,
|
||||
invoice_date: true,
|
||||
created_at: true,
|
||||
updated_at: true,
|
||||
notes: true,
|
||||
total_amount: true,
|
||||
unknown_customer: true,
|
||||
customer: {
|
||||
select: {
|
||||
id: true,
|
||||
type: true,
|
||||
individual: {
|
||||
select: {
|
||||
first_name: true,
|
||||
last_name: true,
|
||||
mobile_number: true,
|
||||
national_id: true,
|
||||
postal_code: true,
|
||||
economic_code: true,
|
||||
},
|
||||
},
|
||||
legal: {
|
||||
select: {
|
||||
name: true,
|
||||
economic_code: true,
|
||||
registration_number: true,
|
||||
postal_code: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
pos: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
complex: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
business_activity: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
consumer_account: {
|
||||
select: {
|
||||
id: true,
|
||||
role: true,
|
||||
account: {
|
||||
select: {
|
||||
username: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
items: {
|
||||
select: {
|
||||
id: true,
|
||||
good_id: true,
|
||||
service_id: true,
|
||||
quantity: true,
|
||||
measure_unit_code: true,
|
||||
measure_unit_text: true,
|
||||
sku_code: true,
|
||||
unit_price: true,
|
||||
discount: true,
|
||||
total_amount: true,
|
||||
notes: true,
|
||||
payload: true,
|
||||
good_snapshot: true,
|
||||
},
|
||||
},
|
||||
payments: {
|
||||
select: {
|
||||
id: true,
|
||||
amount: true,
|
||||
payment_method: true,
|
||||
paid_at: true,
|
||||
created_at: true,
|
||||
terminal_info: {
|
||||
select: {
|
||||
terminal_id: true,
|
||||
stan: true,
|
||||
rrn: true,
|
||||
transaction_date_time: true,
|
||||
customer_card_no: true,
|
||||
description: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
fiscal: {
|
||||
select: {
|
||||
id: true,
|
||||
retry_count: true,
|
||||
last_attempt_at: true,
|
||||
attempts: {
|
||||
orderBy: {
|
||||
created_at: 'desc',
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
attempt_no: true,
|
||||
status: true,
|
||||
tax_id: true,
|
||||
error_message: true,
|
||||
sent_at: true,
|
||||
received_at: true,
|
||||
created_at: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
return ResponseMapper.single({
|
||||
...invoice,
|
||||
status: invoice.fiscal?.attempts?.[0]?.status || FiscalResponseStatus.NOT_SEND,
|
||||
})
|
||||
}
|
||||
|
||||
// async send(invoiceId: string, posInfo: IPosPayload) {
|
||||
@@ -83,7 +288,7 @@ export class SalesInvoicesService {
|
||||
// }
|
||||
|
||||
async create(data: CreateSalesInvoiceDto, posInfo: IPosPayload) {
|
||||
const { business_id, pos_id, consumer_account_id } = posInfo
|
||||
const { business_id, pos_id, consumer_account_id, complex_id } = posInfo
|
||||
const normalizedInvoiceDate = this.normalizeInvoiceDate(data.invoice_date)
|
||||
const { payments, terminalInfo } = this.buildPaymentsData(
|
||||
data.payments,
|
||||
@@ -101,6 +306,8 @@ export class SalesInvoicesService {
|
||||
normalizedInvoiceDate,
|
||||
invoiceNumber,
|
||||
consumer_account_id,
|
||||
businessId: business_id,
|
||||
complexId: complex_id,
|
||||
pos_id,
|
||||
goodsById,
|
||||
customerId: newCustomerId,
|
||||
@@ -156,6 +363,161 @@ export class SalesInvoicesService {
|
||||
)
|
||||
}
|
||||
|
||||
private buildFindAllWhere(posInfo: IPosPayload, query: SalesInvoicesFilterDto) {
|
||||
const where: Prisma.SalesInvoiceWhereInput = {
|
||||
pos: {
|
||||
complex: {
|
||||
business_activity_id: posInfo.business_id,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
if (query.code?.trim()) {
|
||||
where.code = {
|
||||
contains: query.code.trim(),
|
||||
}
|
||||
}
|
||||
|
||||
if (query.invoice_date_from || query.invoice_date_to) {
|
||||
where.invoice_date = {
|
||||
...(query.invoice_date_from ? { gte: new Date(query.invoice_date_from) } : {}),
|
||||
...(query.invoice_date_to ? { lte: new Date(query.invoice_date_to) } : {}),
|
||||
}
|
||||
}
|
||||
|
||||
if (query.created_at_from || query.created_at_to) {
|
||||
where.created_at = {
|
||||
...(query.created_at_from ? { gte: new Date(query.created_at_from) } : {}),
|
||||
...(query.created_at_to ? { lte: new Date(query.created_at_to) } : {}),
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
query.total_amount !== undefined ||
|
||||
query.total_amount_from !== undefined ||
|
||||
query.total_amount_to !== undefined
|
||||
) {
|
||||
where.total_amount = {
|
||||
...(query.total_amount !== undefined ? { equals: query.total_amount } : {}),
|
||||
...(query.total_amount_from !== undefined
|
||||
? { gte: query.total_amount_from }
|
||||
: {}),
|
||||
...(query.total_amount_to !== undefined ? { lte: query.total_amount_to } : {}),
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
query.customer_name?.trim() ||
|
||||
query.customer_mobile?.trim() ||
|
||||
query.customer_national_id?.trim() ||
|
||||
query.customer_economic_code?.trim()
|
||||
) {
|
||||
where.customer = {
|
||||
is: {
|
||||
OR: [
|
||||
...(query.customer_name?.trim()
|
||||
? [
|
||||
{
|
||||
individual: {
|
||||
is: {
|
||||
OR: [
|
||||
{
|
||||
first_name: {
|
||||
contains: query.customer_name.trim(),
|
||||
},
|
||||
},
|
||||
{
|
||||
last_name: {
|
||||
contains: query.customer_name.trim(),
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
legal: {
|
||||
is: {
|
||||
name: {
|
||||
contains: query.customer_name.trim(),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
]
|
||||
: []),
|
||||
...(query.customer_mobile?.trim()
|
||||
? [
|
||||
{
|
||||
individual: {
|
||||
is: {
|
||||
mobile_number: {
|
||||
contains: query.customer_mobile.trim(),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
]
|
||||
: []),
|
||||
...(query.customer_national_id?.trim()
|
||||
? [
|
||||
{
|
||||
individual: {
|
||||
is: {
|
||||
national_id: {
|
||||
contains: query.customer_national_id.trim(),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
]
|
||||
: []),
|
||||
...(query.customer_economic_code?.trim()
|
||||
? [
|
||||
{
|
||||
legal: {
|
||||
is: {
|
||||
OR: [
|
||||
{
|
||||
economic_code: {
|
||||
contains: query.customer_economic_code.trim(),
|
||||
},
|
||||
},
|
||||
{
|
||||
registration_number: {
|
||||
contains: query.customer_economic_code.trim(),
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
]
|
||||
: []),
|
||||
],
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
if (query.status) {
|
||||
if (query.status === FiscalResponseStatus.NOT_SEND) {
|
||||
where.fiscal = null
|
||||
} else {
|
||||
where.fiscal = {
|
||||
is: {
|
||||
attempts: {
|
||||
some: {
|
||||
status: query.status,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return where
|
||||
}
|
||||
|
||||
private normalizeInvoiceDate(invoiceDate: Date | string) {
|
||||
return new Date(invoiceDate).toISOString() as any
|
||||
}
|
||||
@@ -339,11 +701,21 @@ export class SalesInvoicesService {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
sku: true,
|
||||
sku: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
},
|
||||
},
|
||||
local_sku: true,
|
||||
barcode: true,
|
||||
pricing_model: true,
|
||||
unit_type: true,
|
||||
measure_unit: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
},
|
||||
},
|
||||
base_sale_price: true,
|
||||
image_url: true,
|
||||
category: {
|
||||
@@ -364,6 +736,8 @@ export class SalesInvoicesService {
|
||||
normalizedInvoiceDate: Date
|
||||
invoiceNumber: number
|
||||
consumer_account_id: string
|
||||
businessId: string
|
||||
complexId: string
|
||||
pos_id: string
|
||||
goodsById: Map<string, any>
|
||||
customerId: string | null
|
||||
@@ -376,6 +750,8 @@ export class SalesInvoicesService {
|
||||
pos_id,
|
||||
goodsById,
|
||||
customerId,
|
||||
businessId,
|
||||
complexId,
|
||||
} = params
|
||||
const { customer_id, customer_type, customer, payments, ...invoiceData } = data
|
||||
|
||||
@@ -384,7 +760,7 @@ export class SalesInvoicesService {
|
||||
invoice_date: normalizedInvoiceDate,
|
||||
invoice_number: invoiceNumber,
|
||||
total_amount: data.total_amount,
|
||||
code: 'INV-' + Date.now(),
|
||||
code: this.generateInvoiceCode(businessId, complexId, pos_id, invoiceNumber),
|
||||
items: {
|
||||
createMany: {
|
||||
data: data.items.map(item => ({
|
||||
@@ -392,6 +768,7 @@ export class SalesInvoicesService {
|
||||
quantity: item.quantity,
|
||||
unit_price: item.unit_price,
|
||||
total_amount: item.total_amount,
|
||||
measure_unit_text: item.unit_type,
|
||||
payload: item.payload ? JSON.parse(JSON.stringify(item.payload)) : undefined,
|
||||
good_snapshot: item.good_id
|
||||
? JSON.parse(
|
||||
@@ -483,4 +860,13 @@ export class SalesInvoicesService {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private generateInvoiceCode(
|
||||
business_id: string,
|
||||
complex_id: string,
|
||||
pos_id: string,
|
||||
invoice_number: number,
|
||||
) {
|
||||
return `${business_id.substring(0, 2)}-${complex_id.substring(0, 2)}-${pos_id.substring(0, 2)}-${invoice_number.toString()}`
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user