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
+3 -5
View File
@@ -33,10 +33,8 @@ export class PosController {
return this.posService.getProductCategories(Number(posId))
}
@Post('/orders/create')
async createOrder(@Body() dto: CreateOrderDto) {
const inventoryId = await this.posService.getDefaultInventoryId()
return this.posService.createOrder(dto, inventoryId!)
@Post('/:posId/orders/create')
async createOrder(@Param('posId') posId: string, @Body() dto: CreateOrderDto) {
return this.posService.createOrder(Number(posId), dto)
}
}