refactor: restructure suppliers module and update DTOs

- Removed old supplier DTOs and controller, replacing them with new implementations.
- Introduced new CreateSupplierDto and UpdateSupplierDto in the index directory.
- Updated SuppliersController to handle new routes and methods.
- Implemented SuppliersService with updated logic for creating, finding, updating, and removing suppliers.
- Added new invoices module with corresponding controller and service for handling invoice-related operations.
- Created new DTOs for handling receipt payments and updated the service to manage payment creation and retrieval.
- Updated Prisma migrations to reflect changes in the database schema, including dropping unnecessary columns.
This commit is contained in:
2025-12-27 20:34:00 +03:30
parent d98507fc1f
commit af9695e23c
27 changed files with 636 additions and 575 deletions
+3 -1
View File
@@ -11,6 +11,8 @@ import { BanksModule } from './modules/banks/banks.module'
import { CardexModule } from './modules/cardex/cardex.module'
import { InventoriesModule } from './modules/inventories/inventories.module'
import { PosModule } from './modules/pos/pos.module'
import { PurchaseReceiptPaymentsModule } from './modules/purchase-receipt-payments/purchase-receipt-payments.module'
import { SuppliersModule } from './modules/suppliers/suppliers.module'
import { PrismaModule } from './prisma/prisma.module'
import { ProductBrandsModule } from './product-brands/product-brands.module'
import { ProductCategoriesModule } from './product-categories/product-categories.module'
@@ -24,7 +26,6 @@ import { SalesInvoicesModule } from './sales-invoices/sales-invoices.module'
import { StockAdjustmentsModule } from './stock-adjustments/stock-adjustments.module'
import { StockBalanceModule } from './stock-balance/stock-balance.module'
import { StockMovementsModule } from './stock-movements/stock-movements.module'
import { SuppliersModule } from './suppliers/suppliers.module'
import { UsersModule } from './users/users.module'
@Module({
@@ -42,6 +43,7 @@ import { UsersModule } from './users/users.module'
InventoriesModule,
PurchaseReceiptsModule,
PurchaseReceiptItemsModule,
PurchaseReceiptPaymentsModule,
SalesInvoicesModule,
SalesInvoiceItemsModule,
InventoryTransfersModule,
File diff suppressed because one or more lines are too long
@@ -2695,10 +2695,10 @@ export const PurchaseReceiptItemScalarFieldEnum = {
count: 'count',
fee: 'fee',
total: 'total',
description: 'description',
createdAt: 'createdAt',
receiptId: 'receiptId',
productId: 'productId'
productId: 'productId',
description: 'description',
createdAt: 'createdAt'
} as const
export type PurchaseReceiptItemScalarFieldEnum = (typeof PurchaseReceiptItemScalarFieldEnum)[keyof typeof PurchaseReceiptItemScalarFieldEnum]
@@ -2710,10 +2710,9 @@ export const PurchaseReceiptPaymentsScalarFieldEnum = {
paymentMethod: 'paymentMethod',
type: 'type',
bankAccountId: 'bankAccountId',
inventoryId: 'inventoryId',
description: 'description',
payedAt: 'payedAt',
receiptId: 'receiptId',
payedAt: 'payedAt',
description: 'description',
createdAt: 'createdAt'
} as const
@@ -408,10 +408,10 @@ export const PurchaseReceiptItemScalarFieldEnum = {
count: 'count',
fee: 'fee',
total: 'total',
description: 'description',
createdAt: 'createdAt',
receiptId: 'receiptId',
productId: 'productId'
productId: 'productId',
description: 'description',
createdAt: 'createdAt'
} as const
export type PurchaseReceiptItemScalarFieldEnum = (typeof PurchaseReceiptItemScalarFieldEnum)[keyof typeof PurchaseReceiptItemScalarFieldEnum]
@@ -423,10 +423,9 @@ export const PurchaseReceiptPaymentsScalarFieldEnum = {
paymentMethod: 'paymentMethod',
type: 'type',
bankAccountId: 'bankAccountId',
inventoryId: 'inventoryId',
description: 'description',
payedAt: 'payedAt',
receiptId: 'receiptId',
payedAt: 'payedAt',
description: 'description',
createdAt: 'createdAt'
} as const
@@ -199,7 +199,6 @@ export type InventoryBankAccountWhereInput = {
inventory?: Prisma.XOR<Prisma.InventoryScalarRelationFilter, Prisma.InventoryWhereInput>
bankAccount?: Prisma.XOR<Prisma.BankAccountScalarRelationFilter, Prisma.BankAccountWhereInput>
posAccounts?: Prisma.PosAccountListRelationFilter
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsListRelationFilter
}
export type InventoryBankAccountOrderByWithRelationInput = {
@@ -208,7 +207,6 @@ export type InventoryBankAccountOrderByWithRelationInput = {
inventory?: Prisma.InventoryOrderByWithRelationInput
bankAccount?: Prisma.BankAccountOrderByWithRelationInput
posAccounts?: Prisma.PosAccountOrderByRelationAggregateInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsOrderByRelationAggregateInput
}
export type InventoryBankAccountWhereUniqueInput = Prisma.AtLeast<{
@@ -221,7 +219,6 @@ export type InventoryBankAccountWhereUniqueInput = Prisma.AtLeast<{
inventory?: Prisma.XOR<Prisma.InventoryScalarRelationFilter, Prisma.InventoryWhereInput>
bankAccount?: Prisma.XOR<Prisma.BankAccountScalarRelationFilter, Prisma.BankAccountWhereInput>
posAccounts?: Prisma.PosAccountListRelationFilter
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsListRelationFilter
}, "inventoryId_bankAccountId">
export type InventoryBankAccountOrderByWithAggregationInput = {
@@ -246,28 +243,24 @@ export type InventoryBankAccountCreateInput = {
inventory: Prisma.InventoryCreateNestedOneWithoutInventoryBankAccountsInput
bankAccount: Prisma.BankAccountCreateNestedOneWithoutInventoryBankAccountsInput
posAccounts?: Prisma.PosAccountCreateNestedManyWithoutInventoryBankAccountInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutInventoryBankAccountInput
}
export type InventoryBankAccountUncheckedCreateInput = {
inventoryId: number
bankAccountId: number
posAccounts?: Prisma.PosAccountUncheckedCreateNestedManyWithoutInventoryBankAccountInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutInventoryBankAccountInput
}
export type InventoryBankAccountUpdateInput = {
inventory?: Prisma.InventoryUpdateOneRequiredWithoutInventoryBankAccountsNestedInput
bankAccount?: Prisma.BankAccountUpdateOneRequiredWithoutInventoryBankAccountsNestedInput
posAccounts?: Prisma.PosAccountUpdateManyWithoutInventoryBankAccountNestedInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutInventoryBankAccountNestedInput
}
export type InventoryBankAccountUncheckedUpdateInput = {
inventoryId?: Prisma.IntFieldUpdateOperationsInput | number
bankAccountId?: Prisma.IntFieldUpdateOperationsInput | number
posAccounts?: Prisma.PosAccountUncheckedUpdateManyWithoutInventoryBankAccountNestedInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutInventoryBankAccountNestedInput
}
export type InventoryBankAccountCreateManyInput = {
@@ -427,30 +420,14 @@ export type InventoryBankAccountUpdateOneRequiredWithoutPosAccountsNestedInput =
update?: Prisma.XOR<Prisma.XOR<Prisma.InventoryBankAccountUpdateToOneWithWhereWithoutPosAccountsInput, Prisma.InventoryBankAccountUpdateWithoutPosAccountsInput>, Prisma.InventoryBankAccountUncheckedUpdateWithoutPosAccountsInput>
}
export type InventoryBankAccountCreateNestedOneWithoutPurchaseReceiptPaymentsInput = {
create?: Prisma.XOR<Prisma.InventoryBankAccountCreateWithoutPurchaseReceiptPaymentsInput, Prisma.InventoryBankAccountUncheckedCreateWithoutPurchaseReceiptPaymentsInput>
connectOrCreate?: Prisma.InventoryBankAccountCreateOrConnectWithoutPurchaseReceiptPaymentsInput
connect?: Prisma.InventoryBankAccountWhereUniqueInput
}
export type InventoryBankAccountUpdateOneRequiredWithoutPurchaseReceiptPaymentsNestedInput = {
create?: Prisma.XOR<Prisma.InventoryBankAccountCreateWithoutPurchaseReceiptPaymentsInput, Prisma.InventoryBankAccountUncheckedCreateWithoutPurchaseReceiptPaymentsInput>
connectOrCreate?: Prisma.InventoryBankAccountCreateOrConnectWithoutPurchaseReceiptPaymentsInput
upsert?: Prisma.InventoryBankAccountUpsertWithoutPurchaseReceiptPaymentsInput
connect?: Prisma.InventoryBankAccountWhereUniqueInput
update?: Prisma.XOR<Prisma.XOR<Prisma.InventoryBankAccountUpdateToOneWithWhereWithoutPurchaseReceiptPaymentsInput, Prisma.InventoryBankAccountUpdateWithoutPurchaseReceiptPaymentsInput>, Prisma.InventoryBankAccountUncheckedUpdateWithoutPurchaseReceiptPaymentsInput>
}
export type InventoryBankAccountCreateWithoutBankAccountInput = {
inventory: Prisma.InventoryCreateNestedOneWithoutInventoryBankAccountsInput
posAccounts?: Prisma.PosAccountCreateNestedManyWithoutInventoryBankAccountInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutInventoryBankAccountInput
}
export type InventoryBankAccountUncheckedCreateWithoutBankAccountInput = {
inventoryId: number
posAccounts?: Prisma.PosAccountUncheckedCreateNestedManyWithoutInventoryBankAccountInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutInventoryBankAccountInput
}
export type InventoryBankAccountCreateOrConnectWithoutBankAccountInput = {
@@ -490,13 +467,11 @@ export type InventoryBankAccountScalarWhereInput = {
export type InventoryBankAccountCreateWithoutInventoryInput = {
bankAccount: Prisma.BankAccountCreateNestedOneWithoutInventoryBankAccountsInput
posAccounts?: Prisma.PosAccountCreateNestedManyWithoutInventoryBankAccountInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutInventoryBankAccountInput
}
export type InventoryBankAccountUncheckedCreateWithoutInventoryInput = {
bankAccountId: number
posAccounts?: Prisma.PosAccountUncheckedCreateNestedManyWithoutInventoryBankAccountInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutInventoryBankAccountInput
}
export type InventoryBankAccountCreateOrConnectWithoutInventoryInput = {
@@ -528,13 +503,11 @@ export type InventoryBankAccountUpdateManyWithWhereWithoutInventoryInput = {
export type InventoryBankAccountCreateWithoutPosAccountsInput = {
inventory: Prisma.InventoryCreateNestedOneWithoutInventoryBankAccountsInput
bankAccount: Prisma.BankAccountCreateNestedOneWithoutInventoryBankAccountsInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutInventoryBankAccountInput
}
export type InventoryBankAccountUncheckedCreateWithoutPosAccountsInput = {
inventoryId: number
bankAccountId: number
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutInventoryBankAccountInput
}
export type InventoryBankAccountCreateOrConnectWithoutPosAccountsInput = {
@@ -556,53 +529,11 @@ export type InventoryBankAccountUpdateToOneWithWhereWithoutPosAccountsInput = {
export type InventoryBankAccountUpdateWithoutPosAccountsInput = {
inventory?: Prisma.InventoryUpdateOneRequiredWithoutInventoryBankAccountsNestedInput
bankAccount?: Prisma.BankAccountUpdateOneRequiredWithoutInventoryBankAccountsNestedInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutInventoryBankAccountNestedInput
}
export type InventoryBankAccountUncheckedUpdateWithoutPosAccountsInput = {
inventoryId?: Prisma.IntFieldUpdateOperationsInput | number
bankAccountId?: Prisma.IntFieldUpdateOperationsInput | number
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutInventoryBankAccountNestedInput
}
export type InventoryBankAccountCreateWithoutPurchaseReceiptPaymentsInput = {
inventory: Prisma.InventoryCreateNestedOneWithoutInventoryBankAccountsInput
bankAccount: Prisma.BankAccountCreateNestedOneWithoutInventoryBankAccountsInput
posAccounts?: Prisma.PosAccountCreateNestedManyWithoutInventoryBankAccountInput
}
export type InventoryBankAccountUncheckedCreateWithoutPurchaseReceiptPaymentsInput = {
inventoryId: number
bankAccountId: number
posAccounts?: Prisma.PosAccountUncheckedCreateNestedManyWithoutInventoryBankAccountInput
}
export type InventoryBankAccountCreateOrConnectWithoutPurchaseReceiptPaymentsInput = {
where: Prisma.InventoryBankAccountWhereUniqueInput
create: Prisma.XOR<Prisma.InventoryBankAccountCreateWithoutPurchaseReceiptPaymentsInput, Prisma.InventoryBankAccountUncheckedCreateWithoutPurchaseReceiptPaymentsInput>
}
export type InventoryBankAccountUpsertWithoutPurchaseReceiptPaymentsInput = {
update: Prisma.XOR<Prisma.InventoryBankAccountUpdateWithoutPurchaseReceiptPaymentsInput, Prisma.InventoryBankAccountUncheckedUpdateWithoutPurchaseReceiptPaymentsInput>
create: Prisma.XOR<Prisma.InventoryBankAccountCreateWithoutPurchaseReceiptPaymentsInput, Prisma.InventoryBankAccountUncheckedCreateWithoutPurchaseReceiptPaymentsInput>
where?: Prisma.InventoryBankAccountWhereInput
}
export type InventoryBankAccountUpdateToOneWithWhereWithoutPurchaseReceiptPaymentsInput = {
where?: Prisma.InventoryBankAccountWhereInput
data: Prisma.XOR<Prisma.InventoryBankAccountUpdateWithoutPurchaseReceiptPaymentsInput, Prisma.InventoryBankAccountUncheckedUpdateWithoutPurchaseReceiptPaymentsInput>
}
export type InventoryBankAccountUpdateWithoutPurchaseReceiptPaymentsInput = {
inventory?: Prisma.InventoryUpdateOneRequiredWithoutInventoryBankAccountsNestedInput
bankAccount?: Prisma.BankAccountUpdateOneRequiredWithoutInventoryBankAccountsNestedInput
posAccounts?: Prisma.PosAccountUpdateManyWithoutInventoryBankAccountNestedInput
}
export type InventoryBankAccountUncheckedUpdateWithoutPurchaseReceiptPaymentsInput = {
inventoryId?: Prisma.IntFieldUpdateOperationsInput | number
bankAccountId?: Prisma.IntFieldUpdateOperationsInput | number
posAccounts?: Prisma.PosAccountUncheckedUpdateManyWithoutInventoryBankAccountNestedInput
}
export type InventoryBankAccountCreateManyBankAccountInput = {
@@ -612,13 +543,11 @@ export type InventoryBankAccountCreateManyBankAccountInput = {
export type InventoryBankAccountUpdateWithoutBankAccountInput = {
inventory?: Prisma.InventoryUpdateOneRequiredWithoutInventoryBankAccountsNestedInput
posAccounts?: Prisma.PosAccountUpdateManyWithoutInventoryBankAccountNestedInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutInventoryBankAccountNestedInput
}
export type InventoryBankAccountUncheckedUpdateWithoutBankAccountInput = {
inventoryId?: Prisma.IntFieldUpdateOperationsInput | number
posAccounts?: Prisma.PosAccountUncheckedUpdateManyWithoutInventoryBankAccountNestedInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutInventoryBankAccountNestedInput
}
export type InventoryBankAccountUncheckedUpdateManyWithoutBankAccountInput = {
@@ -632,13 +561,11 @@ export type InventoryBankAccountCreateManyInventoryInput = {
export type InventoryBankAccountUpdateWithoutInventoryInput = {
bankAccount?: Prisma.BankAccountUpdateOneRequiredWithoutInventoryBankAccountsNestedInput
posAccounts?: Prisma.PosAccountUpdateManyWithoutInventoryBankAccountNestedInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutInventoryBankAccountNestedInput
}
export type InventoryBankAccountUncheckedUpdateWithoutInventoryInput = {
bankAccountId?: Prisma.IntFieldUpdateOperationsInput | number
posAccounts?: Prisma.PosAccountUncheckedUpdateManyWithoutInventoryBankAccountNestedInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutInventoryBankAccountNestedInput
}
export type InventoryBankAccountUncheckedUpdateManyWithoutInventoryInput = {
@@ -652,12 +579,10 @@ export type InventoryBankAccountUncheckedUpdateManyWithoutInventoryInput = {
export type InventoryBankAccountCountOutputType = {
posAccounts: number
purchaseReceiptPayments: number
}
export type InventoryBankAccountCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
posAccounts?: boolean | InventoryBankAccountCountOutputTypeCountPosAccountsArgs
purchaseReceiptPayments?: boolean | InventoryBankAccountCountOutputTypeCountPurchaseReceiptPaymentsArgs
}
/**
@@ -677,13 +602,6 @@ export type InventoryBankAccountCountOutputTypeCountPosAccountsArgs<ExtArgs exte
where?: Prisma.PosAccountWhereInput
}
/**
* InventoryBankAccountCountOutputType without action
*/
export type InventoryBankAccountCountOutputTypeCountPurchaseReceiptPaymentsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
where?: Prisma.PurchaseReceiptPaymentsWhereInput
}
export type InventoryBankAccountSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
inventoryId?: boolean
@@ -691,7 +609,6 @@ export type InventoryBankAccountSelect<ExtArgs extends runtime.Types.Extensions.
inventory?: boolean | Prisma.InventoryDefaultArgs<ExtArgs>
bankAccount?: boolean | Prisma.BankAccountDefaultArgs<ExtArgs>
posAccounts?: boolean | Prisma.InventoryBankAccount$posAccountsArgs<ExtArgs>
purchaseReceiptPayments?: boolean | Prisma.InventoryBankAccount$purchaseReceiptPaymentsArgs<ExtArgs>
_count?: boolean | Prisma.InventoryBankAccountCountOutputTypeDefaultArgs<ExtArgs>
}, ExtArgs["result"]["inventoryBankAccount"]>
@@ -707,7 +624,6 @@ export type InventoryBankAccountInclude<ExtArgs extends runtime.Types.Extensions
inventory?: boolean | Prisma.InventoryDefaultArgs<ExtArgs>
bankAccount?: boolean | Prisma.BankAccountDefaultArgs<ExtArgs>
posAccounts?: boolean | Prisma.InventoryBankAccount$posAccountsArgs<ExtArgs>
purchaseReceiptPayments?: boolean | Prisma.InventoryBankAccount$purchaseReceiptPaymentsArgs<ExtArgs>
_count?: boolean | Prisma.InventoryBankAccountCountOutputTypeDefaultArgs<ExtArgs>
}
@@ -717,7 +633,6 @@ export type $InventoryBankAccountPayload<ExtArgs extends runtime.Types.Extension
inventory: Prisma.$InventoryPayload<ExtArgs>
bankAccount: Prisma.$BankAccountPayload<ExtArgs>
posAccounts: Prisma.$PosAccountPayload<ExtArgs>[]
purchaseReceiptPayments: Prisma.$PurchaseReceiptPaymentsPayload<ExtArgs>[]
}
scalars: runtime.Types.Extensions.GetPayloadResult<{
inventoryId: number
@@ -1065,7 +980,6 @@ export interface Prisma__InventoryBankAccountClient<T, Null = never, ExtArgs ext
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>
bankAccount<T extends Prisma.BankAccountDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.BankAccountDefaultArgs<ExtArgs>>): Prisma.Prisma__BankAccountClient<runtime.Types.Result.GetResult<Prisma.$BankAccountPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
posAccounts<T extends Prisma.InventoryBankAccount$posAccountsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.InventoryBankAccount$posAccountsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$PosAccountPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
purchaseReceiptPayments<T extends Prisma.InventoryBankAccount$purchaseReceiptPaymentsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.InventoryBankAccount$purchaseReceiptPaymentsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$PurchaseReceiptPaymentsPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
/**
* Attaches callbacks for the resolution and/or rejection of the Promise.
* @param onfulfilled The callback to execute when the Promise is resolved.
@@ -1463,30 +1377,6 @@ export type InventoryBankAccount$posAccountsArgs<ExtArgs extends runtime.Types.E
distinct?: Prisma.PosAccountScalarFieldEnum | Prisma.PosAccountScalarFieldEnum[]
}
/**
* InventoryBankAccount.purchaseReceiptPayments
*/
export type InventoryBankAccount$purchaseReceiptPaymentsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* Select specific fields to fetch from the PurchaseReceiptPayments
*/
select?: Prisma.PurchaseReceiptPaymentsSelect<ExtArgs> | null
/**
* Omit specific fields from the PurchaseReceiptPayments
*/
omit?: Prisma.PurchaseReceiptPaymentsOmit<ExtArgs> | null
/**
* Choose, which related nodes to fetch as well
*/
include?: Prisma.PurchaseReceiptPaymentsInclude<ExtArgs> | null
where?: Prisma.PurchaseReceiptPaymentsWhereInput
orderBy?: Prisma.PurchaseReceiptPaymentsOrderByWithRelationInput | Prisma.PurchaseReceiptPaymentsOrderByWithRelationInput[]
cursor?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput
take?: number
skip?: number
distinct?: Prisma.PurchaseReceiptPaymentsScalarFieldEnum | Prisma.PurchaseReceiptPaymentsScalarFieldEnum[]
}
/**
* InventoryBankAccount without action
*/
+16 -16
View File
@@ -361,7 +361,7 @@ export type PurchaseReceiptCreateInput = {
items?: Prisma.PurchaseReceiptItemCreateNestedManyWithoutReceiptInput
inventory: Prisma.InventoryCreateNestedOneWithoutPurchaseReceiptsInput
supplier: Prisma.SupplierCreateNestedOneWithoutReceiptsInput
payments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutPurchaseReceiptInput
payments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutReceiptInput
}
export type PurchaseReceiptUncheckedCreateInput = {
@@ -376,7 +376,7 @@ export type PurchaseReceiptUncheckedCreateInput = {
supplierId: number
inventoryId: number
items?: Prisma.PurchaseReceiptItemUncheckedCreateNestedManyWithoutReceiptInput
payments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutPurchaseReceiptInput
payments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutReceiptInput
}
export type PurchaseReceiptUpdateInput = {
@@ -390,7 +390,7 @@ export type PurchaseReceiptUpdateInput = {
items?: Prisma.PurchaseReceiptItemUpdateManyWithoutReceiptNestedInput
inventory?: Prisma.InventoryUpdateOneRequiredWithoutPurchaseReceiptsNestedInput
supplier?: Prisma.SupplierUpdateOneRequiredWithoutReceiptsNestedInput
payments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutPurchaseReceiptNestedInput
payments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutReceiptNestedInput
}
export type PurchaseReceiptUncheckedUpdateInput = {
@@ -405,7 +405,7 @@ export type PurchaseReceiptUncheckedUpdateInput = {
supplierId?: Prisma.IntFieldUpdateOperationsInput | number
inventoryId?: Prisma.IntFieldUpdateOperationsInput | number
items?: Prisma.PurchaseReceiptItemUncheckedUpdateManyWithoutReceiptNestedInput
payments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutPurchaseReceiptNestedInput
payments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutReceiptNestedInput
}
export type PurchaseReceiptCreateManyInput = {
@@ -646,7 +646,7 @@ export type PurchaseReceiptCreateWithoutInventoryInput = {
status?: $Enums.PurchaseReceiptStatus
items?: Prisma.PurchaseReceiptItemCreateNestedManyWithoutReceiptInput
supplier: Prisma.SupplierCreateNestedOneWithoutReceiptsInput
payments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutPurchaseReceiptInput
payments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutReceiptInput
}
export type PurchaseReceiptUncheckedCreateWithoutInventoryInput = {
@@ -660,7 +660,7 @@ export type PurchaseReceiptUncheckedCreateWithoutInventoryInput = {
status?: $Enums.PurchaseReceiptStatus
supplierId: number
items?: Prisma.PurchaseReceiptItemUncheckedCreateNestedManyWithoutReceiptInput
payments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutPurchaseReceiptInput
payments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutReceiptInput
}
export type PurchaseReceiptCreateOrConnectWithoutInventoryInput = {
@@ -715,7 +715,7 @@ export type PurchaseReceiptCreateWithoutItemsInput = {
status?: $Enums.PurchaseReceiptStatus
inventory: Prisma.InventoryCreateNestedOneWithoutPurchaseReceiptsInput
supplier: Prisma.SupplierCreateNestedOneWithoutReceiptsInput
payments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutPurchaseReceiptInput
payments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutReceiptInput
}
export type PurchaseReceiptUncheckedCreateWithoutItemsInput = {
@@ -729,7 +729,7 @@ export type PurchaseReceiptUncheckedCreateWithoutItemsInput = {
status?: $Enums.PurchaseReceiptStatus
supplierId: number
inventoryId: number
payments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutPurchaseReceiptInput
payments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutReceiptInput
}
export type PurchaseReceiptCreateOrConnectWithoutItemsInput = {
@@ -758,7 +758,7 @@ export type PurchaseReceiptUpdateWithoutItemsInput = {
status?: Prisma.EnumPurchaseReceiptStatusFieldUpdateOperationsInput | $Enums.PurchaseReceiptStatus
inventory?: Prisma.InventoryUpdateOneRequiredWithoutPurchaseReceiptsNestedInput
supplier?: Prisma.SupplierUpdateOneRequiredWithoutReceiptsNestedInput
payments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutPurchaseReceiptNestedInput
payments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutReceiptNestedInput
}
export type PurchaseReceiptUncheckedUpdateWithoutItemsInput = {
@@ -772,7 +772,7 @@ export type PurchaseReceiptUncheckedUpdateWithoutItemsInput = {
status?: Prisma.EnumPurchaseReceiptStatusFieldUpdateOperationsInput | $Enums.PurchaseReceiptStatus
supplierId?: Prisma.IntFieldUpdateOperationsInput | number
inventoryId?: Prisma.IntFieldUpdateOperationsInput | number
payments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutPurchaseReceiptNestedInput
payments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutReceiptNestedInput
}
export type PurchaseReceiptCreateWithoutPaymentsInput = {
@@ -855,7 +855,7 @@ export type PurchaseReceiptCreateWithoutSupplierInput = {
status?: $Enums.PurchaseReceiptStatus
items?: Prisma.PurchaseReceiptItemCreateNestedManyWithoutReceiptInput
inventory: Prisma.InventoryCreateNestedOneWithoutPurchaseReceiptsInput
payments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutPurchaseReceiptInput
payments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutReceiptInput
}
export type PurchaseReceiptUncheckedCreateWithoutSupplierInput = {
@@ -869,7 +869,7 @@ export type PurchaseReceiptUncheckedCreateWithoutSupplierInput = {
status?: $Enums.PurchaseReceiptStatus
inventoryId: number
items?: Prisma.PurchaseReceiptItemUncheckedCreateNestedManyWithoutReceiptInput
payments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutPurchaseReceiptInput
payments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutReceiptInput
}
export type PurchaseReceiptCreateOrConnectWithoutSupplierInput = {
@@ -920,7 +920,7 @@ export type PurchaseReceiptUpdateWithoutInventoryInput = {
status?: Prisma.EnumPurchaseReceiptStatusFieldUpdateOperationsInput | $Enums.PurchaseReceiptStatus
items?: Prisma.PurchaseReceiptItemUpdateManyWithoutReceiptNestedInput
supplier?: Prisma.SupplierUpdateOneRequiredWithoutReceiptsNestedInput
payments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutPurchaseReceiptNestedInput
payments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutReceiptNestedInput
}
export type PurchaseReceiptUncheckedUpdateWithoutInventoryInput = {
@@ -934,7 +934,7 @@ export type PurchaseReceiptUncheckedUpdateWithoutInventoryInput = {
status?: Prisma.EnumPurchaseReceiptStatusFieldUpdateOperationsInput | $Enums.PurchaseReceiptStatus
supplierId?: Prisma.IntFieldUpdateOperationsInput | number
items?: Prisma.PurchaseReceiptItemUncheckedUpdateManyWithoutReceiptNestedInput
payments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutPurchaseReceiptNestedInput
payments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutReceiptNestedInput
}
export type PurchaseReceiptUncheckedUpdateManyWithoutInventoryInput = {
@@ -971,7 +971,7 @@ export type PurchaseReceiptUpdateWithoutSupplierInput = {
status?: Prisma.EnumPurchaseReceiptStatusFieldUpdateOperationsInput | $Enums.PurchaseReceiptStatus
items?: Prisma.PurchaseReceiptItemUpdateManyWithoutReceiptNestedInput
inventory?: Prisma.InventoryUpdateOneRequiredWithoutPurchaseReceiptsNestedInput
payments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutPurchaseReceiptNestedInput
payments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutReceiptNestedInput
}
export type PurchaseReceiptUncheckedUpdateWithoutSupplierInput = {
@@ -985,7 +985,7 @@ export type PurchaseReceiptUncheckedUpdateWithoutSupplierInput = {
status?: Prisma.EnumPurchaseReceiptStatusFieldUpdateOperationsInput | $Enums.PurchaseReceiptStatus
inventoryId?: Prisma.IntFieldUpdateOperationsInput | number
items?: Prisma.PurchaseReceiptItemUncheckedUpdateManyWithoutReceiptNestedInput
payments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutPurchaseReceiptNestedInput
payments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutReceiptNestedInput
}
export type PurchaseReceiptUncheckedUpdateManyWithoutSupplierInput = {
@@ -49,10 +49,10 @@ export type PurchaseReceiptItemMinAggregateOutputType = {
count: runtime.Decimal | null
fee: runtime.Decimal | null
total: runtime.Decimal | null
description: string | null
createdAt: Date | null
receiptId: number | null
productId: number | null
description: string | null
createdAt: Date | null
}
export type PurchaseReceiptItemMaxAggregateOutputType = {
@@ -60,10 +60,10 @@ export type PurchaseReceiptItemMaxAggregateOutputType = {
count: runtime.Decimal | null
fee: runtime.Decimal | null
total: runtime.Decimal | null
description: string | null
createdAt: Date | null
receiptId: number | null
productId: number | null
description: string | null
createdAt: Date | null
}
export type PurchaseReceiptItemCountAggregateOutputType = {
@@ -71,10 +71,10 @@ export type PurchaseReceiptItemCountAggregateOutputType = {
count: number
fee: number
total: number
description: number
createdAt: number
receiptId: number
productId: number
description: number
createdAt: number
_all: number
}
@@ -102,10 +102,10 @@ export type PurchaseReceiptItemMinAggregateInputType = {
count?: true
fee?: true
total?: true
description?: true
createdAt?: true
receiptId?: true
productId?: true
description?: true
createdAt?: true
}
export type PurchaseReceiptItemMaxAggregateInputType = {
@@ -113,10 +113,10 @@ export type PurchaseReceiptItemMaxAggregateInputType = {
count?: true
fee?: true
total?: true
description?: true
createdAt?: true
receiptId?: true
productId?: true
description?: true
createdAt?: true
}
export type PurchaseReceiptItemCountAggregateInputType = {
@@ -124,10 +124,10 @@ export type PurchaseReceiptItemCountAggregateInputType = {
count?: true
fee?: true
total?: true
description?: true
createdAt?: true
receiptId?: true
productId?: true
description?: true
createdAt?: true
_all?: true
}
@@ -222,10 +222,10 @@ export type PurchaseReceiptItemGroupByOutputType = {
count: runtime.Decimal
fee: runtime.Decimal
total: runtime.Decimal
description: string | null
createdAt: Date
receiptId: number
productId: number
description: string | null
createdAt: Date
_count: PurchaseReceiptItemCountAggregateOutputType | null
_avg: PurchaseReceiptItemAvgAggregateOutputType | null
_sum: PurchaseReceiptItemSumAggregateOutputType | null
@@ -256,10 +256,10 @@ export type PurchaseReceiptItemWhereInput = {
count?: Prisma.DecimalFilter<"PurchaseReceiptItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
fee?: Prisma.DecimalFilter<"PurchaseReceiptItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
total?: Prisma.DecimalFilter<"PurchaseReceiptItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
description?: Prisma.StringNullableFilter<"PurchaseReceiptItem"> | string | null
createdAt?: Prisma.DateTimeFilter<"PurchaseReceiptItem"> | Date | string
receiptId?: Prisma.IntFilter<"PurchaseReceiptItem"> | number
productId?: Prisma.IntFilter<"PurchaseReceiptItem"> | number
description?: Prisma.StringNullableFilter<"PurchaseReceiptItem"> | string | null
createdAt?: Prisma.DateTimeFilter<"PurchaseReceiptItem"> | Date | string
product?: Prisma.XOR<Prisma.ProductScalarRelationFilter, Prisma.ProductWhereInput>
receipt?: Prisma.XOR<Prisma.PurchaseReceiptScalarRelationFilter, Prisma.PurchaseReceiptWhereInput>
}
@@ -269,10 +269,10 @@ export type PurchaseReceiptItemOrderByWithRelationInput = {
count?: Prisma.SortOrder
fee?: Prisma.SortOrder
total?: Prisma.SortOrder
description?: Prisma.SortOrderInput | Prisma.SortOrder
createdAt?: Prisma.SortOrder
receiptId?: Prisma.SortOrder
productId?: Prisma.SortOrder
description?: Prisma.SortOrderInput | Prisma.SortOrder
createdAt?: Prisma.SortOrder
product?: Prisma.ProductOrderByWithRelationInput
receipt?: Prisma.PurchaseReceiptOrderByWithRelationInput
_relevance?: Prisma.PurchaseReceiptItemOrderByRelevanceInput
@@ -286,10 +286,10 @@ export type PurchaseReceiptItemWhereUniqueInput = Prisma.AtLeast<{
count?: Prisma.DecimalFilter<"PurchaseReceiptItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
fee?: Prisma.DecimalFilter<"PurchaseReceiptItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
total?: Prisma.DecimalFilter<"PurchaseReceiptItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
description?: Prisma.StringNullableFilter<"PurchaseReceiptItem"> | string | null
createdAt?: Prisma.DateTimeFilter<"PurchaseReceiptItem"> | Date | string
receiptId?: Prisma.IntFilter<"PurchaseReceiptItem"> | number
productId?: Prisma.IntFilter<"PurchaseReceiptItem"> | number
description?: Prisma.StringNullableFilter<"PurchaseReceiptItem"> | string | null
createdAt?: Prisma.DateTimeFilter<"PurchaseReceiptItem"> | Date | string
product?: Prisma.XOR<Prisma.ProductScalarRelationFilter, Prisma.ProductWhereInput>
receipt?: Prisma.XOR<Prisma.PurchaseReceiptScalarRelationFilter, Prisma.PurchaseReceiptWhereInput>
}, "id">
@@ -299,10 +299,10 @@ export type PurchaseReceiptItemOrderByWithAggregationInput = {
count?: Prisma.SortOrder
fee?: Prisma.SortOrder
total?: Prisma.SortOrder
description?: Prisma.SortOrderInput | Prisma.SortOrder
createdAt?: Prisma.SortOrder
receiptId?: Prisma.SortOrder
productId?: Prisma.SortOrder
description?: Prisma.SortOrderInput | Prisma.SortOrder
createdAt?: Prisma.SortOrder
_count?: Prisma.PurchaseReceiptItemCountOrderByAggregateInput
_avg?: Prisma.PurchaseReceiptItemAvgOrderByAggregateInput
_max?: Prisma.PurchaseReceiptItemMaxOrderByAggregateInput
@@ -318,10 +318,10 @@ export type PurchaseReceiptItemScalarWhereWithAggregatesInput = {
count?: Prisma.DecimalWithAggregatesFilter<"PurchaseReceiptItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
fee?: Prisma.DecimalWithAggregatesFilter<"PurchaseReceiptItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
total?: Prisma.DecimalWithAggregatesFilter<"PurchaseReceiptItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
description?: Prisma.StringNullableWithAggregatesFilter<"PurchaseReceiptItem"> | string | null
createdAt?: Prisma.DateTimeWithAggregatesFilter<"PurchaseReceiptItem"> | Date | string
receiptId?: Prisma.IntWithAggregatesFilter<"PurchaseReceiptItem"> | number
productId?: Prisma.IntWithAggregatesFilter<"PurchaseReceiptItem"> | number
description?: Prisma.StringNullableWithAggregatesFilter<"PurchaseReceiptItem"> | string | null
createdAt?: Prisma.DateTimeWithAggregatesFilter<"PurchaseReceiptItem"> | Date | string
}
export type PurchaseReceiptItemCreateInput = {
@@ -339,10 +339,10 @@ export type PurchaseReceiptItemUncheckedCreateInput = {
count: runtime.Decimal | runtime.DecimalJsLike | number | string
fee: runtime.Decimal | runtime.DecimalJsLike | number | string
total: runtime.Decimal | runtime.DecimalJsLike | number | string
description?: string | null
createdAt?: Date | string
receiptId: number
productId: number
description?: string | null
createdAt?: Date | string
}
export type PurchaseReceiptItemUpdateInput = {
@@ -360,10 +360,10 @@ export type PurchaseReceiptItemUncheckedUpdateInput = {
count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
total?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
receiptId?: Prisma.IntFieldUpdateOperationsInput | number
productId?: Prisma.IntFieldUpdateOperationsInput | number
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}
export type PurchaseReceiptItemCreateManyInput = {
@@ -371,10 +371,10 @@ export type PurchaseReceiptItemCreateManyInput = {
count: runtime.Decimal | runtime.DecimalJsLike | number | string
fee: runtime.Decimal | runtime.DecimalJsLike | number | string
total: runtime.Decimal | runtime.DecimalJsLike | number | string
description?: string | null
createdAt?: Date | string
receiptId: number
productId: number
description?: string | null
createdAt?: Date | string
}
export type PurchaseReceiptItemUpdateManyMutationInput = {
@@ -390,10 +390,10 @@ export type PurchaseReceiptItemUncheckedUpdateManyInput = {
count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
total?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
receiptId?: Prisma.IntFieldUpdateOperationsInput | number
productId?: Prisma.IntFieldUpdateOperationsInput | number
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}
export type PurchaseReceiptItemListRelationFilter = {
@@ -417,10 +417,10 @@ export type PurchaseReceiptItemCountOrderByAggregateInput = {
count?: Prisma.SortOrder
fee?: Prisma.SortOrder
total?: Prisma.SortOrder
description?: Prisma.SortOrder
createdAt?: Prisma.SortOrder
receiptId?: Prisma.SortOrder
productId?: Prisma.SortOrder
description?: Prisma.SortOrder
createdAt?: Prisma.SortOrder
}
export type PurchaseReceiptItemAvgOrderByAggregateInput = {
@@ -437,10 +437,10 @@ export type PurchaseReceiptItemMaxOrderByAggregateInput = {
count?: Prisma.SortOrder
fee?: Prisma.SortOrder
total?: Prisma.SortOrder
description?: Prisma.SortOrder
createdAt?: Prisma.SortOrder
receiptId?: Prisma.SortOrder
productId?: Prisma.SortOrder
description?: Prisma.SortOrder
createdAt?: Prisma.SortOrder
}
export type PurchaseReceiptItemMinOrderByAggregateInput = {
@@ -448,10 +448,10 @@ export type PurchaseReceiptItemMinOrderByAggregateInput = {
count?: Prisma.SortOrder
fee?: Prisma.SortOrder
total?: Prisma.SortOrder
description?: Prisma.SortOrder
createdAt?: Prisma.SortOrder
receiptId?: Prisma.SortOrder
productId?: Prisma.SortOrder
description?: Prisma.SortOrder
createdAt?: Prisma.SortOrder
}
export type PurchaseReceiptItemSumOrderByAggregateInput = {
@@ -561,9 +561,9 @@ export type PurchaseReceiptItemUncheckedCreateWithoutProductInput = {
count: runtime.Decimal | runtime.DecimalJsLike | number | string
fee: runtime.Decimal | runtime.DecimalJsLike | number | string
total: runtime.Decimal | runtime.DecimalJsLike | number | string
receiptId: number
description?: string | null
createdAt?: Date | string
receiptId: number
}
export type PurchaseReceiptItemCreateOrConnectWithoutProductInput = {
@@ -600,10 +600,10 @@ export type PurchaseReceiptItemScalarWhereInput = {
count?: Prisma.DecimalFilter<"PurchaseReceiptItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
fee?: Prisma.DecimalFilter<"PurchaseReceiptItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
total?: Prisma.DecimalFilter<"PurchaseReceiptItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
description?: Prisma.StringNullableFilter<"PurchaseReceiptItem"> | string | null
createdAt?: Prisma.DateTimeFilter<"PurchaseReceiptItem"> | Date | string
receiptId?: Prisma.IntFilter<"PurchaseReceiptItem"> | number
productId?: Prisma.IntFilter<"PurchaseReceiptItem"> | number
description?: Prisma.StringNullableFilter<"PurchaseReceiptItem"> | string | null
createdAt?: Prisma.DateTimeFilter<"PurchaseReceiptItem"> | Date | string
}
export type PurchaseReceiptItemCreateWithoutReceiptInput = {
@@ -620,9 +620,9 @@ export type PurchaseReceiptItemUncheckedCreateWithoutReceiptInput = {
count: runtime.Decimal | runtime.DecimalJsLike | number | string
fee: runtime.Decimal | runtime.DecimalJsLike | number | string
total: runtime.Decimal | runtime.DecimalJsLike | number | string
productId: number
description?: string | null
createdAt?: Date | string
productId: number
}
export type PurchaseReceiptItemCreateOrConnectWithoutReceiptInput = {
@@ -656,9 +656,9 @@ export type PurchaseReceiptItemCreateManyProductInput = {
count: runtime.Decimal | runtime.DecimalJsLike | number | string
fee: runtime.Decimal | runtime.DecimalJsLike | number | string
total: runtime.Decimal | runtime.DecimalJsLike | number | string
receiptId: number
description?: string | null
createdAt?: Date | string
receiptId: number
}
export type PurchaseReceiptItemUpdateWithoutProductInput = {
@@ -675,9 +675,9 @@ export type PurchaseReceiptItemUncheckedUpdateWithoutProductInput = {
count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
total?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
receiptId?: Prisma.IntFieldUpdateOperationsInput | number
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
receiptId?: Prisma.IntFieldUpdateOperationsInput | number
}
export type PurchaseReceiptItemUncheckedUpdateManyWithoutProductInput = {
@@ -685,9 +685,9 @@ export type PurchaseReceiptItemUncheckedUpdateManyWithoutProductInput = {
count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
total?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
receiptId?: Prisma.IntFieldUpdateOperationsInput | number
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
receiptId?: Prisma.IntFieldUpdateOperationsInput | number
}
export type PurchaseReceiptItemCreateManyReceiptInput = {
@@ -695,9 +695,9 @@ export type PurchaseReceiptItemCreateManyReceiptInput = {
count: runtime.Decimal | runtime.DecimalJsLike | number | string
fee: runtime.Decimal | runtime.DecimalJsLike | number | string
total: runtime.Decimal | runtime.DecimalJsLike | number | string
productId: number
description?: string | null
createdAt?: Date | string
productId: number
}
export type PurchaseReceiptItemUpdateWithoutReceiptInput = {
@@ -714,9 +714,9 @@ export type PurchaseReceiptItemUncheckedUpdateWithoutReceiptInput = {
count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
total?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
productId?: Prisma.IntFieldUpdateOperationsInput | number
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
productId?: Prisma.IntFieldUpdateOperationsInput | number
}
export type PurchaseReceiptItemUncheckedUpdateManyWithoutReceiptInput = {
@@ -724,9 +724,9 @@ export type PurchaseReceiptItemUncheckedUpdateManyWithoutReceiptInput = {
count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
total?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
productId?: Prisma.IntFieldUpdateOperationsInput | number
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
productId?: Prisma.IntFieldUpdateOperationsInput | number
}
@@ -736,10 +736,10 @@ export type PurchaseReceiptItemSelect<ExtArgs extends runtime.Types.Extensions.I
count?: boolean
fee?: boolean
total?: boolean
description?: boolean
createdAt?: boolean
receiptId?: boolean
productId?: boolean
description?: boolean
createdAt?: boolean
product?: boolean | Prisma.ProductDefaultArgs<ExtArgs>
receipt?: boolean | Prisma.PurchaseReceiptDefaultArgs<ExtArgs>
}, ExtArgs["result"]["purchaseReceiptItem"]>
@@ -751,13 +751,13 @@ export type PurchaseReceiptItemSelectScalar = {
count?: boolean
fee?: boolean
total?: boolean
description?: boolean
createdAt?: boolean
receiptId?: boolean
productId?: boolean
description?: boolean
createdAt?: boolean
}
export type PurchaseReceiptItemOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "count" | "fee" | "total" | "description" | "createdAt" | "receiptId" | "productId", ExtArgs["result"]["purchaseReceiptItem"]>
export type PurchaseReceiptItemOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "count" | "fee" | "total" | "receiptId" | "productId" | "description" | "createdAt", ExtArgs["result"]["purchaseReceiptItem"]>
export type PurchaseReceiptItemInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
product?: boolean | Prisma.ProductDefaultArgs<ExtArgs>
receipt?: boolean | Prisma.PurchaseReceiptDefaultArgs<ExtArgs>
@@ -774,10 +774,10 @@ export type $PurchaseReceiptItemPayload<ExtArgs extends runtime.Types.Extensions
count: runtime.Decimal
fee: runtime.Decimal
total: runtime.Decimal
description: string | null
createdAt: Date
receiptId: number
productId: number
description: string | null
createdAt: Date
}, ExtArgs["result"]["purchaseReceiptItem"]>
composites: {}
}
@@ -1153,10 +1153,10 @@ export interface PurchaseReceiptItemFieldRefs {
readonly count: Prisma.FieldRef<"PurchaseReceiptItem", 'Decimal'>
readonly fee: Prisma.FieldRef<"PurchaseReceiptItem", 'Decimal'>
readonly total: Prisma.FieldRef<"PurchaseReceiptItem", 'Decimal'>
readonly description: Prisma.FieldRef<"PurchaseReceiptItem", 'String'>
readonly createdAt: Prisma.FieldRef<"PurchaseReceiptItem", 'DateTime'>
readonly receiptId: Prisma.FieldRef<"PurchaseReceiptItem", 'Int'>
readonly productId: Prisma.FieldRef<"PurchaseReceiptItem", 'Int'>
readonly description: Prisma.FieldRef<"PurchaseReceiptItem", 'String'>
readonly createdAt: Prisma.FieldRef<"PurchaseReceiptItem", 'DateTime'>
}
@@ -30,7 +30,6 @@ export type PurchaseReceiptPaymentsAvgAggregateOutputType = {
id: number | null
amount: runtime.Decimal | null
bankAccountId: number | null
inventoryId: number | null
receiptId: number | null
}
@@ -38,7 +37,6 @@ export type PurchaseReceiptPaymentsSumAggregateOutputType = {
id: number | null
amount: runtime.Decimal | null
bankAccountId: number | null
inventoryId: number | null
receiptId: number | null
}
@@ -48,10 +46,9 @@ export type PurchaseReceiptPaymentsMinAggregateOutputType = {
paymentMethod: $Enums.PaymentMethodType | null
type: $Enums.PaymentType | null
bankAccountId: number | null
inventoryId: number | null
description: string | null
payedAt: Date | null
receiptId: number | null
payedAt: Date | null
description: string | null
createdAt: Date | null
}
@@ -61,10 +58,9 @@ export type PurchaseReceiptPaymentsMaxAggregateOutputType = {
paymentMethod: $Enums.PaymentMethodType | null
type: $Enums.PaymentType | null
bankAccountId: number | null
inventoryId: number | null
description: string | null
payedAt: Date | null
receiptId: number | null
payedAt: Date | null
description: string | null
createdAt: Date | null
}
@@ -74,10 +70,9 @@ export type PurchaseReceiptPaymentsCountAggregateOutputType = {
paymentMethod: number
type: number
bankAccountId: number
inventoryId: number
description: number
payedAt: number
receiptId: number
payedAt: number
description: number
createdAt: number
_all: number
}
@@ -87,7 +82,6 @@ export type PurchaseReceiptPaymentsAvgAggregateInputType = {
id?: true
amount?: true
bankAccountId?: true
inventoryId?: true
receiptId?: true
}
@@ -95,7 +89,6 @@ export type PurchaseReceiptPaymentsSumAggregateInputType = {
id?: true
amount?: true
bankAccountId?: true
inventoryId?: true
receiptId?: true
}
@@ -105,10 +98,9 @@ export type PurchaseReceiptPaymentsMinAggregateInputType = {
paymentMethod?: true
type?: true
bankAccountId?: true
inventoryId?: true
description?: true
payedAt?: true
receiptId?: true
payedAt?: true
description?: true
createdAt?: true
}
@@ -118,10 +110,9 @@ export type PurchaseReceiptPaymentsMaxAggregateInputType = {
paymentMethod?: true
type?: true
bankAccountId?: true
inventoryId?: true
description?: true
payedAt?: true
receiptId?: true
payedAt?: true
description?: true
createdAt?: true
}
@@ -131,10 +122,9 @@ export type PurchaseReceiptPaymentsCountAggregateInputType = {
paymentMethod?: true
type?: true
bankAccountId?: true
inventoryId?: true
description?: true
payedAt?: true
receiptId?: true
payedAt?: true
description?: true
createdAt?: true
_all?: true
}
@@ -231,10 +221,9 @@ export type PurchaseReceiptPaymentsGroupByOutputType = {
paymentMethod: $Enums.PaymentMethodType
type: $Enums.PaymentType
bankAccountId: number
inventoryId: number
description: string | null
payedAt: Date
receiptId: number
payedAt: Date
description: string | null
createdAt: Date
_count: PurchaseReceiptPaymentsCountAggregateOutputType | null
_avg: PurchaseReceiptPaymentsAvgAggregateOutputType | null
@@ -267,13 +256,11 @@ export type PurchaseReceiptPaymentsWhereInput = {
paymentMethod?: Prisma.EnumPaymentMethodTypeFilter<"PurchaseReceiptPayments"> | $Enums.PaymentMethodType
type?: Prisma.EnumPaymentTypeFilter<"PurchaseReceiptPayments"> | $Enums.PaymentType
bankAccountId?: Prisma.IntFilter<"PurchaseReceiptPayments"> | number
inventoryId?: Prisma.IntFilter<"PurchaseReceiptPayments"> | number
description?: Prisma.StringNullableFilter<"PurchaseReceiptPayments"> | string | null
payedAt?: Prisma.DateTimeFilter<"PurchaseReceiptPayments"> | Date | string
receiptId?: Prisma.IntFilter<"PurchaseReceiptPayments"> | number
payedAt?: Prisma.DateTimeFilter<"PurchaseReceiptPayments"> | Date | string
description?: Prisma.StringNullableFilter<"PurchaseReceiptPayments"> | string | null
createdAt?: Prisma.DateTimeFilter<"PurchaseReceiptPayments"> | Date | string
purchaseReceipt?: Prisma.XOR<Prisma.PurchaseReceiptScalarRelationFilter, Prisma.PurchaseReceiptWhereInput>
inventoryBankAccount?: Prisma.XOR<Prisma.InventoryBankAccountScalarRelationFilter, Prisma.InventoryBankAccountWhereInput>
receipt?: Prisma.XOR<Prisma.PurchaseReceiptScalarRelationFilter, Prisma.PurchaseReceiptWhereInput>
}
export type PurchaseReceiptPaymentsOrderByWithRelationInput = {
@@ -282,13 +269,11 @@ export type PurchaseReceiptPaymentsOrderByWithRelationInput = {
paymentMethod?: Prisma.SortOrder
type?: Prisma.SortOrder
bankAccountId?: Prisma.SortOrder
inventoryId?: Prisma.SortOrder
description?: Prisma.SortOrderInput | Prisma.SortOrder
payedAt?: Prisma.SortOrder
receiptId?: Prisma.SortOrder
payedAt?: Prisma.SortOrder
description?: Prisma.SortOrderInput | Prisma.SortOrder
createdAt?: Prisma.SortOrder
purchaseReceipt?: Prisma.PurchaseReceiptOrderByWithRelationInput
inventoryBankAccount?: Prisma.InventoryBankAccountOrderByWithRelationInput
receipt?: Prisma.PurchaseReceiptOrderByWithRelationInput
_relevance?: Prisma.PurchaseReceiptPaymentsOrderByRelevanceInput
}
@@ -301,13 +286,11 @@ export type PurchaseReceiptPaymentsWhereUniqueInput = Prisma.AtLeast<{
paymentMethod?: Prisma.EnumPaymentMethodTypeFilter<"PurchaseReceiptPayments"> | $Enums.PaymentMethodType
type?: Prisma.EnumPaymentTypeFilter<"PurchaseReceiptPayments"> | $Enums.PaymentType
bankAccountId?: Prisma.IntFilter<"PurchaseReceiptPayments"> | number
inventoryId?: Prisma.IntFilter<"PurchaseReceiptPayments"> | number
description?: Prisma.StringNullableFilter<"PurchaseReceiptPayments"> | string | null
payedAt?: Prisma.DateTimeFilter<"PurchaseReceiptPayments"> | Date | string
receiptId?: Prisma.IntFilter<"PurchaseReceiptPayments"> | number
payedAt?: Prisma.DateTimeFilter<"PurchaseReceiptPayments"> | Date | string
description?: Prisma.StringNullableFilter<"PurchaseReceiptPayments"> | string | null
createdAt?: Prisma.DateTimeFilter<"PurchaseReceiptPayments"> | Date | string
purchaseReceipt?: Prisma.XOR<Prisma.PurchaseReceiptScalarRelationFilter, Prisma.PurchaseReceiptWhereInput>
inventoryBankAccount?: Prisma.XOR<Prisma.InventoryBankAccountScalarRelationFilter, Prisma.InventoryBankAccountWhereInput>
receipt?: Prisma.XOR<Prisma.PurchaseReceiptScalarRelationFilter, Prisma.PurchaseReceiptWhereInput>
}, "id">
export type PurchaseReceiptPaymentsOrderByWithAggregationInput = {
@@ -316,10 +299,9 @@ export type PurchaseReceiptPaymentsOrderByWithAggregationInput = {
paymentMethod?: Prisma.SortOrder
type?: Prisma.SortOrder
bankAccountId?: Prisma.SortOrder
inventoryId?: Prisma.SortOrder
description?: Prisma.SortOrderInput | Prisma.SortOrder
payedAt?: Prisma.SortOrder
receiptId?: Prisma.SortOrder
payedAt?: Prisma.SortOrder
description?: Prisma.SortOrderInput | Prisma.SortOrder
createdAt?: Prisma.SortOrder
_count?: Prisma.PurchaseReceiptPaymentsCountOrderByAggregateInput
_avg?: Prisma.PurchaseReceiptPaymentsAvgOrderByAggregateInput
@@ -337,10 +319,9 @@ export type PurchaseReceiptPaymentsScalarWhereWithAggregatesInput = {
paymentMethod?: Prisma.EnumPaymentMethodTypeWithAggregatesFilter<"PurchaseReceiptPayments"> | $Enums.PaymentMethodType
type?: Prisma.EnumPaymentTypeWithAggregatesFilter<"PurchaseReceiptPayments"> | $Enums.PaymentType
bankAccountId?: Prisma.IntWithAggregatesFilter<"PurchaseReceiptPayments"> | number
inventoryId?: Prisma.IntWithAggregatesFilter<"PurchaseReceiptPayments"> | number
description?: Prisma.StringNullableWithAggregatesFilter<"PurchaseReceiptPayments"> | string | null
payedAt?: Prisma.DateTimeWithAggregatesFilter<"PurchaseReceiptPayments"> | Date | string
receiptId?: Prisma.IntWithAggregatesFilter<"PurchaseReceiptPayments"> | number
payedAt?: Prisma.DateTimeWithAggregatesFilter<"PurchaseReceiptPayments"> | Date | string
description?: Prisma.StringNullableWithAggregatesFilter<"PurchaseReceiptPayments"> | string | null
createdAt?: Prisma.DateTimeWithAggregatesFilter<"PurchaseReceiptPayments"> | Date | string
}
@@ -348,11 +329,11 @@ export type PurchaseReceiptPaymentsCreateInput = {
amount: runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod: $Enums.PaymentMethodType
type: $Enums.PaymentType
description?: string | null
bankAccountId: number
payedAt: Date | string
description?: string | null
createdAt?: Date | string
purchaseReceipt: Prisma.PurchaseReceiptCreateNestedOneWithoutPaymentsInput
inventoryBankAccount: Prisma.InventoryBankAccountCreateNestedOneWithoutPurchaseReceiptPaymentsInput
receipt: Prisma.PurchaseReceiptCreateNestedOneWithoutPaymentsInput
}
export type PurchaseReceiptPaymentsUncheckedCreateInput = {
@@ -361,10 +342,9 @@ export type PurchaseReceiptPaymentsUncheckedCreateInput = {
paymentMethod: $Enums.PaymentMethodType
type: $Enums.PaymentType
bankAccountId: number
inventoryId: number
description?: string | null
payedAt: Date | string
receiptId: number
payedAt: Date | string
description?: string | null
createdAt?: Date | string
}
@@ -372,11 +352,11 @@ export type PurchaseReceiptPaymentsUpdateInput = {
amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType
type?: Prisma.EnumPaymentTypeFieldUpdateOperationsInput | $Enums.PaymentType
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
bankAccountId?: Prisma.IntFieldUpdateOperationsInput | number
payedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
purchaseReceipt?: Prisma.PurchaseReceiptUpdateOneRequiredWithoutPaymentsNestedInput
inventoryBankAccount?: Prisma.InventoryBankAccountUpdateOneRequiredWithoutPurchaseReceiptPaymentsNestedInput
receipt?: Prisma.PurchaseReceiptUpdateOneRequiredWithoutPaymentsNestedInput
}
export type PurchaseReceiptPaymentsUncheckedUpdateInput = {
@@ -385,10 +365,9 @@ export type PurchaseReceiptPaymentsUncheckedUpdateInput = {
paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType
type?: Prisma.EnumPaymentTypeFieldUpdateOperationsInput | $Enums.PaymentType
bankAccountId?: Prisma.IntFieldUpdateOperationsInput | number
inventoryId?: Prisma.IntFieldUpdateOperationsInput | number
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
payedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
receiptId?: Prisma.IntFieldUpdateOperationsInput | number
payedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}
@@ -398,10 +377,9 @@ export type PurchaseReceiptPaymentsCreateManyInput = {
paymentMethod: $Enums.PaymentMethodType
type: $Enums.PaymentType
bankAccountId: number
inventoryId: number
description?: string | null
payedAt: Date | string
receiptId: number
payedAt: Date | string
description?: string | null
createdAt?: Date | string
}
@@ -409,8 +387,9 @@ export type PurchaseReceiptPaymentsUpdateManyMutationInput = {
amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType
type?: Prisma.EnumPaymentTypeFieldUpdateOperationsInput | $Enums.PaymentType
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
bankAccountId?: Prisma.IntFieldUpdateOperationsInput | number
payedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}
@@ -420,10 +399,9 @@ export type PurchaseReceiptPaymentsUncheckedUpdateManyInput = {
paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType
type?: Prisma.EnumPaymentTypeFieldUpdateOperationsInput | $Enums.PaymentType
bankAccountId?: Prisma.IntFieldUpdateOperationsInput | number
inventoryId?: Prisma.IntFieldUpdateOperationsInput | number
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
payedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
receiptId?: Prisma.IntFieldUpdateOperationsInput | number
payedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}
@@ -449,10 +427,9 @@ export type PurchaseReceiptPaymentsCountOrderByAggregateInput = {
paymentMethod?: Prisma.SortOrder
type?: Prisma.SortOrder
bankAccountId?: Prisma.SortOrder
inventoryId?: Prisma.SortOrder
description?: Prisma.SortOrder
payedAt?: Prisma.SortOrder
receiptId?: Prisma.SortOrder
payedAt?: Prisma.SortOrder
description?: Prisma.SortOrder
createdAt?: Prisma.SortOrder
}
@@ -460,7 +437,6 @@ export type PurchaseReceiptPaymentsAvgOrderByAggregateInput = {
id?: Prisma.SortOrder
amount?: Prisma.SortOrder
bankAccountId?: Prisma.SortOrder
inventoryId?: Prisma.SortOrder
receiptId?: Prisma.SortOrder
}
@@ -470,10 +446,9 @@ export type PurchaseReceiptPaymentsMaxOrderByAggregateInput = {
paymentMethod?: Prisma.SortOrder
type?: Prisma.SortOrder
bankAccountId?: Prisma.SortOrder
inventoryId?: Prisma.SortOrder
description?: Prisma.SortOrder
payedAt?: Prisma.SortOrder
receiptId?: Prisma.SortOrder
payedAt?: Prisma.SortOrder
description?: Prisma.SortOrder
createdAt?: Prisma.SortOrder
}
@@ -483,10 +458,9 @@ export type PurchaseReceiptPaymentsMinOrderByAggregateInput = {
paymentMethod?: Prisma.SortOrder
type?: Prisma.SortOrder
bankAccountId?: Prisma.SortOrder
inventoryId?: Prisma.SortOrder
description?: Prisma.SortOrder
payedAt?: Prisma.SortOrder
receiptId?: Prisma.SortOrder
payedAt?: Prisma.SortOrder
description?: Prisma.SortOrder
createdAt?: Prisma.SortOrder
}
@@ -494,91 +468,48 @@ export type PurchaseReceiptPaymentsSumOrderByAggregateInput = {
id?: Prisma.SortOrder
amount?: Prisma.SortOrder
bankAccountId?: Prisma.SortOrder
inventoryId?: Prisma.SortOrder
receiptId?: Prisma.SortOrder
}
export type PurchaseReceiptPaymentsCreateNestedManyWithoutInventoryBankAccountInput = {
create?: Prisma.XOR<Prisma.PurchaseReceiptPaymentsCreateWithoutInventoryBankAccountInput, Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutInventoryBankAccountInput> | Prisma.PurchaseReceiptPaymentsCreateWithoutInventoryBankAccountInput[] | Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutInventoryBankAccountInput[]
connectOrCreate?: Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutInventoryBankAccountInput | Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutInventoryBankAccountInput[]
createMany?: Prisma.PurchaseReceiptPaymentsCreateManyInventoryBankAccountInputEnvelope
export type PurchaseReceiptPaymentsCreateNestedManyWithoutReceiptInput = {
create?: Prisma.XOR<Prisma.PurchaseReceiptPaymentsCreateWithoutReceiptInput, Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutReceiptInput> | Prisma.PurchaseReceiptPaymentsCreateWithoutReceiptInput[] | Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutReceiptInput[]
connectOrCreate?: Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutReceiptInput | Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutReceiptInput[]
createMany?: Prisma.PurchaseReceiptPaymentsCreateManyReceiptInputEnvelope
connect?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput | Prisma.PurchaseReceiptPaymentsWhereUniqueInput[]
}
export type PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutInventoryBankAccountInput = {
create?: Prisma.XOR<Prisma.PurchaseReceiptPaymentsCreateWithoutInventoryBankAccountInput, Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutInventoryBankAccountInput> | Prisma.PurchaseReceiptPaymentsCreateWithoutInventoryBankAccountInput[] | Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutInventoryBankAccountInput[]
connectOrCreate?: Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutInventoryBankAccountInput | Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutInventoryBankAccountInput[]
createMany?: Prisma.PurchaseReceiptPaymentsCreateManyInventoryBankAccountInputEnvelope
export type PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutReceiptInput = {
create?: Prisma.XOR<Prisma.PurchaseReceiptPaymentsCreateWithoutReceiptInput, Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutReceiptInput> | Prisma.PurchaseReceiptPaymentsCreateWithoutReceiptInput[] | Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutReceiptInput[]
connectOrCreate?: Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutReceiptInput | Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutReceiptInput[]
createMany?: Prisma.PurchaseReceiptPaymentsCreateManyReceiptInputEnvelope
connect?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput | Prisma.PurchaseReceiptPaymentsWhereUniqueInput[]
}
export type PurchaseReceiptPaymentsUpdateManyWithoutInventoryBankAccountNestedInput = {
create?: Prisma.XOR<Prisma.PurchaseReceiptPaymentsCreateWithoutInventoryBankAccountInput, Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutInventoryBankAccountInput> | Prisma.PurchaseReceiptPaymentsCreateWithoutInventoryBankAccountInput[] | Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutInventoryBankAccountInput[]
connectOrCreate?: Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutInventoryBankAccountInput | Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutInventoryBankAccountInput[]
upsert?: Prisma.PurchaseReceiptPaymentsUpsertWithWhereUniqueWithoutInventoryBankAccountInput | Prisma.PurchaseReceiptPaymentsUpsertWithWhereUniqueWithoutInventoryBankAccountInput[]
createMany?: Prisma.PurchaseReceiptPaymentsCreateManyInventoryBankAccountInputEnvelope
export type PurchaseReceiptPaymentsUpdateManyWithoutReceiptNestedInput = {
create?: Prisma.XOR<Prisma.PurchaseReceiptPaymentsCreateWithoutReceiptInput, Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutReceiptInput> | Prisma.PurchaseReceiptPaymentsCreateWithoutReceiptInput[] | Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutReceiptInput[]
connectOrCreate?: Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutReceiptInput | Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutReceiptInput[]
upsert?: Prisma.PurchaseReceiptPaymentsUpsertWithWhereUniqueWithoutReceiptInput | Prisma.PurchaseReceiptPaymentsUpsertWithWhereUniqueWithoutReceiptInput[]
createMany?: Prisma.PurchaseReceiptPaymentsCreateManyReceiptInputEnvelope
set?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput | Prisma.PurchaseReceiptPaymentsWhereUniqueInput[]
disconnect?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput | Prisma.PurchaseReceiptPaymentsWhereUniqueInput[]
delete?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput | Prisma.PurchaseReceiptPaymentsWhereUniqueInput[]
connect?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput | Prisma.PurchaseReceiptPaymentsWhereUniqueInput[]
update?: Prisma.PurchaseReceiptPaymentsUpdateWithWhereUniqueWithoutInventoryBankAccountInput | Prisma.PurchaseReceiptPaymentsUpdateWithWhereUniqueWithoutInventoryBankAccountInput[]
updateMany?: Prisma.PurchaseReceiptPaymentsUpdateManyWithWhereWithoutInventoryBankAccountInput | Prisma.PurchaseReceiptPaymentsUpdateManyWithWhereWithoutInventoryBankAccountInput[]
update?: Prisma.PurchaseReceiptPaymentsUpdateWithWhereUniqueWithoutReceiptInput | Prisma.PurchaseReceiptPaymentsUpdateWithWhereUniqueWithoutReceiptInput[]
updateMany?: Prisma.PurchaseReceiptPaymentsUpdateManyWithWhereWithoutReceiptInput | Prisma.PurchaseReceiptPaymentsUpdateManyWithWhereWithoutReceiptInput[]
deleteMany?: Prisma.PurchaseReceiptPaymentsScalarWhereInput | Prisma.PurchaseReceiptPaymentsScalarWhereInput[]
}
export type PurchaseReceiptPaymentsUncheckedUpdateManyWithoutInventoryBankAccountNestedInput = {
create?: Prisma.XOR<Prisma.PurchaseReceiptPaymentsCreateWithoutInventoryBankAccountInput, Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutInventoryBankAccountInput> | Prisma.PurchaseReceiptPaymentsCreateWithoutInventoryBankAccountInput[] | Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutInventoryBankAccountInput[]
connectOrCreate?: Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutInventoryBankAccountInput | Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutInventoryBankAccountInput[]
upsert?: Prisma.PurchaseReceiptPaymentsUpsertWithWhereUniqueWithoutInventoryBankAccountInput | Prisma.PurchaseReceiptPaymentsUpsertWithWhereUniqueWithoutInventoryBankAccountInput[]
createMany?: Prisma.PurchaseReceiptPaymentsCreateManyInventoryBankAccountInputEnvelope
export type PurchaseReceiptPaymentsUncheckedUpdateManyWithoutReceiptNestedInput = {
create?: Prisma.XOR<Prisma.PurchaseReceiptPaymentsCreateWithoutReceiptInput, Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutReceiptInput> | Prisma.PurchaseReceiptPaymentsCreateWithoutReceiptInput[] | Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutReceiptInput[]
connectOrCreate?: Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutReceiptInput | Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutReceiptInput[]
upsert?: Prisma.PurchaseReceiptPaymentsUpsertWithWhereUniqueWithoutReceiptInput | Prisma.PurchaseReceiptPaymentsUpsertWithWhereUniqueWithoutReceiptInput[]
createMany?: Prisma.PurchaseReceiptPaymentsCreateManyReceiptInputEnvelope
set?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput | Prisma.PurchaseReceiptPaymentsWhereUniqueInput[]
disconnect?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput | Prisma.PurchaseReceiptPaymentsWhereUniqueInput[]
delete?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput | Prisma.PurchaseReceiptPaymentsWhereUniqueInput[]
connect?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput | Prisma.PurchaseReceiptPaymentsWhereUniqueInput[]
update?: Prisma.PurchaseReceiptPaymentsUpdateWithWhereUniqueWithoutInventoryBankAccountInput | Prisma.PurchaseReceiptPaymentsUpdateWithWhereUniqueWithoutInventoryBankAccountInput[]
updateMany?: Prisma.PurchaseReceiptPaymentsUpdateManyWithWhereWithoutInventoryBankAccountInput | Prisma.PurchaseReceiptPaymentsUpdateManyWithWhereWithoutInventoryBankAccountInput[]
deleteMany?: Prisma.PurchaseReceiptPaymentsScalarWhereInput | Prisma.PurchaseReceiptPaymentsScalarWhereInput[]
}
export type PurchaseReceiptPaymentsCreateNestedManyWithoutPurchaseReceiptInput = {
create?: Prisma.XOR<Prisma.PurchaseReceiptPaymentsCreateWithoutPurchaseReceiptInput, Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutPurchaseReceiptInput> | Prisma.PurchaseReceiptPaymentsCreateWithoutPurchaseReceiptInput[] | Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutPurchaseReceiptInput[]
connectOrCreate?: Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutPurchaseReceiptInput | Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutPurchaseReceiptInput[]
createMany?: Prisma.PurchaseReceiptPaymentsCreateManyPurchaseReceiptInputEnvelope
connect?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput | Prisma.PurchaseReceiptPaymentsWhereUniqueInput[]
}
export type PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutPurchaseReceiptInput = {
create?: Prisma.XOR<Prisma.PurchaseReceiptPaymentsCreateWithoutPurchaseReceiptInput, Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutPurchaseReceiptInput> | Prisma.PurchaseReceiptPaymentsCreateWithoutPurchaseReceiptInput[] | Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutPurchaseReceiptInput[]
connectOrCreate?: Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutPurchaseReceiptInput | Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutPurchaseReceiptInput[]
createMany?: Prisma.PurchaseReceiptPaymentsCreateManyPurchaseReceiptInputEnvelope
connect?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput | Prisma.PurchaseReceiptPaymentsWhereUniqueInput[]
}
export type PurchaseReceiptPaymentsUpdateManyWithoutPurchaseReceiptNestedInput = {
create?: Prisma.XOR<Prisma.PurchaseReceiptPaymentsCreateWithoutPurchaseReceiptInput, Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutPurchaseReceiptInput> | Prisma.PurchaseReceiptPaymentsCreateWithoutPurchaseReceiptInput[] | Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutPurchaseReceiptInput[]
connectOrCreate?: Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutPurchaseReceiptInput | Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutPurchaseReceiptInput[]
upsert?: Prisma.PurchaseReceiptPaymentsUpsertWithWhereUniqueWithoutPurchaseReceiptInput | Prisma.PurchaseReceiptPaymentsUpsertWithWhereUniqueWithoutPurchaseReceiptInput[]
createMany?: Prisma.PurchaseReceiptPaymentsCreateManyPurchaseReceiptInputEnvelope
set?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput | Prisma.PurchaseReceiptPaymentsWhereUniqueInput[]
disconnect?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput | Prisma.PurchaseReceiptPaymentsWhereUniqueInput[]
delete?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput | Prisma.PurchaseReceiptPaymentsWhereUniqueInput[]
connect?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput | Prisma.PurchaseReceiptPaymentsWhereUniqueInput[]
update?: Prisma.PurchaseReceiptPaymentsUpdateWithWhereUniqueWithoutPurchaseReceiptInput | Prisma.PurchaseReceiptPaymentsUpdateWithWhereUniqueWithoutPurchaseReceiptInput[]
updateMany?: Prisma.PurchaseReceiptPaymentsUpdateManyWithWhereWithoutPurchaseReceiptInput | Prisma.PurchaseReceiptPaymentsUpdateManyWithWhereWithoutPurchaseReceiptInput[]
deleteMany?: Prisma.PurchaseReceiptPaymentsScalarWhereInput | Prisma.PurchaseReceiptPaymentsScalarWhereInput[]
}
export type PurchaseReceiptPaymentsUncheckedUpdateManyWithoutPurchaseReceiptNestedInput = {
create?: Prisma.XOR<Prisma.PurchaseReceiptPaymentsCreateWithoutPurchaseReceiptInput, Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutPurchaseReceiptInput> | Prisma.PurchaseReceiptPaymentsCreateWithoutPurchaseReceiptInput[] | Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutPurchaseReceiptInput[]
connectOrCreate?: Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutPurchaseReceiptInput | Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutPurchaseReceiptInput[]
upsert?: Prisma.PurchaseReceiptPaymentsUpsertWithWhereUniqueWithoutPurchaseReceiptInput | Prisma.PurchaseReceiptPaymentsUpsertWithWhereUniqueWithoutPurchaseReceiptInput[]
createMany?: Prisma.PurchaseReceiptPaymentsCreateManyPurchaseReceiptInputEnvelope
set?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput | Prisma.PurchaseReceiptPaymentsWhereUniqueInput[]
disconnect?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput | Prisma.PurchaseReceiptPaymentsWhereUniqueInput[]
delete?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput | Prisma.PurchaseReceiptPaymentsWhereUniqueInput[]
connect?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput | Prisma.PurchaseReceiptPaymentsWhereUniqueInput[]
update?: Prisma.PurchaseReceiptPaymentsUpdateWithWhereUniqueWithoutPurchaseReceiptInput | Prisma.PurchaseReceiptPaymentsUpdateWithWhereUniqueWithoutPurchaseReceiptInput[]
updateMany?: Prisma.PurchaseReceiptPaymentsUpdateManyWithWhereWithoutPurchaseReceiptInput | Prisma.PurchaseReceiptPaymentsUpdateManyWithWhereWithoutPurchaseReceiptInput[]
update?: Prisma.PurchaseReceiptPaymentsUpdateWithWhereUniqueWithoutReceiptInput | Prisma.PurchaseReceiptPaymentsUpdateWithWhereUniqueWithoutReceiptInput[]
updateMany?: Prisma.PurchaseReceiptPaymentsUpdateManyWithWhereWithoutReceiptInput | Prisma.PurchaseReceiptPaymentsUpdateManyWithWhereWithoutReceiptInput[]
deleteMany?: Prisma.PurchaseReceiptPaymentsScalarWhereInput | Prisma.PurchaseReceiptPaymentsScalarWhereInput[]
}
@@ -586,51 +517,51 @@ export type EnumPaymentTypeFieldUpdateOperationsInput = {
set?: $Enums.PaymentType
}
export type PurchaseReceiptPaymentsCreateWithoutInventoryBankAccountInput = {
export type PurchaseReceiptPaymentsCreateWithoutReceiptInput = {
amount: runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod: $Enums.PaymentMethodType
type: $Enums.PaymentType
description?: string | null
bankAccountId: number
payedAt: Date | string
description?: string | null
createdAt?: Date | string
purchaseReceipt: Prisma.PurchaseReceiptCreateNestedOneWithoutPaymentsInput
}
export type PurchaseReceiptPaymentsUncheckedCreateWithoutInventoryBankAccountInput = {
export type PurchaseReceiptPaymentsUncheckedCreateWithoutReceiptInput = {
id?: number
amount: runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod: $Enums.PaymentMethodType
type: $Enums.PaymentType
description?: string | null
bankAccountId: number
payedAt: Date | string
receiptId: number
description?: string | null
createdAt?: Date | string
}
export type PurchaseReceiptPaymentsCreateOrConnectWithoutInventoryBankAccountInput = {
export type PurchaseReceiptPaymentsCreateOrConnectWithoutReceiptInput = {
where: Prisma.PurchaseReceiptPaymentsWhereUniqueInput
create: Prisma.XOR<Prisma.PurchaseReceiptPaymentsCreateWithoutInventoryBankAccountInput, Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutInventoryBankAccountInput>
create: Prisma.XOR<Prisma.PurchaseReceiptPaymentsCreateWithoutReceiptInput, Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutReceiptInput>
}
export type PurchaseReceiptPaymentsCreateManyInventoryBankAccountInputEnvelope = {
data: Prisma.PurchaseReceiptPaymentsCreateManyInventoryBankAccountInput | Prisma.PurchaseReceiptPaymentsCreateManyInventoryBankAccountInput[]
export type PurchaseReceiptPaymentsCreateManyReceiptInputEnvelope = {
data: Prisma.PurchaseReceiptPaymentsCreateManyReceiptInput | Prisma.PurchaseReceiptPaymentsCreateManyReceiptInput[]
skipDuplicates?: boolean
}
export type PurchaseReceiptPaymentsUpsertWithWhereUniqueWithoutInventoryBankAccountInput = {
export type PurchaseReceiptPaymentsUpsertWithWhereUniqueWithoutReceiptInput = {
where: Prisma.PurchaseReceiptPaymentsWhereUniqueInput
update: Prisma.XOR<Prisma.PurchaseReceiptPaymentsUpdateWithoutInventoryBankAccountInput, Prisma.PurchaseReceiptPaymentsUncheckedUpdateWithoutInventoryBankAccountInput>
create: Prisma.XOR<Prisma.PurchaseReceiptPaymentsCreateWithoutInventoryBankAccountInput, Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutInventoryBankAccountInput>
update: Prisma.XOR<Prisma.PurchaseReceiptPaymentsUpdateWithoutReceiptInput, Prisma.PurchaseReceiptPaymentsUncheckedUpdateWithoutReceiptInput>
create: Prisma.XOR<Prisma.PurchaseReceiptPaymentsCreateWithoutReceiptInput, Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutReceiptInput>
}
export type PurchaseReceiptPaymentsUpdateWithWhereUniqueWithoutInventoryBankAccountInput = {
export type PurchaseReceiptPaymentsUpdateWithWhereUniqueWithoutReceiptInput = {
where: Prisma.PurchaseReceiptPaymentsWhereUniqueInput
data: Prisma.XOR<Prisma.PurchaseReceiptPaymentsUpdateWithoutInventoryBankAccountInput, Prisma.PurchaseReceiptPaymentsUncheckedUpdateWithoutInventoryBankAccountInput>
data: Prisma.XOR<Prisma.PurchaseReceiptPaymentsUpdateWithoutReceiptInput, Prisma.PurchaseReceiptPaymentsUncheckedUpdateWithoutReceiptInput>
}
export type PurchaseReceiptPaymentsUpdateManyWithWhereWithoutInventoryBankAccountInput = {
export type PurchaseReceiptPaymentsUpdateManyWithWhereWithoutReceiptInput = {
where: Prisma.PurchaseReceiptPaymentsScalarWhereInput
data: Prisma.XOR<Prisma.PurchaseReceiptPaymentsUpdateManyMutationInput, Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutInventoryBankAccountInput>
data: Prisma.XOR<Prisma.PurchaseReceiptPaymentsUpdateManyMutationInput, Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutReceiptInput>
}
export type PurchaseReceiptPaymentsScalarWhereInput = {
@@ -642,147 +573,52 @@ export type PurchaseReceiptPaymentsScalarWhereInput = {
paymentMethod?: Prisma.EnumPaymentMethodTypeFilter<"PurchaseReceiptPayments"> | $Enums.PaymentMethodType
type?: Prisma.EnumPaymentTypeFilter<"PurchaseReceiptPayments"> | $Enums.PaymentType
bankAccountId?: Prisma.IntFilter<"PurchaseReceiptPayments"> | number
inventoryId?: Prisma.IntFilter<"PurchaseReceiptPayments"> | number
description?: Prisma.StringNullableFilter<"PurchaseReceiptPayments"> | string | null
payedAt?: Prisma.DateTimeFilter<"PurchaseReceiptPayments"> | Date | string
receiptId?: Prisma.IntFilter<"PurchaseReceiptPayments"> | number
payedAt?: Prisma.DateTimeFilter<"PurchaseReceiptPayments"> | Date | string
description?: Prisma.StringNullableFilter<"PurchaseReceiptPayments"> | string | null
createdAt?: Prisma.DateTimeFilter<"PurchaseReceiptPayments"> | Date | string
}
export type PurchaseReceiptPaymentsCreateWithoutPurchaseReceiptInput = {
amount: runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod: $Enums.PaymentMethodType
type: $Enums.PaymentType
description?: string | null
payedAt: Date | string
createdAt?: Date | string
inventoryBankAccount: Prisma.InventoryBankAccountCreateNestedOneWithoutPurchaseReceiptPaymentsInput
}
export type PurchaseReceiptPaymentsUncheckedCreateWithoutPurchaseReceiptInput = {
export type PurchaseReceiptPaymentsCreateManyReceiptInput = {
id?: number
amount: runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod: $Enums.PaymentMethodType
type: $Enums.PaymentType
bankAccountId: number
inventoryId: number
description?: string | null
payedAt: Date | string
description?: string | null
createdAt?: Date | string
}
export type PurchaseReceiptPaymentsCreateOrConnectWithoutPurchaseReceiptInput = {
where: Prisma.PurchaseReceiptPaymentsWhereUniqueInput
create: Prisma.XOR<Prisma.PurchaseReceiptPaymentsCreateWithoutPurchaseReceiptInput, Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutPurchaseReceiptInput>
}
export type PurchaseReceiptPaymentsCreateManyPurchaseReceiptInputEnvelope = {
data: Prisma.PurchaseReceiptPaymentsCreateManyPurchaseReceiptInput | Prisma.PurchaseReceiptPaymentsCreateManyPurchaseReceiptInput[]
skipDuplicates?: boolean
}
export type PurchaseReceiptPaymentsUpsertWithWhereUniqueWithoutPurchaseReceiptInput = {
where: Prisma.PurchaseReceiptPaymentsWhereUniqueInput
update: Prisma.XOR<Prisma.PurchaseReceiptPaymentsUpdateWithoutPurchaseReceiptInput, Prisma.PurchaseReceiptPaymentsUncheckedUpdateWithoutPurchaseReceiptInput>
create: Prisma.XOR<Prisma.PurchaseReceiptPaymentsCreateWithoutPurchaseReceiptInput, Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutPurchaseReceiptInput>
}
export type PurchaseReceiptPaymentsUpdateWithWhereUniqueWithoutPurchaseReceiptInput = {
where: Prisma.PurchaseReceiptPaymentsWhereUniqueInput
data: Prisma.XOR<Prisma.PurchaseReceiptPaymentsUpdateWithoutPurchaseReceiptInput, Prisma.PurchaseReceiptPaymentsUncheckedUpdateWithoutPurchaseReceiptInput>
}
export type PurchaseReceiptPaymentsUpdateManyWithWhereWithoutPurchaseReceiptInput = {
where: Prisma.PurchaseReceiptPaymentsScalarWhereInput
data: Prisma.XOR<Prisma.PurchaseReceiptPaymentsUpdateManyMutationInput, Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutPurchaseReceiptInput>
}
export type PurchaseReceiptPaymentsCreateManyInventoryBankAccountInput = {
id?: number
amount: runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod: $Enums.PaymentMethodType
type: $Enums.PaymentType
description?: string | null
payedAt: Date | string
receiptId: number
createdAt?: Date | string
}
export type PurchaseReceiptPaymentsUpdateWithoutInventoryBankAccountInput = {
export type PurchaseReceiptPaymentsUpdateWithoutReceiptInput = {
amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType
type?: Prisma.EnumPaymentTypeFieldUpdateOperationsInput | $Enums.PaymentType
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
bankAccountId?: Prisma.IntFieldUpdateOperationsInput | number
payedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
purchaseReceipt?: Prisma.PurchaseReceiptUpdateOneRequiredWithoutPaymentsNestedInput
}
export type PurchaseReceiptPaymentsUncheckedUpdateWithoutInventoryBankAccountInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number
amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType
type?: Prisma.EnumPaymentTypeFieldUpdateOperationsInput | $Enums.PaymentType
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
payedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
receiptId?: Prisma.IntFieldUpdateOperationsInput | number
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}
export type PurchaseReceiptPaymentsUncheckedUpdateManyWithoutInventoryBankAccountInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number
amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType
type?: Prisma.EnumPaymentTypeFieldUpdateOperationsInput | $Enums.PaymentType
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
payedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
receiptId?: Prisma.IntFieldUpdateOperationsInput | number
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}
export type PurchaseReceiptPaymentsCreateManyPurchaseReceiptInput = {
id?: number
amount: runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod: $Enums.PaymentMethodType
type: $Enums.PaymentType
bankAccountId: number
inventoryId: number
description?: string | null
payedAt: Date | string
createdAt?: Date | string
}
export type PurchaseReceiptPaymentsUpdateWithoutPurchaseReceiptInput = {
amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType
type?: Prisma.EnumPaymentTypeFieldUpdateOperationsInput | $Enums.PaymentType
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
payedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
inventoryBankAccount?: Prisma.InventoryBankAccountUpdateOneRequiredWithoutPurchaseReceiptPaymentsNestedInput
}
export type PurchaseReceiptPaymentsUncheckedUpdateWithoutPurchaseReceiptInput = {
export type PurchaseReceiptPaymentsUncheckedUpdateWithoutReceiptInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number
amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType
type?: Prisma.EnumPaymentTypeFieldUpdateOperationsInput | $Enums.PaymentType
bankAccountId?: Prisma.IntFieldUpdateOperationsInput | number
inventoryId?: Prisma.IntFieldUpdateOperationsInput | number
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
payedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}
export type PurchaseReceiptPaymentsUncheckedUpdateManyWithoutPurchaseReceiptInput = {
export type PurchaseReceiptPaymentsUncheckedUpdateManyWithoutReceiptInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number
amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType
type?: Prisma.EnumPaymentTypeFieldUpdateOperationsInput | $Enums.PaymentType
bankAccountId?: Prisma.IntFieldUpdateOperationsInput | number
inventoryId?: Prisma.IntFieldUpdateOperationsInput | number
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
payedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}
@@ -794,13 +630,11 @@ export type PurchaseReceiptPaymentsSelect<ExtArgs extends runtime.Types.Extensio
paymentMethod?: boolean
type?: boolean
bankAccountId?: boolean
inventoryId?: boolean
description?: boolean
payedAt?: boolean
receiptId?: boolean
payedAt?: boolean
description?: boolean
createdAt?: boolean
purchaseReceipt?: boolean | Prisma.PurchaseReceiptDefaultArgs<ExtArgs>
inventoryBankAccount?: boolean | Prisma.InventoryBankAccountDefaultArgs<ExtArgs>
receipt?: boolean | Prisma.PurchaseReceiptDefaultArgs<ExtArgs>
}, ExtArgs["result"]["purchaseReceiptPayments"]>
@@ -811,24 +645,21 @@ export type PurchaseReceiptPaymentsSelectScalar = {
paymentMethod?: boolean
type?: boolean
bankAccountId?: boolean
inventoryId?: boolean
description?: boolean
payedAt?: boolean
receiptId?: boolean
payedAt?: boolean
description?: boolean
createdAt?: boolean
}
export type PurchaseReceiptPaymentsOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "amount" | "paymentMethod" | "type" | "bankAccountId" | "inventoryId" | "description" | "payedAt" | "receiptId" | "createdAt", ExtArgs["result"]["purchaseReceiptPayments"]>
export type PurchaseReceiptPaymentsOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "amount" | "paymentMethod" | "type" | "bankAccountId" | "receiptId" | "payedAt" | "description" | "createdAt", ExtArgs["result"]["purchaseReceiptPayments"]>
export type PurchaseReceiptPaymentsInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
purchaseReceipt?: boolean | Prisma.PurchaseReceiptDefaultArgs<ExtArgs>
inventoryBankAccount?: boolean | Prisma.InventoryBankAccountDefaultArgs<ExtArgs>
receipt?: boolean | Prisma.PurchaseReceiptDefaultArgs<ExtArgs>
}
export type $PurchaseReceiptPaymentsPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
name: "PurchaseReceiptPayments"
objects: {
purchaseReceipt: Prisma.$PurchaseReceiptPayload<ExtArgs>
inventoryBankAccount: Prisma.$InventoryBankAccountPayload<ExtArgs>
receipt: Prisma.$PurchaseReceiptPayload<ExtArgs>
}
scalars: runtime.Types.Extensions.GetPayloadResult<{
id: number
@@ -836,10 +667,9 @@ export type $PurchaseReceiptPaymentsPayload<ExtArgs extends runtime.Types.Extens
paymentMethod: $Enums.PaymentMethodType
type: $Enums.PaymentType
bankAccountId: number
inventoryId: number
description: string | null
payedAt: Date
receiptId: number
payedAt: Date
description: string | null
createdAt: Date
}, ExtArgs["result"]["purchaseReceiptPayments"]>
composites: {}
@@ -1181,8 +1011,7 @@ readonly fields: PurchaseReceiptPaymentsFieldRefs;
*/
export interface Prisma__PurchaseReceiptPaymentsClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
readonly [Symbol.toStringTag]: "PrismaPromise"
purchaseReceipt<T extends Prisma.PurchaseReceiptDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.PurchaseReceiptDefaultArgs<ExtArgs>>): Prisma.Prisma__PurchaseReceiptClient<runtime.Types.Result.GetResult<Prisma.$PurchaseReceiptPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
inventoryBankAccount<T extends Prisma.InventoryBankAccountDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.InventoryBankAccountDefaultArgs<ExtArgs>>): Prisma.Prisma__InventoryBankAccountClient<runtime.Types.Result.GetResult<Prisma.$InventoryBankAccountPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
receipt<T extends Prisma.PurchaseReceiptDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.PurchaseReceiptDefaultArgs<ExtArgs>>): Prisma.Prisma__PurchaseReceiptClient<runtime.Types.Result.GetResult<Prisma.$PurchaseReceiptPayload<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.
@@ -1217,10 +1046,9 @@ export interface PurchaseReceiptPaymentsFieldRefs {
readonly paymentMethod: Prisma.FieldRef<"PurchaseReceiptPayments", 'PaymentMethodType'>
readonly type: Prisma.FieldRef<"PurchaseReceiptPayments", 'PaymentType'>
readonly bankAccountId: Prisma.FieldRef<"PurchaseReceiptPayments", 'Int'>
readonly inventoryId: Prisma.FieldRef<"PurchaseReceiptPayments", 'Int'>
readonly description: Prisma.FieldRef<"PurchaseReceiptPayments", 'String'>
readonly payedAt: Prisma.FieldRef<"PurchaseReceiptPayments", 'DateTime'>
readonly receiptId: Prisma.FieldRef<"PurchaseReceiptPayments", 'Int'>
readonly payedAt: Prisma.FieldRef<"PurchaseReceiptPayments", 'DateTime'>
readonly description: Prisma.FieldRef<"PurchaseReceiptPayments", 'String'>
readonly createdAt: Prisma.FieldRef<"PurchaseReceiptPayments", 'DateTime'>
}
@@ -0,0 +1,30 @@
import { IsEnum, IsInt, IsNumber, IsOptional, IsString } from 'class-validator'
import { PaymentMethodType, PaymentType } from '../../../generated/prisma/enums'
export class CreatePurchaseReceiptPaymentDto {
@IsNumber()
amount: number
@IsEnum(PaymentMethodType)
paymentMethod: PaymentMethodType
@IsEnum(PaymentType)
type: PaymentType
@IsInt()
bankAccountId: number
@IsInt()
receiptId: number
@IsString()
payedAt: string
@IsOptional()
@IsString()
description?: string
@IsOptional()
@IsString()
createdAt?: string
}
@@ -0,0 +1,6 @@
import { PartialType } from '@nestjs/swagger'
import { CreatePurchaseReceiptPaymentDto } from './create-purchase-receipt-payment.dto'
export class UpdatePurchaseReceiptPaymentDto extends PartialType(
CreatePurchaseReceiptPaymentDto,
) {}
@@ -0,0 +1,36 @@
import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common'
import { CreatePurchaseReceiptPaymentDto } from './dto/create-purchase-receipt-payment.dto'
import { UpdatePurchaseReceiptPaymentDto } from './dto/update-purchase-receipt-payment.dto'
import { PurchaseReceiptPaymentsService } from './purchase-receipt-payments.service'
@Controller('purchase-receipt-payments')
export class PurchaseReceiptPaymentsController {
constructor(
private readonly purchaseReceiptPaymentsService: PurchaseReceiptPaymentsService,
) {}
@Post()
create(@Body() dto: CreatePurchaseReceiptPaymentDto) {
return this.purchaseReceiptPaymentsService.create(dto)
}
@Get()
findAll() {
return this.purchaseReceiptPaymentsService.findAll()
}
@Get(':id')
findOne(@Param('id') id: string) {
return this.purchaseReceiptPaymentsService.findOne(Number(id))
}
@Patch(':id')
update(@Param('id') id: string, @Body() dto: UpdatePurchaseReceiptPaymentDto) {
return this.purchaseReceiptPaymentsService.update(Number(id), dto)
}
@Delete(':id')
remove(@Param('id') id: string) {
return this.purchaseReceiptPaymentsService.remove(Number(id))
}
}
@@ -0,0 +1,12 @@
import { Module } from '@nestjs/common'
import { PrismaModule } from '../../prisma/prisma.module'
import { PurchaseReceiptPaymentsController } from './purchase-receipt-payments.controller'
import { PurchaseReceiptPaymentsService } from './purchase-receipt-payments.service'
@Module({
imports: [PrismaModule],
controllers: [PurchaseReceiptPaymentsController],
providers: [PurchaseReceiptPaymentsService],
})
export class PurchaseReceiptPaymentsModule {}
@@ -0,0 +1,65 @@
import { Injectable } from '@nestjs/common'
import { ResponseMapper } from '../../common/response/response-mapper'
import { PrismaService } from '../../prisma/prisma.service'
@Injectable()
export class PurchaseReceiptPaymentsService {
constructor(private prisma: PrismaService) {}
async create(data: any) {
const item = await this.prisma.purchaseReceiptPayments.create({ data })
return ResponseMapper.create(item)
}
async findAll() {
const items = await this.prisma.purchaseReceiptPayments.findMany({
include: {
receipt: {
select: {
id: true,
code: true,
totalAmount: true,
paidAmount: true,
status: true,
supplier: {
select: { id: true, firstName: true, lastName: true },
},
},
},
},
})
return ResponseMapper.list(items)
}
async findOne(id: number) {
const item = await this.prisma.purchaseReceiptPayments.findUnique({
where: { id },
include: {
receipt: {
select: {
id: true,
code: true,
totalAmount: true,
paidAmount: true,
status: true,
supplier: {
select: { id: true, firstName: true, lastName: true },
},
},
},
},
})
if (!item) return null
return ResponseMapper.single(item)
}
async update(id: number, data: any) {
const item = await this.prisma.purchaseReceiptPayments.update({ where: { id }, data })
return ResponseMapper.update(item)
}
async remove(id: number) {
const item = await this.prisma.purchaseReceiptPayments.delete({ where: { id } })
return ResponseMapper.single(item)
}
}
@@ -22,17 +22,9 @@ export class SuppliersController {
return this.suppliersService.findOne(Number(supplierId))
}
@Get(':supplierId/invoices')
getInvoices(@Param('supplierId') supplierId: string) {
return this.suppliersService.getInvoices(Number(supplierId))
}
@Get(':supplierId/invoices/:invoiceId')
getInvoice(
@Param('supplierId') supplierId: string,
@Param('invoiceId') invoiceId: string,
) {
return this.suppliersService.getInvoice(Number(supplierId), Number(invoiceId))
@Get(':supplierId/ledger')
getLedger(@Param('supplierId') supplierId: string) {
return this.suppliersService.getLedger(Number(supplierId))
}
@Patch(':id')
@@ -1,6 +1,6 @@
import { Injectable } from '@nestjs/common'
import { ResponseMapper } from '../common/response/response-mapper'
import { PrismaService } from '../prisma/prisma.service'
import { ResponseMapper } from '../../../common/response/response-mapper'
import { PrismaService } from '../../../prisma/prisma.service'
@Injectable()
export class SuppliersService {
@@ -37,71 +37,18 @@ export class SuppliersService {
})
}
async getInvoices(supplierId: number) {
const items = await this.prisma.purchaseReceipt.findMany({
async getLedger(supplierId: number) {
const items = await this.prisma.supplierLedger.findMany({
where: {
supplierId,
},
include: {
inventory: {
select: {
id: true,
name: true,
},
},
items: {
select: {
id: true,
count: true,
fee: true,
total: true,
product: {
select: {
id: true,
name: true,
sku: true,
},
},
},
},
payments: {
select: {
id: true,
amount: true,
},
},
},
omit: {
inventoryId: true,
supplierId: true,
},
})
return ResponseMapper.list(items)
}
async getInvoice(supplierId: number, invoiceId: number) {
const invoice = await this.prisma.purchaseReceipt.findUnique({
where: {
id: invoiceId,
supplierId,
},
include: {
inventory: {
select: {
id: true,
name: true,
},
},
items: true,
},
omit: {
inventoryId: true,
supplierId: true,
},
})
return ResponseMapper.single(invoice)
}
async update(id: number, data: any) {
const item = await this.prisma.supplier.update({ where: { id }, data })
return ResponseMapper.update(item)
@@ -0,0 +1,34 @@
import {
IsDateString,
IsEnum,
IsInt,
IsNumber,
IsOptional,
IsString,
} from 'class-validator'
import { PaymentMethodType, PaymentType } from '../../../../generated/prisma/enums'
export class CreateReceiptPaymentDto {
@IsNumber()
amount: number
@IsEnum(PaymentMethodType)
paymentMethod: PaymentMethodType
@IsEnum(PaymentType)
type: PaymentType
@IsInt()
bankAccountId: number
@IsDateString()
payedAt: string
@IsOptional()
@IsString()
description?: string
@IsOptional()
@IsString()
createdAt?: string
}
@@ -0,0 +1,42 @@
import { Body, Controller, Get, Param, Post } from '@nestjs/common'
import { CreateReceiptPaymentDto } from './dto/create-receipt-payment.dto'
import { SupplierInvoicesService } from './invoices.service'
@Controller('suppliers/:supplierId/invoices')
export class SupplierInvoicesController {
constructor(private readonly supplierInvoicesService: SupplierInvoicesService) {}
@Get()
getInvoices(@Param('supplierId') supplierId: string) {
return this.supplierInvoicesService.findAll(Number(supplierId))
}
@Get(':invoiceId')
getInvoice(
@Param('supplierId') supplierId: string,
@Param('invoiceId') invoiceId: string,
) {
return this.supplierInvoicesService.findOne(Number(supplierId), Number(invoiceId))
}
@Post(':invoiceId/pay')
createPayment(
@Param('invoiceId') invoiceId: string,
@Body() data: CreateReceiptPaymentDto,
) {
return this.supplierInvoicesService.createPayment(Number(invoiceId), data)
}
@Get(':invoiceId/payments')
getInvoicePayments(
@Param('supplierId') supplierId: string,
@Param('invoiceId') invoiceId: string,
) {
return this.supplierInvoicesService.findPayments(Number(invoiceId))
}
@Get('payments')
getPayments(@Param('supplierId') supplierId: string) {
return this.supplierInvoicesService.findPayments(Number(supplierId))
}
}
@@ -0,0 +1,11 @@
import { Module } from '@nestjs/common'
import { PrismaModule } from '../../../prisma/prisma.module'
import { SupplierInvoicesController } from './invoices.controller'
import { SupplierInvoicesService } from './invoices.service'
@Module({
imports: [PrismaModule],
controllers: [SupplierInvoicesController],
providers: [SupplierInvoicesService],
})
export class SupplierInvoicesModule {}
@@ -0,0 +1,145 @@
import { Injectable } from '@nestjs/common'
import { ResponseMapper } from '../../../common/response/response-mapper'
import { PrismaService } from '../../../prisma/prisma.service'
import { CreateReceiptPaymentDto } from './dto/create-receipt-payment.dto'
@Injectable()
export class SupplierInvoicesService {
constructor(private prisma: PrismaService) {}
async findAll(supplierId: number) {
const items = await this.prisma.purchaseReceipt.findMany({
where: {
supplierId,
},
include: {
inventory: {
select: {
id: true,
name: true,
},
},
items: {
select: {
id: true,
count: true,
fee: true,
total: true,
product: {
select: {
id: true,
name: true,
sku: true,
},
},
},
},
payments: {
select: {
id: true,
amount: true,
},
},
},
omit: {
inventoryId: true,
supplierId: true,
},
})
return ResponseMapper.list(items)
}
async findOne(supplierId: number, invoiceId: number) {
const invoice = await this.prisma.purchaseReceipt.findUnique({
where: {
id: invoiceId,
supplierId,
},
include: {
inventory: {
select: {
id: true,
name: true,
},
},
items: true,
},
omit: {
inventoryId: true,
supplierId: true,
},
})
return ResponseMapper.single(invoice)
}
async findPayments(invoiceId: number) {
const items = await this.prisma.purchaseReceiptPayments.findMany({
where: {
receipt: {
id: invoiceId,
},
},
include: {
receipt: {
include: {
inventory: {
select: {
id: true,
name: true,
},
},
},
},
},
omit: {
receiptId: true,
},
})
return ResponseMapper.list(items)
}
async findAllPayments(supplierId: number) {
const items = await this.prisma.purchaseReceiptPayments.findMany({
where: {
receipt: {
supplierId,
},
},
include: {
receipt: {
select: {
id: true,
totalAmount: true,
status: true,
paidAmount: true,
},
},
},
omit: {
receiptId: true,
},
})
return ResponseMapper.list(items)
}
async createPayment(invoiceId: number, data: CreateReceiptPaymentDto) {
const payment = await this.prisma.purchaseReceiptPayments.create({
data: {
...data,
payedAt: new Date(data.payedAt),
receipt: {
connect: {
id: invoiceId,
},
},
},
include: {
receipt: true,
},
omit: {
receiptId: true,
},
})
return ResponseMapper.create(payment)
}
}
+12
View File
@@ -0,0 +1,12 @@
import { Module } from '@nestjs/common'
import { PrismaModule } from '../../prisma/prisma.module'
import { SuppliersController } from './index/suppliers.controller'
import { SuppliersService } from './index/suppliers.service'
import { SupplierInvoicesModule } from './invoices/invoices.module'
@Module({
imports: [PrismaModule, SupplierInvoicesModule],
controllers: [SuppliersController],
providers: [SuppliersService],
})
export class SuppliersModule {}
-11
View File
@@ -1,11 +0,0 @@
import { Module } from '@nestjs/common'
import { PrismaModule } from '../prisma/prisma.module'
import { SuppliersController } from './suppliers.controller'
import { SuppliersService } from './suppliers.service'
@Module({
imports: [PrismaModule],
controllers: [SuppliersController],
providers: [SuppliersService],
})
export class SuppliersModule {}