refactor: banking modules to nestjs

This commit is contained in:
Ahmed Bouhuolia
2025-01-06 11:45:58 +02:00
parent ba176394c8
commit 2bf58d9cb4
22 changed files with 172 additions and 60 deletions

View File

@@ -12,6 +12,7 @@ import { BaseModel } from '@/models/Model';
import { ItemEntry } from '@/modules/TransactionItemEntry/models/ItemEntry';
import { BillLandedCost } from '@/modules/BillLandedCosts/models/BillLandedCost';
import { DiscountType } from '@/common/types/Discount';
import { Knex } from 'knex';
export class Bill extends BaseModel {
public amount: number;
@@ -615,7 +616,7 @@ export class Bill extends BaseModel {
return notFoundBillsIds;
}
static changePaymentAmount(billId, amount, trx) {
static changePaymentAmount(billId, amount, trx: Knex.Transaction) {
const changeMethod = amount > 0 ? 'increment' : 'decrement';
return this.query(trx)
.where('id', billId)