init
This commit is contained in:
@@ -1,34 +0,0 @@
|
||||
import { Controller, Get, Param, Query } from '@nestjs/common'
|
||||
import { PosService } from './pos.service'
|
||||
|
||||
@Controller('pos')
|
||||
export class PosController {
|
||||
constructor(private readonly posService: PosService) {}
|
||||
|
||||
@Get('/:posId')
|
||||
getInfo(@Param('posId') posId: string) {
|
||||
return this.posService.getInfo(Number(posId))
|
||||
}
|
||||
|
||||
@Get('/:posId/stock')
|
||||
async getStock(
|
||||
@Param('posId') posId: string,
|
||||
@Query('isAvailable') isAvailable?: string,
|
||||
@Query('page') page?: string,
|
||||
@Query('pageSize') pageSize?: string,
|
||||
@Query('q') q?: string,
|
||||
) {
|
||||
const options = {
|
||||
isAvailable: isAvailable ? isAvailable === 'true' : undefined,
|
||||
page: page ? Number(page) : undefined,
|
||||
pageSize: pageSize ? Number(pageSize) : undefined,
|
||||
q,
|
||||
}
|
||||
return this.posService.getStock(Number(posId), options)
|
||||
}
|
||||
|
||||
@Get('/:posId/product-categories')
|
||||
async getProductCategories(@Param('posId') posId: string) {
|
||||
return this.posService.getProductCategories(Number(posId))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user