feat(pos): update createOrder method to accept posId and retrieve inventoryId

This commit is contained in:
2025-12-28 17:52:07 +03:30
parent af9695e23c
commit b35a3633ed
3 changed files with 20 additions and 8 deletions
+7 -1
View File
@@ -173,7 +173,13 @@ export class PosService {
return ResponseMapper.list(categories)
}
async createOrder(data: CreateOrderDto, inventoryId: number) {
async createOrder(posId: number, data: CreateOrderDto) {
const pos = await this.prisma.posAccount.findUniqueOrThrow({
where: { id: posId },
select: { inventoryId: true },
})
const inventoryId = pos.inventoryId
const { customerId, ...res } = data
const preparedOrder = { ...res } as any
const lastCode = await this.prisma.salesInvoice