cbe51b9343
- Added BankAccountsController, BankAccountsService, and related DTOs for managing bank accounts. - Implemented BankBranchesController, BankBranchesService, and related DTOs for managing bank branches. - Created BanksController and BanksService for retrieving bank information. - Integrated Prisma for database operations across all modules. - Added response mapping for consistent API responses.
33 lines
906 B
TypeScript
33 lines
906 B
TypeScript
import { Body, Controller, Get, Post } from '@nestjs/common'
|
|
import { CreateOrderDto } from './dto/create-pos.dto'
|
|
import { PosService } from './pos.service'
|
|
|
|
@Controller('pos')
|
|
export class PosController {
|
|
constructor(private readonly posService: PosService) {}
|
|
|
|
@Get()
|
|
getInfo() {
|
|
return this.posService.getInfo()
|
|
}
|
|
|
|
@Get('/stock')
|
|
async getStock() {
|
|
const inventoryId = await this.posService.getDefaultInventoryId()
|
|
return this.posService.getStock(inventoryId!)
|
|
}
|
|
|
|
@Get('/product-categories')
|
|
async getProductCategories() {
|
|
const inventoryId = await this.posService.getDefaultInventoryId()
|
|
return this.posService.getProductCategories(inventoryId!)
|
|
}
|
|
|
|
@Post('/orders/create')
|
|
async createOrder(@Body() dto: CreateOrderDto) {
|
|
const inventoryId = await this.posService.getDefaultInventoryId()
|
|
|
|
return this.posService.createOrder(dto, inventoryId!)
|
|
}
|
|
}
|