feat(inventories): add cardex retrieval for inventory and product

feat(pos): update sale invoice creation to include customer and item details
feat(pos): enhance POS account service to include today's sales information
feat(pos): refactor order DTO to create sale invoice with detailed item structure
feat(products): add minimum stock alert level to product creation and update DTOs
fix(triggers): implement stock validation and movement logging for sales invoice items
refactor(database): update sales invoices schema to include posAccountId and remove inventoryId
This commit is contained in:
2025-12-30 21:04:01 +03:30
parent 1bb206a608
commit eb6e0e7a0d
30 changed files with 1265 additions and 648 deletions
+89 -89
View File
@@ -30,14 +30,14 @@ export type SalesInvoiceAvgAggregateOutputType = {
id: number | null
totalAmount: runtime.Decimal | null
customerId: number | null
inventoryId: number | null
posAccountId: number | null
}
export type SalesInvoiceSumAggregateOutputType = {
id: number | null
totalAmount: runtime.Decimal | null
customerId: number | null
inventoryId: number | null
posAccountId: number | null
}
export type SalesInvoiceMinAggregateOutputType = {
@@ -48,7 +48,7 @@ export type SalesInvoiceMinAggregateOutputType = {
createdAt: Date | null
updatedAt: Date | null
customerId: number | null
inventoryId: number | null
posAccountId: number | null
}
export type SalesInvoiceMaxAggregateOutputType = {
@@ -59,7 +59,7 @@ export type SalesInvoiceMaxAggregateOutputType = {
createdAt: Date | null
updatedAt: Date | null
customerId: number | null
inventoryId: number | null
posAccountId: number | null
}
export type SalesInvoiceCountAggregateOutputType = {
@@ -70,7 +70,7 @@ export type SalesInvoiceCountAggregateOutputType = {
createdAt: number
updatedAt: number
customerId: number
inventoryId: number
posAccountId: number
_all: number
}
@@ -79,14 +79,14 @@ export type SalesInvoiceAvgAggregateInputType = {
id?: true
totalAmount?: true
customerId?: true
inventoryId?: true
posAccountId?: true
}
export type SalesInvoiceSumAggregateInputType = {
id?: true
totalAmount?: true
customerId?: true
inventoryId?: true
posAccountId?: true
}
export type SalesInvoiceMinAggregateInputType = {
@@ -97,7 +97,7 @@ export type SalesInvoiceMinAggregateInputType = {
createdAt?: true
updatedAt?: true
customerId?: true
inventoryId?: true
posAccountId?: true
}
export type SalesInvoiceMaxAggregateInputType = {
@@ -108,7 +108,7 @@ export type SalesInvoiceMaxAggregateInputType = {
createdAt?: true
updatedAt?: true
customerId?: true
inventoryId?: true
posAccountId?: true
}
export type SalesInvoiceCountAggregateInputType = {
@@ -119,7 +119,7 @@ export type SalesInvoiceCountAggregateInputType = {
createdAt?: true
updatedAt?: true
customerId?: true
inventoryId?: true
posAccountId?: true
_all?: true
}
@@ -217,7 +217,7 @@ export type SalesInvoiceGroupByOutputType = {
createdAt: Date
updatedAt: Date
customerId: number | null
inventoryId: number
posAccountId: number
_count: SalesInvoiceCountAggregateOutputType | null
_avg: SalesInvoiceAvgAggregateOutputType | null
_sum: SalesInvoiceSumAggregateOutputType | null
@@ -251,10 +251,10 @@ export type SalesInvoiceWhereInput = {
createdAt?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string
updatedAt?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string
customerId?: Prisma.IntNullableFilter<"SalesInvoice"> | number | null
inventoryId?: Prisma.IntFilter<"SalesInvoice"> | number
posAccountId?: Prisma.IntFilter<"SalesInvoice"> | number
items?: Prisma.SalesInvoiceItemListRelationFilter
customer?: Prisma.XOR<Prisma.CustomerNullableScalarRelationFilter, Prisma.CustomerWhereInput> | null
inventory?: Prisma.XOR<Prisma.InventoryScalarRelationFilter, Prisma.InventoryWhereInput>
posAccount?: Prisma.XOR<Prisma.PosAccountScalarRelationFilter, Prisma.PosAccountWhereInput>
}
export type SalesInvoiceOrderByWithRelationInput = {
@@ -265,10 +265,10 @@ export type SalesInvoiceOrderByWithRelationInput = {
createdAt?: Prisma.SortOrder
updatedAt?: Prisma.SortOrder
customerId?: Prisma.SortOrderInput | Prisma.SortOrder
inventoryId?: Prisma.SortOrder
posAccountId?: Prisma.SortOrder
items?: Prisma.SalesInvoiceItemOrderByRelationAggregateInput
customer?: Prisma.CustomerOrderByWithRelationInput
inventory?: Prisma.InventoryOrderByWithRelationInput
posAccount?: Prisma.PosAccountOrderByWithRelationInput
_relevance?: Prisma.SalesInvoiceOrderByRelevanceInput
}
@@ -283,10 +283,10 @@ export type SalesInvoiceWhereUniqueInput = Prisma.AtLeast<{
createdAt?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string
updatedAt?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string
customerId?: Prisma.IntNullableFilter<"SalesInvoice"> | number | null
inventoryId?: Prisma.IntFilter<"SalesInvoice"> | number
posAccountId?: Prisma.IntFilter<"SalesInvoice"> | number
items?: Prisma.SalesInvoiceItemListRelationFilter
customer?: Prisma.XOR<Prisma.CustomerNullableScalarRelationFilter, Prisma.CustomerWhereInput> | null
inventory?: Prisma.XOR<Prisma.InventoryScalarRelationFilter, Prisma.InventoryWhereInput>
posAccount?: Prisma.XOR<Prisma.PosAccountScalarRelationFilter, Prisma.PosAccountWhereInput>
}, "id" | "code">
export type SalesInvoiceOrderByWithAggregationInput = {
@@ -297,7 +297,7 @@ export type SalesInvoiceOrderByWithAggregationInput = {
createdAt?: Prisma.SortOrder
updatedAt?: Prisma.SortOrder
customerId?: Prisma.SortOrderInput | Prisma.SortOrder
inventoryId?: Prisma.SortOrder
posAccountId?: Prisma.SortOrder
_count?: Prisma.SalesInvoiceCountOrderByAggregateInput
_avg?: Prisma.SalesInvoiceAvgOrderByAggregateInput
_max?: Prisma.SalesInvoiceMaxOrderByAggregateInput
@@ -316,7 +316,7 @@ export type SalesInvoiceScalarWhereWithAggregatesInput = {
createdAt?: Prisma.DateTimeWithAggregatesFilter<"SalesInvoice"> | Date | string
updatedAt?: Prisma.DateTimeWithAggregatesFilter<"SalesInvoice"> | Date | string
customerId?: Prisma.IntNullableWithAggregatesFilter<"SalesInvoice"> | number | null
inventoryId?: Prisma.IntWithAggregatesFilter<"SalesInvoice"> | number
posAccountId?: Prisma.IntWithAggregatesFilter<"SalesInvoice"> | number
}
export type SalesInvoiceCreateInput = {
@@ -327,7 +327,7 @@ export type SalesInvoiceCreateInput = {
updatedAt?: Date | string
items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutInvoiceInput
customer?: Prisma.CustomerCreateNestedOneWithoutSalesInvoicesInput
inventory: Prisma.InventoryCreateNestedOneWithoutSalesInvoicesInput
posAccount: Prisma.PosAccountCreateNestedOneWithoutSalesInvoicesInput
}
export type SalesInvoiceUncheckedCreateInput = {
@@ -338,7 +338,7 @@ export type SalesInvoiceUncheckedCreateInput = {
createdAt?: Date | string
updatedAt?: Date | string
customerId?: number | null
inventoryId: number
posAccountId: number
items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutInvoiceInput
}
@@ -350,7 +350,7 @@ export type SalesInvoiceUpdateInput = {
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
items?: Prisma.SalesInvoiceItemUpdateManyWithoutInvoiceNestedInput
customer?: Prisma.CustomerUpdateOneWithoutSalesInvoicesNestedInput
inventory?: Prisma.InventoryUpdateOneRequiredWithoutSalesInvoicesNestedInput
posAccount?: Prisma.PosAccountUpdateOneRequiredWithoutSalesInvoicesNestedInput
}
export type SalesInvoiceUncheckedUpdateInput = {
@@ -361,7 +361,7 @@ export type SalesInvoiceUncheckedUpdateInput = {
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
customerId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
inventoryId?: Prisma.IntFieldUpdateOperationsInput | number
posAccountId?: Prisma.IntFieldUpdateOperationsInput | number
items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutInvoiceNestedInput
}
@@ -373,7 +373,7 @@ export type SalesInvoiceCreateManyInput = {
createdAt?: Date | string
updatedAt?: Date | string
customerId?: number | null
inventoryId: number
posAccountId: number
}
export type SalesInvoiceUpdateManyMutationInput = {
@@ -392,7 +392,7 @@ export type SalesInvoiceUncheckedUpdateManyInput = {
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
customerId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
inventoryId?: Prisma.IntFieldUpdateOperationsInput | number
posAccountId?: Prisma.IntFieldUpdateOperationsInput | number
}
export type SalesInvoiceListRelationFilter = {
@@ -419,14 +419,14 @@ export type SalesInvoiceCountOrderByAggregateInput = {
createdAt?: Prisma.SortOrder
updatedAt?: Prisma.SortOrder
customerId?: Prisma.SortOrder
inventoryId?: Prisma.SortOrder
posAccountId?: Prisma.SortOrder
}
export type SalesInvoiceAvgOrderByAggregateInput = {
id?: Prisma.SortOrder
totalAmount?: Prisma.SortOrder
customerId?: Prisma.SortOrder
inventoryId?: Prisma.SortOrder
posAccountId?: Prisma.SortOrder
}
export type SalesInvoiceMaxOrderByAggregateInput = {
@@ -437,7 +437,7 @@ export type SalesInvoiceMaxOrderByAggregateInput = {
createdAt?: Prisma.SortOrder
updatedAt?: Prisma.SortOrder
customerId?: Prisma.SortOrder
inventoryId?: Prisma.SortOrder
posAccountId?: Prisma.SortOrder
}
export type SalesInvoiceMinOrderByAggregateInput = {
@@ -448,14 +448,14 @@ export type SalesInvoiceMinOrderByAggregateInput = {
createdAt?: Prisma.SortOrder
updatedAt?: Prisma.SortOrder
customerId?: Prisma.SortOrder
inventoryId?: Prisma.SortOrder
posAccountId?: Prisma.SortOrder
}
export type SalesInvoiceSumOrderByAggregateInput = {
id?: Prisma.SortOrder
totalAmount?: Prisma.SortOrder
customerId?: Prisma.SortOrder
inventoryId?: Prisma.SortOrder
posAccountId?: Prisma.SortOrder
}
export type SalesInvoiceScalarRelationFilter = {
@@ -463,45 +463,45 @@ export type SalesInvoiceScalarRelationFilter = {
isNot?: Prisma.SalesInvoiceWhereInput
}
export type SalesInvoiceCreateNestedManyWithoutInventoryInput = {
create?: Prisma.XOR<Prisma.SalesInvoiceCreateWithoutInventoryInput, Prisma.SalesInvoiceUncheckedCreateWithoutInventoryInput> | Prisma.SalesInvoiceCreateWithoutInventoryInput[] | Prisma.SalesInvoiceUncheckedCreateWithoutInventoryInput[]
connectOrCreate?: Prisma.SalesInvoiceCreateOrConnectWithoutInventoryInput | Prisma.SalesInvoiceCreateOrConnectWithoutInventoryInput[]
createMany?: Prisma.SalesInvoiceCreateManyInventoryInputEnvelope
export type SalesInvoiceCreateNestedManyWithoutPosAccountInput = {
create?: Prisma.XOR<Prisma.SalesInvoiceCreateWithoutPosAccountInput, Prisma.SalesInvoiceUncheckedCreateWithoutPosAccountInput> | Prisma.SalesInvoiceCreateWithoutPosAccountInput[] | Prisma.SalesInvoiceUncheckedCreateWithoutPosAccountInput[]
connectOrCreate?: Prisma.SalesInvoiceCreateOrConnectWithoutPosAccountInput | Prisma.SalesInvoiceCreateOrConnectWithoutPosAccountInput[]
createMany?: Prisma.SalesInvoiceCreateManyPosAccountInputEnvelope
connect?: Prisma.SalesInvoiceWhereUniqueInput | Prisma.SalesInvoiceWhereUniqueInput[]
}
export type SalesInvoiceUncheckedCreateNestedManyWithoutInventoryInput = {
create?: Prisma.XOR<Prisma.SalesInvoiceCreateWithoutInventoryInput, Prisma.SalesInvoiceUncheckedCreateWithoutInventoryInput> | Prisma.SalesInvoiceCreateWithoutInventoryInput[] | Prisma.SalesInvoiceUncheckedCreateWithoutInventoryInput[]
connectOrCreate?: Prisma.SalesInvoiceCreateOrConnectWithoutInventoryInput | Prisma.SalesInvoiceCreateOrConnectWithoutInventoryInput[]
createMany?: Prisma.SalesInvoiceCreateManyInventoryInputEnvelope
export type SalesInvoiceUncheckedCreateNestedManyWithoutPosAccountInput = {
create?: Prisma.XOR<Prisma.SalesInvoiceCreateWithoutPosAccountInput, Prisma.SalesInvoiceUncheckedCreateWithoutPosAccountInput> | Prisma.SalesInvoiceCreateWithoutPosAccountInput[] | Prisma.SalesInvoiceUncheckedCreateWithoutPosAccountInput[]
connectOrCreate?: Prisma.SalesInvoiceCreateOrConnectWithoutPosAccountInput | Prisma.SalesInvoiceCreateOrConnectWithoutPosAccountInput[]
createMany?: Prisma.SalesInvoiceCreateManyPosAccountInputEnvelope
connect?: Prisma.SalesInvoiceWhereUniqueInput | Prisma.SalesInvoiceWhereUniqueInput[]
}
export type SalesInvoiceUpdateManyWithoutInventoryNestedInput = {
create?: Prisma.XOR<Prisma.SalesInvoiceCreateWithoutInventoryInput, Prisma.SalesInvoiceUncheckedCreateWithoutInventoryInput> | Prisma.SalesInvoiceCreateWithoutInventoryInput[] | Prisma.SalesInvoiceUncheckedCreateWithoutInventoryInput[]
connectOrCreate?: Prisma.SalesInvoiceCreateOrConnectWithoutInventoryInput | Prisma.SalesInvoiceCreateOrConnectWithoutInventoryInput[]
upsert?: Prisma.SalesInvoiceUpsertWithWhereUniqueWithoutInventoryInput | Prisma.SalesInvoiceUpsertWithWhereUniqueWithoutInventoryInput[]
createMany?: Prisma.SalesInvoiceCreateManyInventoryInputEnvelope
export type SalesInvoiceUpdateManyWithoutPosAccountNestedInput = {
create?: Prisma.XOR<Prisma.SalesInvoiceCreateWithoutPosAccountInput, Prisma.SalesInvoiceUncheckedCreateWithoutPosAccountInput> | Prisma.SalesInvoiceCreateWithoutPosAccountInput[] | Prisma.SalesInvoiceUncheckedCreateWithoutPosAccountInput[]
connectOrCreate?: Prisma.SalesInvoiceCreateOrConnectWithoutPosAccountInput | Prisma.SalesInvoiceCreateOrConnectWithoutPosAccountInput[]
upsert?: Prisma.SalesInvoiceUpsertWithWhereUniqueWithoutPosAccountInput | Prisma.SalesInvoiceUpsertWithWhereUniqueWithoutPosAccountInput[]
createMany?: Prisma.SalesInvoiceCreateManyPosAccountInputEnvelope
set?: Prisma.SalesInvoiceWhereUniqueInput | Prisma.SalesInvoiceWhereUniqueInput[]
disconnect?: Prisma.SalesInvoiceWhereUniqueInput | Prisma.SalesInvoiceWhereUniqueInput[]
delete?: Prisma.SalesInvoiceWhereUniqueInput | Prisma.SalesInvoiceWhereUniqueInput[]
connect?: Prisma.SalesInvoiceWhereUniqueInput | Prisma.SalesInvoiceWhereUniqueInput[]
update?: Prisma.SalesInvoiceUpdateWithWhereUniqueWithoutInventoryInput | Prisma.SalesInvoiceUpdateWithWhereUniqueWithoutInventoryInput[]
updateMany?: Prisma.SalesInvoiceUpdateManyWithWhereWithoutInventoryInput | Prisma.SalesInvoiceUpdateManyWithWhereWithoutInventoryInput[]
update?: Prisma.SalesInvoiceUpdateWithWhereUniqueWithoutPosAccountInput | Prisma.SalesInvoiceUpdateWithWhereUniqueWithoutPosAccountInput[]
updateMany?: Prisma.SalesInvoiceUpdateManyWithWhereWithoutPosAccountInput | Prisma.SalesInvoiceUpdateManyWithWhereWithoutPosAccountInput[]
deleteMany?: Prisma.SalesInvoiceScalarWhereInput | Prisma.SalesInvoiceScalarWhereInput[]
}
export type SalesInvoiceUncheckedUpdateManyWithoutInventoryNestedInput = {
create?: Prisma.XOR<Prisma.SalesInvoiceCreateWithoutInventoryInput, Prisma.SalesInvoiceUncheckedCreateWithoutInventoryInput> | Prisma.SalesInvoiceCreateWithoutInventoryInput[] | Prisma.SalesInvoiceUncheckedCreateWithoutInventoryInput[]
connectOrCreate?: Prisma.SalesInvoiceCreateOrConnectWithoutInventoryInput | Prisma.SalesInvoiceCreateOrConnectWithoutInventoryInput[]
upsert?: Prisma.SalesInvoiceUpsertWithWhereUniqueWithoutInventoryInput | Prisma.SalesInvoiceUpsertWithWhereUniqueWithoutInventoryInput[]
createMany?: Prisma.SalesInvoiceCreateManyInventoryInputEnvelope
export type SalesInvoiceUncheckedUpdateManyWithoutPosAccountNestedInput = {
create?: Prisma.XOR<Prisma.SalesInvoiceCreateWithoutPosAccountInput, Prisma.SalesInvoiceUncheckedCreateWithoutPosAccountInput> | Prisma.SalesInvoiceCreateWithoutPosAccountInput[] | Prisma.SalesInvoiceUncheckedCreateWithoutPosAccountInput[]
connectOrCreate?: Prisma.SalesInvoiceCreateOrConnectWithoutPosAccountInput | Prisma.SalesInvoiceCreateOrConnectWithoutPosAccountInput[]
upsert?: Prisma.SalesInvoiceUpsertWithWhereUniqueWithoutPosAccountInput | Prisma.SalesInvoiceUpsertWithWhereUniqueWithoutPosAccountInput[]
createMany?: Prisma.SalesInvoiceCreateManyPosAccountInputEnvelope
set?: Prisma.SalesInvoiceWhereUniqueInput | Prisma.SalesInvoiceWhereUniqueInput[]
disconnect?: Prisma.SalesInvoiceWhereUniqueInput | Prisma.SalesInvoiceWhereUniqueInput[]
delete?: Prisma.SalesInvoiceWhereUniqueInput | Prisma.SalesInvoiceWhereUniqueInput[]
connect?: Prisma.SalesInvoiceWhereUniqueInput | Prisma.SalesInvoiceWhereUniqueInput[]
update?: Prisma.SalesInvoiceUpdateWithWhereUniqueWithoutInventoryInput | Prisma.SalesInvoiceUpdateWithWhereUniqueWithoutInventoryInput[]
updateMany?: Prisma.SalesInvoiceUpdateManyWithWhereWithoutInventoryInput | Prisma.SalesInvoiceUpdateManyWithWhereWithoutInventoryInput[]
update?: Prisma.SalesInvoiceUpdateWithWhereUniqueWithoutPosAccountInput | Prisma.SalesInvoiceUpdateWithWhereUniqueWithoutPosAccountInput[]
updateMany?: Prisma.SalesInvoiceUpdateManyWithWhereWithoutPosAccountInput | Prisma.SalesInvoiceUpdateManyWithWhereWithoutPosAccountInput[]
deleteMany?: Prisma.SalesInvoiceScalarWhereInput | Prisma.SalesInvoiceScalarWhereInput[]
}
@@ -569,7 +569,7 @@ export type SalesInvoiceUpdateOneRequiredWithoutItemsNestedInput = {
update?: Prisma.XOR<Prisma.XOR<Prisma.SalesInvoiceUpdateToOneWithWhereWithoutItemsInput, Prisma.SalesInvoiceUpdateWithoutItemsInput>, Prisma.SalesInvoiceUncheckedUpdateWithoutItemsInput>
}
export type SalesInvoiceCreateWithoutInventoryInput = {
export type SalesInvoiceCreateWithoutPosAccountInput = {
code: string
totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string
description?: string | null
@@ -579,7 +579,7 @@ export type SalesInvoiceCreateWithoutInventoryInput = {
customer?: Prisma.CustomerCreateNestedOneWithoutSalesInvoicesInput
}
export type SalesInvoiceUncheckedCreateWithoutInventoryInput = {
export type SalesInvoiceUncheckedCreateWithoutPosAccountInput = {
id?: number
code: string
totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string
@@ -590,30 +590,30 @@ export type SalesInvoiceUncheckedCreateWithoutInventoryInput = {
items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutInvoiceInput
}
export type SalesInvoiceCreateOrConnectWithoutInventoryInput = {
export type SalesInvoiceCreateOrConnectWithoutPosAccountInput = {
where: Prisma.SalesInvoiceWhereUniqueInput
create: Prisma.XOR<Prisma.SalesInvoiceCreateWithoutInventoryInput, Prisma.SalesInvoiceUncheckedCreateWithoutInventoryInput>
create: Prisma.XOR<Prisma.SalesInvoiceCreateWithoutPosAccountInput, Prisma.SalesInvoiceUncheckedCreateWithoutPosAccountInput>
}
export type SalesInvoiceCreateManyInventoryInputEnvelope = {
data: Prisma.SalesInvoiceCreateManyInventoryInput | Prisma.SalesInvoiceCreateManyInventoryInput[]
export type SalesInvoiceCreateManyPosAccountInputEnvelope = {
data: Prisma.SalesInvoiceCreateManyPosAccountInput | Prisma.SalesInvoiceCreateManyPosAccountInput[]
skipDuplicates?: boolean
}
export type SalesInvoiceUpsertWithWhereUniqueWithoutInventoryInput = {
export type SalesInvoiceUpsertWithWhereUniqueWithoutPosAccountInput = {
where: Prisma.SalesInvoiceWhereUniqueInput
update: Prisma.XOR<Prisma.SalesInvoiceUpdateWithoutInventoryInput, Prisma.SalesInvoiceUncheckedUpdateWithoutInventoryInput>
create: Prisma.XOR<Prisma.SalesInvoiceCreateWithoutInventoryInput, Prisma.SalesInvoiceUncheckedCreateWithoutInventoryInput>
update: Prisma.XOR<Prisma.SalesInvoiceUpdateWithoutPosAccountInput, Prisma.SalesInvoiceUncheckedUpdateWithoutPosAccountInput>
create: Prisma.XOR<Prisma.SalesInvoiceCreateWithoutPosAccountInput, Prisma.SalesInvoiceUncheckedCreateWithoutPosAccountInput>
}
export type SalesInvoiceUpdateWithWhereUniqueWithoutInventoryInput = {
export type SalesInvoiceUpdateWithWhereUniqueWithoutPosAccountInput = {
where: Prisma.SalesInvoiceWhereUniqueInput
data: Prisma.XOR<Prisma.SalesInvoiceUpdateWithoutInventoryInput, Prisma.SalesInvoiceUncheckedUpdateWithoutInventoryInput>
data: Prisma.XOR<Prisma.SalesInvoiceUpdateWithoutPosAccountInput, Prisma.SalesInvoiceUncheckedUpdateWithoutPosAccountInput>
}
export type SalesInvoiceUpdateManyWithWhereWithoutInventoryInput = {
export type SalesInvoiceUpdateManyWithWhereWithoutPosAccountInput = {
where: Prisma.SalesInvoiceScalarWhereInput
data: Prisma.XOR<Prisma.SalesInvoiceUpdateManyMutationInput, Prisma.SalesInvoiceUncheckedUpdateManyWithoutInventoryInput>
data: Prisma.XOR<Prisma.SalesInvoiceUpdateManyMutationInput, Prisma.SalesInvoiceUncheckedUpdateManyWithoutPosAccountInput>
}
export type SalesInvoiceScalarWhereInput = {
@@ -627,7 +627,7 @@ export type SalesInvoiceScalarWhereInput = {
createdAt?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string
updatedAt?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string
customerId?: Prisma.IntNullableFilter<"SalesInvoice"> | number | null
inventoryId?: Prisma.IntFilter<"SalesInvoice"> | number
posAccountId?: Prisma.IntFilter<"SalesInvoice"> | number
}
export type SalesInvoiceCreateWithoutCustomerInput = {
@@ -637,7 +637,7 @@ export type SalesInvoiceCreateWithoutCustomerInput = {
createdAt?: Date | string
updatedAt?: Date | string
items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutInvoiceInput
inventory: Prisma.InventoryCreateNestedOneWithoutSalesInvoicesInput
posAccount: Prisma.PosAccountCreateNestedOneWithoutSalesInvoicesInput
}
export type SalesInvoiceUncheckedCreateWithoutCustomerInput = {
@@ -647,7 +647,7 @@ export type SalesInvoiceUncheckedCreateWithoutCustomerInput = {
description?: string | null
createdAt?: Date | string
updatedAt?: Date | string
inventoryId: number
posAccountId: number
items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutInvoiceInput
}
@@ -684,7 +684,7 @@ export type SalesInvoiceCreateWithoutItemsInput = {
createdAt?: Date | string
updatedAt?: Date | string
customer?: Prisma.CustomerCreateNestedOneWithoutSalesInvoicesInput
inventory: Prisma.InventoryCreateNestedOneWithoutSalesInvoicesInput
posAccount: Prisma.PosAccountCreateNestedOneWithoutSalesInvoicesInput
}
export type SalesInvoiceUncheckedCreateWithoutItemsInput = {
@@ -695,7 +695,7 @@ export type SalesInvoiceUncheckedCreateWithoutItemsInput = {
createdAt?: Date | string
updatedAt?: Date | string
customerId?: number | null
inventoryId: number
posAccountId: number
}
export type SalesInvoiceCreateOrConnectWithoutItemsInput = {
@@ -721,7 +721,7 @@ export type SalesInvoiceUpdateWithoutItemsInput = {
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
customer?: Prisma.CustomerUpdateOneWithoutSalesInvoicesNestedInput
inventory?: Prisma.InventoryUpdateOneRequiredWithoutSalesInvoicesNestedInput
posAccount?: Prisma.PosAccountUpdateOneRequiredWithoutSalesInvoicesNestedInput
}
export type SalesInvoiceUncheckedUpdateWithoutItemsInput = {
@@ -732,10 +732,10 @@ export type SalesInvoiceUncheckedUpdateWithoutItemsInput = {
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
customerId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
inventoryId?: Prisma.IntFieldUpdateOperationsInput | number
posAccountId?: Prisma.IntFieldUpdateOperationsInput | number
}
export type SalesInvoiceCreateManyInventoryInput = {
export type SalesInvoiceCreateManyPosAccountInput = {
id?: number
code: string
totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string
@@ -745,7 +745,7 @@ export type SalesInvoiceCreateManyInventoryInput = {
customerId?: number | null
}
export type SalesInvoiceUpdateWithoutInventoryInput = {
export type SalesInvoiceUpdateWithoutPosAccountInput = {
code?: Prisma.StringFieldUpdateOperationsInput | string
totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
@@ -755,7 +755,7 @@ export type SalesInvoiceUpdateWithoutInventoryInput = {
customer?: Prisma.CustomerUpdateOneWithoutSalesInvoicesNestedInput
}
export type SalesInvoiceUncheckedUpdateWithoutInventoryInput = {
export type SalesInvoiceUncheckedUpdateWithoutPosAccountInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number
code?: Prisma.StringFieldUpdateOperationsInput | string
totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
@@ -766,7 +766,7 @@ export type SalesInvoiceUncheckedUpdateWithoutInventoryInput = {
items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutInvoiceNestedInput
}
export type SalesInvoiceUncheckedUpdateManyWithoutInventoryInput = {
export type SalesInvoiceUncheckedUpdateManyWithoutPosAccountInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number
code?: Prisma.StringFieldUpdateOperationsInput | string
totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
@@ -783,7 +783,7 @@ export type SalesInvoiceCreateManyCustomerInput = {
description?: string | null
createdAt?: Date | string
updatedAt?: Date | string
inventoryId: number
posAccountId: number
}
export type SalesInvoiceUpdateWithoutCustomerInput = {
@@ -793,7 +793,7 @@ export type SalesInvoiceUpdateWithoutCustomerInput = {
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
items?: Prisma.SalesInvoiceItemUpdateManyWithoutInvoiceNestedInput
inventory?: Prisma.InventoryUpdateOneRequiredWithoutSalesInvoicesNestedInput
posAccount?: Prisma.PosAccountUpdateOneRequiredWithoutSalesInvoicesNestedInput
}
export type SalesInvoiceUncheckedUpdateWithoutCustomerInput = {
@@ -803,7 +803,7 @@ export type SalesInvoiceUncheckedUpdateWithoutCustomerInput = {
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
inventoryId?: Prisma.IntFieldUpdateOperationsInput | number
posAccountId?: Prisma.IntFieldUpdateOperationsInput | number
items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutInvoiceNestedInput
}
@@ -814,7 +814,7 @@ export type SalesInvoiceUncheckedUpdateManyWithoutCustomerInput = {
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
inventoryId?: Prisma.IntFieldUpdateOperationsInput | number
posAccountId?: Prisma.IntFieldUpdateOperationsInput | number
}
@@ -856,10 +856,10 @@ export type SalesInvoiceSelect<ExtArgs extends runtime.Types.Extensions.Internal
createdAt?: boolean
updatedAt?: boolean
customerId?: boolean
inventoryId?: boolean
posAccountId?: boolean
items?: boolean | Prisma.SalesInvoice$itemsArgs<ExtArgs>
customer?: boolean | Prisma.SalesInvoice$customerArgs<ExtArgs>
inventory?: boolean | Prisma.InventoryDefaultArgs<ExtArgs>
posAccount?: boolean | Prisma.PosAccountDefaultArgs<ExtArgs>
_count?: boolean | Prisma.SalesInvoiceCountOutputTypeDefaultArgs<ExtArgs>
}, ExtArgs["result"]["salesInvoice"]>
@@ -873,14 +873,14 @@ export type SalesInvoiceSelectScalar = {
createdAt?: boolean
updatedAt?: boolean
customerId?: boolean
inventoryId?: boolean
posAccountId?: boolean
}
export type SalesInvoiceOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "code" | "totalAmount" | "description" | "createdAt" | "updatedAt" | "customerId" | "inventoryId", ExtArgs["result"]["salesInvoice"]>
export type SalesInvoiceOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "code" | "totalAmount" | "description" | "createdAt" | "updatedAt" | "customerId" | "posAccountId", ExtArgs["result"]["salesInvoice"]>
export type SalesInvoiceInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
items?: boolean | Prisma.SalesInvoice$itemsArgs<ExtArgs>
customer?: boolean | Prisma.SalesInvoice$customerArgs<ExtArgs>
inventory?: boolean | Prisma.InventoryDefaultArgs<ExtArgs>
posAccount?: boolean | Prisma.PosAccountDefaultArgs<ExtArgs>
_count?: boolean | Prisma.SalesInvoiceCountOutputTypeDefaultArgs<ExtArgs>
}
@@ -889,7 +889,7 @@ export type $SalesInvoicePayload<ExtArgs extends runtime.Types.Extensions.Intern
objects: {
items: Prisma.$SalesInvoiceItemPayload<ExtArgs>[]
customer: Prisma.$CustomerPayload<ExtArgs> | null
inventory: Prisma.$InventoryPayload<ExtArgs>
posAccount: Prisma.$PosAccountPayload<ExtArgs>
}
scalars: runtime.Types.Extensions.GetPayloadResult<{
id: number
@@ -899,7 +899,7 @@ export type $SalesInvoicePayload<ExtArgs extends runtime.Types.Extensions.Intern
createdAt: Date
updatedAt: Date
customerId: number | null
inventoryId: number
posAccountId: number
}, ExtArgs["result"]["salesInvoice"]>
composites: {}
}
@@ -1242,7 +1242,7 @@ export interface Prisma__SalesInvoiceClient<T, Null = never, ExtArgs extends run
readonly [Symbol.toStringTag]: "PrismaPromise"
items<T extends Prisma.SalesInvoice$itemsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.SalesInvoice$itemsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$SalesInvoiceItemPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
customer<T extends Prisma.SalesInvoice$customerArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.SalesInvoice$customerArgs<ExtArgs>>): Prisma.Prisma__CustomerClient<runtime.Types.Result.GetResult<Prisma.$CustomerPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
inventory<T extends Prisma.InventoryDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.InventoryDefaultArgs<ExtArgs>>): Prisma.Prisma__InventoryClient<runtime.Types.Result.GetResult<Prisma.$InventoryPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
posAccount<T extends Prisma.PosAccountDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.PosAccountDefaultArgs<ExtArgs>>): Prisma.Prisma__PosAccountClient<runtime.Types.Result.GetResult<Prisma.$PosAccountPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
/**
* Attaches callbacks for the resolution and/or rejection of the Promise.
* @param onfulfilled The callback to execute when the Promise is resolved.
@@ -1279,7 +1279,7 @@ export interface SalesInvoiceFieldRefs {
readonly createdAt: Prisma.FieldRef<"SalesInvoice", 'DateTime'>
readonly updatedAt: Prisma.FieldRef<"SalesInvoice", 'DateTime'>
readonly customerId: Prisma.FieldRef<"SalesInvoice", 'Int'>
readonly inventoryId: Prisma.FieldRef<"SalesInvoice", 'Int'>
readonly posAccountId: Prisma.FieldRef<"SalesInvoice", 'Int'>
}