Add fococoffee endpoints

This commit is contained in:
2024-04-05 16:43:44 -06:00
parent 6084054590
commit e07f34137d
8 changed files with 224 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
import { Controller, Get } from '@nestjs/common';
import { HarbingerService } from './harbinger.service';
import { FocoCoffeeService } from './fococoffee.service';
import { LimaService } from './lima.service';
import { BindleService } from './bindle.service';
import { ApiResponse, ApiTags } from '@nestjs/swagger';
@Controller('fococoffee')
@ApiTags('fococoffee')
export class FocoCoffeeController {
constructor(
private readonly focoCoffeeService: FocoCoffeeService,
private readonly harbingerService: HarbingerService,
private readonly limaService: LimaService,
private readonly bindleService: BindleService
) { }
@Get('harbinger/products')
@ApiResponse({ status: 200, description: 'Returns the list of Harbinger products' })
async getHarbingerProducts() {
return this.harbingerService.fetchProducts()
}
@Get('lima/products')
@ApiResponse({ status: 200, description: 'Returns the list of Lima products' })
async getLimaProducts() {
return this.limaService.fetchProducts()
}
@Get('bindle/products')
@ApiResponse({ status: 200, description: 'Returns the list of Bindle products' })
async getBindleProducts() {
return this.bindleService.fetchProducts()
}
@Get('beans')
@ApiResponse({ status: 200, description: 'Returns the list of coffee bean products from all suppliers' })
async getBeans() {
return this.focoCoffeeService.getBeans()
}
@Get('products')
@ApiResponse({ status: 200, description: 'Returns the list of all products from all suppliers' })
async getAllProducts() {
return this.focoCoffeeService.getAllProducts()
}
}