feat(pos): update createOrder method to accept posId and retrieve inventoryId
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user