feat: add bank account relation to PurchaseReceiptPayments and update related services

- Added bank account relation to PurchaseReceiptPayments model.
- Updated BankAccount model to include purchaseReceiptPayments relation.
- Modified PurchaseReceiptPayments service to handle bank account data during payment creation.
- Enhanced SuppliersService to order suppliers by creation date.
- Updated SupplierInvoicesService to include bank account details in invoice payments and order payments by payedAt.
- Added foreign key constraint for bankAccountId in PurchaseReceiptPayments table.
This commit is contained in:
2025-12-29 10:14:56 +03:30
parent b35a3633ed
commit 1bb206a608
8 changed files with 330 additions and 23 deletions
@@ -0,0 +1,2 @@
-- AddForeignKey
ALTER TABLE `Purchase_Receipt_Payments` ADD CONSTRAINT `Purchase_Receipt_Payments_bankAccountId_fkey` FOREIGN KEY (`bankAccountId`) REFERENCES `Bank_Accounts`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
+1
View File
@@ -27,6 +27,7 @@ model BankAccount {
branch BankBranch @relation("Bank_Accounts_branchId_fkey", fields: [branchId], references: [id]) branch BankBranch @relation("Bank_Accounts_branchId_fkey", fields: [branchId], references: [id])
inventoryBankAccounts InventoryBankAccount[] inventoryBankAccounts InventoryBankAccount[]
purchaseReceiptPayments PurchaseReceiptPayments[]
@@map("Bank_Accounts") @@map("Bank_Accounts")
} }
+2 -2
View File
@@ -42,13 +42,13 @@ model PurchaseReceiptPayments {
paymentMethod PaymentMethodType paymentMethod PaymentMethodType
type PaymentType type PaymentType
bankAccountId Int bankAccountId Int
inventoryId Int
receiptId Int receiptId Int
payedAt DateTime @db.Timestamp(0) payedAt DateTime @db.Timestamp(0)
description String? @db.Text description String? @db.Text
createdAt DateTime @default(now()) @db.Timestamp(0) createdAt DateTime @default(now()) @db.Timestamp(0)
receipt PurchaseReceipt @relation(fields: [receiptId], references: [id]) receipt PurchaseReceipt @relation(fields: [receiptId], references: [id])
bankAccount BankAccount @relation(fields: [bankAccountId], references: [id])
@@index([receiptId], map: "Purchase_Receipt_Payments_receiptId_fkey") @@index([receiptId], map: "Purchase_Receipt_Payments_receiptId_fkey")
@@map("Purchase_Receipt_Payments") @@map("Purchase_Receipt_Payments")
File diff suppressed because one or more lines are too long
+132
View File
@@ -254,6 +254,7 @@ export type BankAccountWhereInput = {
deletedAt?: Prisma.DateTimeNullableFilter<"BankAccount"> | Date | string | null deletedAt?: Prisma.DateTimeNullableFilter<"BankAccount"> | Date | string | null
branch?: Prisma.XOR<Prisma.BankBranchScalarRelationFilter, Prisma.BankBranchWhereInput> branch?: Prisma.XOR<Prisma.BankBranchScalarRelationFilter, Prisma.BankBranchWhereInput>
inventoryBankAccounts?: Prisma.InventoryBankAccountListRelationFilter inventoryBankAccounts?: Prisma.InventoryBankAccountListRelationFilter
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsListRelationFilter
} }
export type BankAccountOrderByWithRelationInput = { export type BankAccountOrderByWithRelationInput = {
@@ -268,6 +269,7 @@ export type BankAccountOrderByWithRelationInput = {
deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder
branch?: Prisma.BankBranchOrderByWithRelationInput branch?: Prisma.BankBranchOrderByWithRelationInput
inventoryBankAccounts?: Prisma.InventoryBankAccountOrderByRelationAggregateInput inventoryBankAccounts?: Prisma.InventoryBankAccountOrderByRelationAggregateInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsOrderByRelationAggregateInput
_relevance?: Prisma.BankAccountOrderByRelevanceInput _relevance?: Prisma.BankAccountOrderByRelevanceInput
} }
@@ -286,6 +288,7 @@ export type BankAccountWhereUniqueInput = Prisma.AtLeast<{
deletedAt?: Prisma.DateTimeNullableFilter<"BankAccount"> | Date | string | null deletedAt?: Prisma.DateTimeNullableFilter<"BankAccount"> | Date | string | null
branch?: Prisma.XOR<Prisma.BankBranchScalarRelationFilter, Prisma.BankBranchWhereInput> branch?: Prisma.XOR<Prisma.BankBranchScalarRelationFilter, Prisma.BankBranchWhereInput>
inventoryBankAccounts?: Prisma.InventoryBankAccountListRelationFilter inventoryBankAccounts?: Prisma.InventoryBankAccountListRelationFilter
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsListRelationFilter
}, "id" | "accountNumber" | "cardNumber" | "iban"> }, "id" | "accountNumber" | "cardNumber" | "iban">
export type BankAccountOrderByWithAggregationInput = { export type BankAccountOrderByWithAggregationInput = {
@@ -330,6 +333,7 @@ export type BankAccountCreateInput = {
deletedAt?: Date | string | null deletedAt?: Date | string | null
branch: Prisma.BankBranchCreateNestedOneWithoutBankAccountsInput branch: Prisma.BankBranchCreateNestedOneWithoutBankAccountsInput
inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutBankAccountInput inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutBankAccountInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutBankAccountInput
} }
export type BankAccountUncheckedCreateInput = { export type BankAccountUncheckedCreateInput = {
@@ -343,6 +347,7 @@ export type BankAccountUncheckedCreateInput = {
updatedAt?: Date | string updatedAt?: Date | string
deletedAt?: Date | string | null deletedAt?: Date | string | null
inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutBankAccountInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutBankAccountInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutBankAccountInput
} }
export type BankAccountUpdateInput = { export type BankAccountUpdateInput = {
@@ -355,6 +360,7 @@ export type BankAccountUpdateInput = {
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
branch?: Prisma.BankBranchUpdateOneRequiredWithoutBankAccountsNestedInput branch?: Prisma.BankBranchUpdateOneRequiredWithoutBankAccountsNestedInput
inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutBankAccountNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutBankAccountNestedInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutBankAccountNestedInput
} }
export type BankAccountUncheckedUpdateInput = { export type BankAccountUncheckedUpdateInput = {
@@ -368,6 +374,7 @@ export type BankAccountUncheckedUpdateInput = {
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutBankAccountNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutBankAccountNestedInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutBankAccountNestedInput
} }
export type BankAccountCreateManyInput = { export type BankAccountCreateManyInput = {
@@ -527,6 +534,20 @@ export type BankAccountUpdateOneRequiredWithoutInventoryBankAccountsNestedInput
update?: Prisma.XOR<Prisma.XOR<Prisma.BankAccountUpdateToOneWithWhereWithoutInventoryBankAccountsInput, Prisma.BankAccountUpdateWithoutInventoryBankAccountsInput>, Prisma.BankAccountUncheckedUpdateWithoutInventoryBankAccountsInput> update?: Prisma.XOR<Prisma.XOR<Prisma.BankAccountUpdateToOneWithWhereWithoutInventoryBankAccountsInput, Prisma.BankAccountUpdateWithoutInventoryBankAccountsInput>, Prisma.BankAccountUncheckedUpdateWithoutInventoryBankAccountsInput>
} }
export type BankAccountCreateNestedOneWithoutPurchaseReceiptPaymentsInput = {
create?: Prisma.XOR<Prisma.BankAccountCreateWithoutPurchaseReceiptPaymentsInput, Prisma.BankAccountUncheckedCreateWithoutPurchaseReceiptPaymentsInput>
connectOrCreate?: Prisma.BankAccountCreateOrConnectWithoutPurchaseReceiptPaymentsInput
connect?: Prisma.BankAccountWhereUniqueInput
}
export type BankAccountUpdateOneRequiredWithoutPurchaseReceiptPaymentsNestedInput = {
create?: Prisma.XOR<Prisma.BankAccountCreateWithoutPurchaseReceiptPaymentsInput, Prisma.BankAccountUncheckedCreateWithoutPurchaseReceiptPaymentsInput>
connectOrCreate?: Prisma.BankAccountCreateOrConnectWithoutPurchaseReceiptPaymentsInput
upsert?: Prisma.BankAccountUpsertWithoutPurchaseReceiptPaymentsInput
connect?: Prisma.BankAccountWhereUniqueInput
update?: Prisma.XOR<Prisma.XOR<Prisma.BankAccountUpdateToOneWithWhereWithoutPurchaseReceiptPaymentsInput, Prisma.BankAccountUpdateWithoutPurchaseReceiptPaymentsInput>, Prisma.BankAccountUncheckedUpdateWithoutPurchaseReceiptPaymentsInput>
}
export type BankAccountCreateWithoutBranchInput = { export type BankAccountCreateWithoutBranchInput = {
accountNumber?: string | null accountNumber?: string | null
cardNumber?: string | null cardNumber?: string | null
@@ -536,6 +557,7 @@ export type BankAccountCreateWithoutBranchInput = {
updatedAt?: Date | string updatedAt?: Date | string
deletedAt?: Date | string | null deletedAt?: Date | string | null
inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutBankAccountInput inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutBankAccountInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutBankAccountInput
} }
export type BankAccountUncheckedCreateWithoutBranchInput = { export type BankAccountUncheckedCreateWithoutBranchInput = {
@@ -548,6 +570,7 @@ export type BankAccountUncheckedCreateWithoutBranchInput = {
updatedAt?: Date | string updatedAt?: Date | string
deletedAt?: Date | string | null deletedAt?: Date | string | null
inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutBankAccountInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutBankAccountInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutBankAccountInput
} }
export type BankAccountCreateOrConnectWithoutBranchInput = { export type BankAccountCreateOrConnectWithoutBranchInput = {
@@ -600,6 +623,7 @@ export type BankAccountCreateWithoutInventoryBankAccountsInput = {
updatedAt?: Date | string updatedAt?: Date | string
deletedAt?: Date | string | null deletedAt?: Date | string | null
branch: Prisma.BankBranchCreateNestedOneWithoutBankAccountsInput branch: Prisma.BankBranchCreateNestedOneWithoutBankAccountsInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutBankAccountInput
} }
export type BankAccountUncheckedCreateWithoutInventoryBankAccountsInput = { export type BankAccountUncheckedCreateWithoutInventoryBankAccountsInput = {
@@ -612,6 +636,7 @@ export type BankAccountUncheckedCreateWithoutInventoryBankAccountsInput = {
createdAt?: Date | string createdAt?: Date | string
updatedAt?: Date | string updatedAt?: Date | string
deletedAt?: Date | string | null deletedAt?: Date | string | null
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutBankAccountInput
} }
export type BankAccountCreateOrConnectWithoutInventoryBankAccountsInput = { export type BankAccountCreateOrConnectWithoutInventoryBankAccountsInput = {
@@ -639,6 +664,7 @@ export type BankAccountUpdateWithoutInventoryBankAccountsInput = {
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
branch?: Prisma.BankBranchUpdateOneRequiredWithoutBankAccountsNestedInput branch?: Prisma.BankBranchUpdateOneRequiredWithoutBankAccountsNestedInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutBankAccountNestedInput
} }
export type BankAccountUncheckedUpdateWithoutInventoryBankAccountsInput = { export type BankAccountUncheckedUpdateWithoutInventoryBankAccountsInput = {
@@ -651,6 +677,73 @@ export type BankAccountUncheckedUpdateWithoutInventoryBankAccountsInput = {
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutBankAccountNestedInput
}
export type BankAccountCreateWithoutPurchaseReceiptPaymentsInput = {
accountNumber?: string | null
cardNumber?: string | null
name: string
iban?: string | null
createdAt?: Date | string
updatedAt?: Date | string
deletedAt?: Date | string | null
branch: Prisma.BankBranchCreateNestedOneWithoutBankAccountsInput
inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutBankAccountInput
}
export type BankAccountUncheckedCreateWithoutPurchaseReceiptPaymentsInput = {
id?: number
accountNumber?: string | null
cardNumber?: string | null
name: string
iban?: string | null
branchId: number
createdAt?: Date | string
updatedAt?: Date | string
deletedAt?: Date | string | null
inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutBankAccountInput
}
export type BankAccountCreateOrConnectWithoutPurchaseReceiptPaymentsInput = {
where: Prisma.BankAccountWhereUniqueInput
create: Prisma.XOR<Prisma.BankAccountCreateWithoutPurchaseReceiptPaymentsInput, Prisma.BankAccountUncheckedCreateWithoutPurchaseReceiptPaymentsInput>
}
export type BankAccountUpsertWithoutPurchaseReceiptPaymentsInput = {
update: Prisma.XOR<Prisma.BankAccountUpdateWithoutPurchaseReceiptPaymentsInput, Prisma.BankAccountUncheckedUpdateWithoutPurchaseReceiptPaymentsInput>
create: Prisma.XOR<Prisma.BankAccountCreateWithoutPurchaseReceiptPaymentsInput, Prisma.BankAccountUncheckedCreateWithoutPurchaseReceiptPaymentsInput>
where?: Prisma.BankAccountWhereInput
}
export type BankAccountUpdateToOneWithWhereWithoutPurchaseReceiptPaymentsInput = {
where?: Prisma.BankAccountWhereInput
data: Prisma.XOR<Prisma.BankAccountUpdateWithoutPurchaseReceiptPaymentsInput, Prisma.BankAccountUncheckedUpdateWithoutPurchaseReceiptPaymentsInput>
}
export type BankAccountUpdateWithoutPurchaseReceiptPaymentsInput = {
accountNumber?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
cardNumber?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
name?: Prisma.StringFieldUpdateOperationsInput | string
iban?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
branch?: Prisma.BankBranchUpdateOneRequiredWithoutBankAccountsNestedInput
inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutBankAccountNestedInput
}
export type BankAccountUncheckedUpdateWithoutPurchaseReceiptPaymentsInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number
accountNumber?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
cardNumber?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
name?: Prisma.StringFieldUpdateOperationsInput | string
iban?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
branchId?: Prisma.IntFieldUpdateOperationsInput | number
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutBankAccountNestedInput
} }
export type BankAccountCreateManyBranchInput = { export type BankAccountCreateManyBranchInput = {
@@ -673,6 +766,7 @@ export type BankAccountUpdateWithoutBranchInput = {
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutBankAccountNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutBankAccountNestedInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutBankAccountNestedInput
} }
export type BankAccountUncheckedUpdateWithoutBranchInput = { export type BankAccountUncheckedUpdateWithoutBranchInput = {
@@ -685,6 +779,7 @@ export type BankAccountUncheckedUpdateWithoutBranchInput = {
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutBankAccountNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutBankAccountNestedInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutBankAccountNestedInput
} }
export type BankAccountUncheckedUpdateManyWithoutBranchInput = { export type BankAccountUncheckedUpdateManyWithoutBranchInput = {
@@ -705,10 +800,12 @@ export type BankAccountUncheckedUpdateManyWithoutBranchInput = {
export type BankAccountCountOutputType = { export type BankAccountCountOutputType = {
inventoryBankAccounts: number inventoryBankAccounts: number
purchaseReceiptPayments: number
} }
export type BankAccountCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = { export type BankAccountCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
inventoryBankAccounts?: boolean | BankAccountCountOutputTypeCountInventoryBankAccountsArgs inventoryBankAccounts?: boolean | BankAccountCountOutputTypeCountInventoryBankAccountsArgs
purchaseReceiptPayments?: boolean | BankAccountCountOutputTypeCountPurchaseReceiptPaymentsArgs
} }
/** /**
@@ -728,6 +825,13 @@ export type BankAccountCountOutputTypeCountInventoryBankAccountsArgs<ExtArgs ext
where?: Prisma.InventoryBankAccountWhereInput where?: Prisma.InventoryBankAccountWhereInput
} }
/**
* BankAccountCountOutputType without action
*/
export type BankAccountCountOutputTypeCountPurchaseReceiptPaymentsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
where?: Prisma.PurchaseReceiptPaymentsWhereInput
}
export type BankAccountSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{ export type BankAccountSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
id?: boolean id?: boolean
@@ -741,6 +845,7 @@ export type BankAccountSelect<ExtArgs extends runtime.Types.Extensions.InternalA
deletedAt?: boolean deletedAt?: boolean
branch?: boolean | Prisma.BankBranchDefaultArgs<ExtArgs> branch?: boolean | Prisma.BankBranchDefaultArgs<ExtArgs>
inventoryBankAccounts?: boolean | Prisma.BankAccount$inventoryBankAccountsArgs<ExtArgs> inventoryBankAccounts?: boolean | Prisma.BankAccount$inventoryBankAccountsArgs<ExtArgs>
purchaseReceiptPayments?: boolean | Prisma.BankAccount$purchaseReceiptPaymentsArgs<ExtArgs>
_count?: boolean | Prisma.BankAccountCountOutputTypeDefaultArgs<ExtArgs> _count?: boolean | Prisma.BankAccountCountOutputTypeDefaultArgs<ExtArgs>
}, ExtArgs["result"]["bankAccount"]> }, ExtArgs["result"]["bankAccount"]>
@@ -762,6 +867,7 @@ export type BankAccountOmit<ExtArgs extends runtime.Types.Extensions.InternalArg
export type BankAccountInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = { export type BankAccountInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
branch?: boolean | Prisma.BankBranchDefaultArgs<ExtArgs> branch?: boolean | Prisma.BankBranchDefaultArgs<ExtArgs>
inventoryBankAccounts?: boolean | Prisma.BankAccount$inventoryBankAccountsArgs<ExtArgs> inventoryBankAccounts?: boolean | Prisma.BankAccount$inventoryBankAccountsArgs<ExtArgs>
purchaseReceiptPayments?: boolean | Prisma.BankAccount$purchaseReceiptPaymentsArgs<ExtArgs>
_count?: boolean | Prisma.BankAccountCountOutputTypeDefaultArgs<ExtArgs> _count?: boolean | Prisma.BankAccountCountOutputTypeDefaultArgs<ExtArgs>
} }
@@ -770,6 +876,7 @@ export type $BankAccountPayload<ExtArgs extends runtime.Types.Extensions.Interna
objects: { objects: {
branch: Prisma.$BankBranchPayload<ExtArgs> branch: Prisma.$BankBranchPayload<ExtArgs>
inventoryBankAccounts: Prisma.$InventoryBankAccountPayload<ExtArgs>[] inventoryBankAccounts: Prisma.$InventoryBankAccountPayload<ExtArgs>[]
purchaseReceiptPayments: Prisma.$PurchaseReceiptPaymentsPayload<ExtArgs>[]
} }
scalars: runtime.Types.Extensions.GetPayloadResult<{ scalars: runtime.Types.Extensions.GetPayloadResult<{
id: number id: number
@@ -1123,6 +1230,7 @@ export interface Prisma__BankAccountClient<T, Null = never, ExtArgs extends runt
readonly [Symbol.toStringTag]: "PrismaPromise" readonly [Symbol.toStringTag]: "PrismaPromise"
branch<T extends Prisma.BankBranchDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.BankBranchDefaultArgs<ExtArgs>>): Prisma.Prisma__BankBranchClient<runtime.Types.Result.GetResult<Prisma.$BankBranchPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> branch<T extends Prisma.BankBranchDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.BankBranchDefaultArgs<ExtArgs>>): Prisma.Prisma__BankBranchClient<runtime.Types.Result.GetResult<Prisma.$BankBranchPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
inventoryBankAccounts<T extends Prisma.BankAccount$inventoryBankAccountsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.BankAccount$inventoryBankAccountsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$InventoryBankAccountPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null> inventoryBankAccounts<T extends Prisma.BankAccount$inventoryBankAccountsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.BankAccount$inventoryBankAccountsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$InventoryBankAccountPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
purchaseReceiptPayments<T extends Prisma.BankAccount$purchaseReceiptPaymentsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.BankAccount$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. * Attaches callbacks for the resolution and/or rejection of the Promise.
* @param onfulfilled The callback to execute when the Promise is resolved. * @param onfulfilled The callback to execute when the Promise is resolved.
@@ -1527,6 +1635,30 @@ export type BankAccount$inventoryBankAccountsArgs<ExtArgs extends runtime.Types.
distinct?: Prisma.InventoryBankAccountScalarFieldEnum | Prisma.InventoryBankAccountScalarFieldEnum[] distinct?: Prisma.InventoryBankAccountScalarFieldEnum | Prisma.InventoryBankAccountScalarFieldEnum[]
} }
/**
* BankAccount.purchaseReceiptPayments
*/
export type BankAccount$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[]
}
/** /**
* BankAccount without action * BankAccount without action
*/ */
@@ -261,6 +261,7 @@ export type PurchaseReceiptPaymentsWhereInput = {
description?: Prisma.StringNullableFilter<"PurchaseReceiptPayments"> | string | null description?: Prisma.StringNullableFilter<"PurchaseReceiptPayments"> | string | null
createdAt?: Prisma.DateTimeFilter<"PurchaseReceiptPayments"> | Date | string createdAt?: Prisma.DateTimeFilter<"PurchaseReceiptPayments"> | Date | string
receipt?: Prisma.XOR<Prisma.PurchaseReceiptScalarRelationFilter, Prisma.PurchaseReceiptWhereInput> receipt?: Prisma.XOR<Prisma.PurchaseReceiptScalarRelationFilter, Prisma.PurchaseReceiptWhereInput>
bankAccount?: Prisma.XOR<Prisma.BankAccountScalarRelationFilter, Prisma.BankAccountWhereInput>
} }
export type PurchaseReceiptPaymentsOrderByWithRelationInput = { export type PurchaseReceiptPaymentsOrderByWithRelationInput = {
@@ -274,6 +275,7 @@ export type PurchaseReceiptPaymentsOrderByWithRelationInput = {
description?: Prisma.SortOrderInput | Prisma.SortOrder description?: Prisma.SortOrderInput | Prisma.SortOrder
createdAt?: Prisma.SortOrder createdAt?: Prisma.SortOrder
receipt?: Prisma.PurchaseReceiptOrderByWithRelationInput receipt?: Prisma.PurchaseReceiptOrderByWithRelationInput
bankAccount?: Prisma.BankAccountOrderByWithRelationInput
_relevance?: Prisma.PurchaseReceiptPaymentsOrderByRelevanceInput _relevance?: Prisma.PurchaseReceiptPaymentsOrderByRelevanceInput
} }
@@ -291,6 +293,7 @@ export type PurchaseReceiptPaymentsWhereUniqueInput = Prisma.AtLeast<{
description?: Prisma.StringNullableFilter<"PurchaseReceiptPayments"> | string | null description?: Prisma.StringNullableFilter<"PurchaseReceiptPayments"> | string | null
createdAt?: Prisma.DateTimeFilter<"PurchaseReceiptPayments"> | Date | string createdAt?: Prisma.DateTimeFilter<"PurchaseReceiptPayments"> | Date | string
receipt?: Prisma.XOR<Prisma.PurchaseReceiptScalarRelationFilter, Prisma.PurchaseReceiptWhereInput> receipt?: Prisma.XOR<Prisma.PurchaseReceiptScalarRelationFilter, Prisma.PurchaseReceiptWhereInput>
bankAccount?: Prisma.XOR<Prisma.BankAccountScalarRelationFilter, Prisma.BankAccountWhereInput>
}, "id"> }, "id">
export type PurchaseReceiptPaymentsOrderByWithAggregationInput = { export type PurchaseReceiptPaymentsOrderByWithAggregationInput = {
@@ -329,11 +332,11 @@ export type PurchaseReceiptPaymentsCreateInput = {
amount: runtime.Decimal | runtime.DecimalJsLike | number | string amount: runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod: $Enums.PaymentMethodType paymentMethod: $Enums.PaymentMethodType
type: $Enums.PaymentType type: $Enums.PaymentType
bankAccountId: number
payedAt: Date | string payedAt: Date | string
description?: string | null description?: string | null
createdAt?: Date | string createdAt?: Date | string
receipt: Prisma.PurchaseReceiptCreateNestedOneWithoutPaymentsInput receipt: Prisma.PurchaseReceiptCreateNestedOneWithoutPaymentsInput
bankAccount: Prisma.BankAccountCreateNestedOneWithoutPurchaseReceiptPaymentsInput
} }
export type PurchaseReceiptPaymentsUncheckedCreateInput = { export type PurchaseReceiptPaymentsUncheckedCreateInput = {
@@ -352,11 +355,11 @@ export type PurchaseReceiptPaymentsUpdateInput = {
amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType
type?: Prisma.EnumPaymentTypeFieldUpdateOperationsInput | $Enums.PaymentType type?: Prisma.EnumPaymentTypeFieldUpdateOperationsInput | $Enums.PaymentType
bankAccountId?: Prisma.IntFieldUpdateOperationsInput | number
payedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string payedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
receipt?: Prisma.PurchaseReceiptUpdateOneRequiredWithoutPaymentsNestedInput receipt?: Prisma.PurchaseReceiptUpdateOneRequiredWithoutPaymentsNestedInput
bankAccount?: Prisma.BankAccountUpdateOneRequiredWithoutPurchaseReceiptPaymentsNestedInput
} }
export type PurchaseReceiptPaymentsUncheckedUpdateInput = { export type PurchaseReceiptPaymentsUncheckedUpdateInput = {
@@ -387,7 +390,6 @@ export type PurchaseReceiptPaymentsUpdateManyMutationInput = {
amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType
type?: Prisma.EnumPaymentTypeFieldUpdateOperationsInput | $Enums.PaymentType type?: Prisma.EnumPaymentTypeFieldUpdateOperationsInput | $Enums.PaymentType
bankAccountId?: Prisma.IntFieldUpdateOperationsInput | number
payedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string payedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
@@ -471,6 +473,48 @@ export type PurchaseReceiptPaymentsSumOrderByAggregateInput = {
receiptId?: Prisma.SortOrder receiptId?: Prisma.SortOrder
} }
export type PurchaseReceiptPaymentsCreateNestedManyWithoutBankAccountInput = {
create?: Prisma.XOR<Prisma.PurchaseReceiptPaymentsCreateWithoutBankAccountInput, Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutBankAccountInput> | Prisma.PurchaseReceiptPaymentsCreateWithoutBankAccountInput[] | Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutBankAccountInput[]
connectOrCreate?: Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutBankAccountInput | Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutBankAccountInput[]
createMany?: Prisma.PurchaseReceiptPaymentsCreateManyBankAccountInputEnvelope
connect?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput | Prisma.PurchaseReceiptPaymentsWhereUniqueInput[]
}
export type PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutBankAccountInput = {
create?: Prisma.XOR<Prisma.PurchaseReceiptPaymentsCreateWithoutBankAccountInput, Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutBankAccountInput> | Prisma.PurchaseReceiptPaymentsCreateWithoutBankAccountInput[] | Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutBankAccountInput[]
connectOrCreate?: Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutBankAccountInput | Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutBankAccountInput[]
createMany?: Prisma.PurchaseReceiptPaymentsCreateManyBankAccountInputEnvelope
connect?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput | Prisma.PurchaseReceiptPaymentsWhereUniqueInput[]
}
export type PurchaseReceiptPaymentsUpdateManyWithoutBankAccountNestedInput = {
create?: Prisma.XOR<Prisma.PurchaseReceiptPaymentsCreateWithoutBankAccountInput, Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutBankAccountInput> | Prisma.PurchaseReceiptPaymentsCreateWithoutBankAccountInput[] | Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutBankAccountInput[]
connectOrCreate?: Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutBankAccountInput | Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutBankAccountInput[]
upsert?: Prisma.PurchaseReceiptPaymentsUpsertWithWhereUniqueWithoutBankAccountInput | Prisma.PurchaseReceiptPaymentsUpsertWithWhereUniqueWithoutBankAccountInput[]
createMany?: Prisma.PurchaseReceiptPaymentsCreateManyBankAccountInputEnvelope
set?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput | Prisma.PurchaseReceiptPaymentsWhereUniqueInput[]
disconnect?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput | Prisma.PurchaseReceiptPaymentsWhereUniqueInput[]
delete?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput | Prisma.PurchaseReceiptPaymentsWhereUniqueInput[]
connect?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput | Prisma.PurchaseReceiptPaymentsWhereUniqueInput[]
update?: Prisma.PurchaseReceiptPaymentsUpdateWithWhereUniqueWithoutBankAccountInput | Prisma.PurchaseReceiptPaymentsUpdateWithWhereUniqueWithoutBankAccountInput[]
updateMany?: Prisma.PurchaseReceiptPaymentsUpdateManyWithWhereWithoutBankAccountInput | Prisma.PurchaseReceiptPaymentsUpdateManyWithWhereWithoutBankAccountInput[]
deleteMany?: Prisma.PurchaseReceiptPaymentsScalarWhereInput | Prisma.PurchaseReceiptPaymentsScalarWhereInput[]
}
export type PurchaseReceiptPaymentsUncheckedUpdateManyWithoutBankAccountNestedInput = {
create?: Prisma.XOR<Prisma.PurchaseReceiptPaymentsCreateWithoutBankAccountInput, Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutBankAccountInput> | Prisma.PurchaseReceiptPaymentsCreateWithoutBankAccountInput[] | Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutBankAccountInput[]
connectOrCreate?: Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutBankAccountInput | Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutBankAccountInput[]
upsert?: Prisma.PurchaseReceiptPaymentsUpsertWithWhereUniqueWithoutBankAccountInput | Prisma.PurchaseReceiptPaymentsUpsertWithWhereUniqueWithoutBankAccountInput[]
createMany?: Prisma.PurchaseReceiptPaymentsCreateManyBankAccountInputEnvelope
set?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput | Prisma.PurchaseReceiptPaymentsWhereUniqueInput[]
disconnect?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput | Prisma.PurchaseReceiptPaymentsWhereUniqueInput[]
delete?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput | Prisma.PurchaseReceiptPaymentsWhereUniqueInput[]
connect?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput | Prisma.PurchaseReceiptPaymentsWhereUniqueInput[]
update?: Prisma.PurchaseReceiptPaymentsUpdateWithWhereUniqueWithoutBankAccountInput | Prisma.PurchaseReceiptPaymentsUpdateWithWhereUniqueWithoutBankAccountInput[]
updateMany?: Prisma.PurchaseReceiptPaymentsUpdateManyWithWhereWithoutBankAccountInput | Prisma.PurchaseReceiptPaymentsUpdateManyWithWhereWithoutBankAccountInput[]
deleteMany?: Prisma.PurchaseReceiptPaymentsScalarWhereInput | Prisma.PurchaseReceiptPaymentsScalarWhereInput[]
}
export type PurchaseReceiptPaymentsCreateNestedManyWithoutReceiptInput = { export type PurchaseReceiptPaymentsCreateNestedManyWithoutReceiptInput = {
create?: Prisma.XOR<Prisma.PurchaseReceiptPaymentsCreateWithoutReceiptInput, Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutReceiptInput> | Prisma.PurchaseReceiptPaymentsCreateWithoutReceiptInput[] | Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutReceiptInput[] create?: Prisma.XOR<Prisma.PurchaseReceiptPaymentsCreateWithoutReceiptInput, Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutReceiptInput> | Prisma.PurchaseReceiptPaymentsCreateWithoutReceiptInput[] | Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutReceiptInput[]
connectOrCreate?: Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutReceiptInput | Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutReceiptInput[] connectOrCreate?: Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutReceiptInput | Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutReceiptInput[]
@@ -517,14 +561,76 @@ export type EnumPaymentTypeFieldUpdateOperationsInput = {
set?: $Enums.PaymentType set?: $Enums.PaymentType
} }
export type PurchaseReceiptPaymentsCreateWithoutBankAccountInput = {
amount: runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod: $Enums.PaymentMethodType
type: $Enums.PaymentType
payedAt: Date | string
description?: string | null
createdAt?: Date | string
receipt: Prisma.PurchaseReceiptCreateNestedOneWithoutPaymentsInput
}
export type PurchaseReceiptPaymentsUncheckedCreateWithoutBankAccountInput = {
id?: number
amount: runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod: $Enums.PaymentMethodType
type: $Enums.PaymentType
receiptId: number
payedAt: Date | string
description?: string | null
createdAt?: Date | string
}
export type PurchaseReceiptPaymentsCreateOrConnectWithoutBankAccountInput = {
where: Prisma.PurchaseReceiptPaymentsWhereUniqueInput
create: Prisma.XOR<Prisma.PurchaseReceiptPaymentsCreateWithoutBankAccountInput, Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutBankAccountInput>
}
export type PurchaseReceiptPaymentsCreateManyBankAccountInputEnvelope = {
data: Prisma.PurchaseReceiptPaymentsCreateManyBankAccountInput | Prisma.PurchaseReceiptPaymentsCreateManyBankAccountInput[]
skipDuplicates?: boolean
}
export type PurchaseReceiptPaymentsUpsertWithWhereUniqueWithoutBankAccountInput = {
where: Prisma.PurchaseReceiptPaymentsWhereUniqueInput
update: Prisma.XOR<Prisma.PurchaseReceiptPaymentsUpdateWithoutBankAccountInput, Prisma.PurchaseReceiptPaymentsUncheckedUpdateWithoutBankAccountInput>
create: Prisma.XOR<Prisma.PurchaseReceiptPaymentsCreateWithoutBankAccountInput, Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutBankAccountInput>
}
export type PurchaseReceiptPaymentsUpdateWithWhereUniqueWithoutBankAccountInput = {
where: Prisma.PurchaseReceiptPaymentsWhereUniqueInput
data: Prisma.XOR<Prisma.PurchaseReceiptPaymentsUpdateWithoutBankAccountInput, Prisma.PurchaseReceiptPaymentsUncheckedUpdateWithoutBankAccountInput>
}
export type PurchaseReceiptPaymentsUpdateManyWithWhereWithoutBankAccountInput = {
where: Prisma.PurchaseReceiptPaymentsScalarWhereInput
data: Prisma.XOR<Prisma.PurchaseReceiptPaymentsUpdateManyMutationInput, Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutBankAccountInput>
}
export type PurchaseReceiptPaymentsScalarWhereInput = {
AND?: Prisma.PurchaseReceiptPaymentsScalarWhereInput | Prisma.PurchaseReceiptPaymentsScalarWhereInput[]
OR?: Prisma.PurchaseReceiptPaymentsScalarWhereInput[]
NOT?: Prisma.PurchaseReceiptPaymentsScalarWhereInput | Prisma.PurchaseReceiptPaymentsScalarWhereInput[]
id?: Prisma.IntFilter<"PurchaseReceiptPayments"> | number
amount?: Prisma.DecimalFilter<"PurchaseReceiptPayments"> | runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod?: Prisma.EnumPaymentMethodTypeFilter<"PurchaseReceiptPayments"> | $Enums.PaymentMethodType
type?: Prisma.EnumPaymentTypeFilter<"PurchaseReceiptPayments"> | $Enums.PaymentType
bankAccountId?: Prisma.IntFilter<"PurchaseReceiptPayments"> | number
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 PurchaseReceiptPaymentsCreateWithoutReceiptInput = { export type PurchaseReceiptPaymentsCreateWithoutReceiptInput = {
amount: runtime.Decimal | runtime.DecimalJsLike | number | string amount: runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod: $Enums.PaymentMethodType paymentMethod: $Enums.PaymentMethodType
type: $Enums.PaymentType type: $Enums.PaymentType
bankAccountId: number
payedAt: Date | string payedAt: Date | string
description?: string | null description?: string | null
createdAt?: Date | string createdAt?: Date | string
bankAccount: Prisma.BankAccountCreateNestedOneWithoutPurchaseReceiptPaymentsInput
} }
export type PurchaseReceiptPaymentsUncheckedCreateWithoutReceiptInput = { export type PurchaseReceiptPaymentsUncheckedCreateWithoutReceiptInput = {
@@ -564,19 +670,47 @@ export type PurchaseReceiptPaymentsUpdateManyWithWhereWithoutReceiptInput = {
data: Prisma.XOR<Prisma.PurchaseReceiptPaymentsUpdateManyMutationInput, Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutReceiptInput> data: Prisma.XOR<Prisma.PurchaseReceiptPaymentsUpdateManyMutationInput, Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutReceiptInput>
} }
export type PurchaseReceiptPaymentsScalarWhereInput = { export type PurchaseReceiptPaymentsCreateManyBankAccountInput = {
AND?: Prisma.PurchaseReceiptPaymentsScalarWhereInput | Prisma.PurchaseReceiptPaymentsScalarWhereInput[] id?: number
OR?: Prisma.PurchaseReceiptPaymentsScalarWhereInput[] amount: runtime.Decimal | runtime.DecimalJsLike | number | string
NOT?: Prisma.PurchaseReceiptPaymentsScalarWhereInput | Prisma.PurchaseReceiptPaymentsScalarWhereInput[] paymentMethod: $Enums.PaymentMethodType
id?: Prisma.IntFilter<"PurchaseReceiptPayments"> | number type: $Enums.PaymentType
amount?: Prisma.DecimalFilter<"PurchaseReceiptPayments"> | runtime.Decimal | runtime.DecimalJsLike | number | string receiptId: number
paymentMethod?: Prisma.EnumPaymentMethodTypeFilter<"PurchaseReceiptPayments"> | $Enums.PaymentMethodType payedAt: Date | string
type?: Prisma.EnumPaymentTypeFilter<"PurchaseReceiptPayments"> | $Enums.PaymentType description?: string | null
bankAccountId?: Prisma.IntFilter<"PurchaseReceiptPayments"> | number createdAt?: Date | string
receiptId?: Prisma.IntFilter<"PurchaseReceiptPayments"> | number }
payedAt?: Prisma.DateTimeFilter<"PurchaseReceiptPayments"> | Date | string
description?: Prisma.StringNullableFilter<"PurchaseReceiptPayments"> | string | null export type PurchaseReceiptPaymentsUpdateWithoutBankAccountInput = {
createdAt?: Prisma.DateTimeFilter<"PurchaseReceiptPayments"> | Date | string amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType
type?: Prisma.EnumPaymentTypeFieldUpdateOperationsInput | $Enums.PaymentType
payedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
receipt?: Prisma.PurchaseReceiptUpdateOneRequiredWithoutPaymentsNestedInput
}
export type PurchaseReceiptPaymentsUncheckedUpdateWithoutBankAccountInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number
amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType
type?: Prisma.EnumPaymentTypeFieldUpdateOperationsInput | $Enums.PaymentType
receiptId?: Prisma.IntFieldUpdateOperationsInput | number
payedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}
export type PurchaseReceiptPaymentsUncheckedUpdateManyWithoutBankAccountInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number
amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType
type?: Prisma.EnumPaymentTypeFieldUpdateOperationsInput | $Enums.PaymentType
receiptId?: Prisma.IntFieldUpdateOperationsInput | number
payedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
} }
export type PurchaseReceiptPaymentsCreateManyReceiptInput = { export type PurchaseReceiptPaymentsCreateManyReceiptInput = {
@@ -594,10 +728,10 @@ export type PurchaseReceiptPaymentsUpdateWithoutReceiptInput = {
amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType
type?: Prisma.EnumPaymentTypeFieldUpdateOperationsInput | $Enums.PaymentType type?: Prisma.EnumPaymentTypeFieldUpdateOperationsInput | $Enums.PaymentType
bankAccountId?: Prisma.IntFieldUpdateOperationsInput | number
payedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string payedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
bankAccount?: Prisma.BankAccountUpdateOneRequiredWithoutPurchaseReceiptPaymentsNestedInput
} }
export type PurchaseReceiptPaymentsUncheckedUpdateWithoutReceiptInput = { export type PurchaseReceiptPaymentsUncheckedUpdateWithoutReceiptInput = {
@@ -635,6 +769,7 @@ export type PurchaseReceiptPaymentsSelect<ExtArgs extends runtime.Types.Extensio
description?: boolean description?: boolean
createdAt?: boolean createdAt?: boolean
receipt?: boolean | Prisma.PurchaseReceiptDefaultArgs<ExtArgs> receipt?: boolean | Prisma.PurchaseReceiptDefaultArgs<ExtArgs>
bankAccount?: boolean | Prisma.BankAccountDefaultArgs<ExtArgs>
}, ExtArgs["result"]["purchaseReceiptPayments"]> }, ExtArgs["result"]["purchaseReceiptPayments"]>
@@ -654,12 +789,14 @@ export type PurchaseReceiptPaymentsSelectScalar = {
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 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> = { export type PurchaseReceiptPaymentsInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
receipt?: boolean | Prisma.PurchaseReceiptDefaultArgs<ExtArgs> receipt?: boolean | Prisma.PurchaseReceiptDefaultArgs<ExtArgs>
bankAccount?: boolean | Prisma.BankAccountDefaultArgs<ExtArgs>
} }
export type $PurchaseReceiptPaymentsPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = { export type $PurchaseReceiptPaymentsPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
name: "PurchaseReceiptPayments" name: "PurchaseReceiptPayments"
objects: { objects: {
receipt: Prisma.$PurchaseReceiptPayload<ExtArgs> receipt: Prisma.$PurchaseReceiptPayload<ExtArgs>
bankAccount: Prisma.$BankAccountPayload<ExtArgs>
} }
scalars: runtime.Types.Extensions.GetPayloadResult<{ scalars: runtime.Types.Extensions.GetPayloadResult<{
id: number id: number
@@ -1012,6 +1149,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> { 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" readonly [Symbol.toStringTag]: "PrismaPromise"
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> 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>
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>
/** /**
* Attaches callbacks for the resolution and/or rejection of the Promise. * Attaches callbacks for the resolution and/or rejection of the Promise.
* @param onfulfilled The callback to execute when the Promise is resolved. * @param onfulfilled The callback to execute when the Promise is resolved.
@@ -45,6 +45,9 @@ export class SuppliersService {
omit: { omit: {
supplierId: true, supplierId: true,
}, },
orderBy: {
createdAt: 'desc',
},
}) })
return ResponseMapper.list(items) return ResponseMapper.list(items)
} }
@@ -90,10 +90,35 @@ export class SupplierInvoicesService {
}, },
}, },
}, },
bankAccount: {
select: {
branch: {
select: {
id: true,
name: true,
bank: {
select: {
id: true,
name: true,
shortName: true,
},
},
},
},
accountNumber: true,
cardNumber: true,
name: true,
id: true,
iban: true,
},
},
}, },
omit: { omit: {
receiptId: true, receiptId: true,
}, },
orderBy: {
payedAt: 'desc',
},
}) })
return ResponseMapper.list(items) return ResponseMapper.list(items)
} }
@@ -123,15 +148,21 @@ export class SupplierInvoicesService {
} }
async createPayment(invoiceId: number, data: CreateReceiptPaymentDto) { async createPayment(invoiceId: number, data: CreateReceiptPaymentDto) {
const { bankAccountId, ...rest } = data
const payment = await this.prisma.purchaseReceiptPayments.create({ const payment = await this.prisma.purchaseReceiptPayments.create({
data: { data: {
...data, ...rest,
payedAt: new Date(data.payedAt), payedAt: new Date(data.payedAt),
receipt: { receipt: {
connect: { connect: {
id: invoiceId, id: invoiceId,
}, },
}, },
bankAccount: {
connect: {
id: bankAccountId,
},
},
}, },
include: { include: {
receipt: true, receipt: true,