import { Injectable } from "@nestjs/common"; import { Expenses, Prisma } from "@prisma/client"; import { Decimal } from "@prisma/client/runtime/library"; import { transcode } from "buffer"; import { BaseApprovalService } from "src/common/shared/base-approval.service"; import { PrismaService } from "src/prisma/prisma.service"; @Injectable() export class ExpensesCommandService extends BaseApprovalService { constructor(prisma: PrismaService) { super(prisma); } protected get delegate() { return this.prisma.expenses; } protected delegateFor(transaction: Prisma.TransactionClient){ return transaction.expenses; } async updateApproval(id: number, isApproved: boolean): Promise { return this.prisma.$transaction((transaction) => this.updateApprovalWithTransaction(transaction, id, isApproved), ); } }