Files
psp_api/src/modules/pos/pos.controller.ts
T
ahasani cbe51b9343 feat: implement bank accounts, branches, and banks modules with CRUD operations
- 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.
2025-12-24 21:24:59 +03:30

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!)
}
}