Assist_Design/apps/bff/src/catalog/catalog.controller.ts

38 lines
1.3 KiB
TypeScript
Raw Normal View History

2025-08-27 10:54:05 +09:00
import { Controller, Get, UseGuards, Request } from "@nestjs/common";
2025-08-21 15:24:40 +09:00
import { CatalogService } from "./catalog.service";
2025-08-22 17:02:49 +09:00
import { ApiTags, ApiOperation, ApiBearerAuth } from "@nestjs/swagger";
import { JwtAuthGuard } from "../auth/guards/jwt-auth.guard";
2025-08-27 10:54:05 +09:00
import { RequestWithUser } from "../auth/auth.types";
2025-08-21 15:24:40 +09:00
@ApiTags("catalog")
@Controller("catalog")
2025-08-22 17:02:49 +09:00
@UseGuards(JwtAuthGuard)
@ApiBearerAuth()
export class CatalogController {
constructor(private catalogService: CatalogService) {}
@Get()
2025-08-22 17:02:49 +09:00
@ApiOperation({ summary: "Get product catalog (authenticated users only)" })
async getCatalog() {
return this.catalogService.getProducts();
}
2025-08-27 10:54:05 +09:00
@Get('personalized')
@ApiOperation({ summary: "Get personalized product catalog based on customer eligibility" })
async getPersonalizedCatalog(@Request() req: RequestWithUser) {
return this.catalogService.getPersonalizedProducts(req.user.id);
}
@Get('internet/addons')
@ApiOperation({ summary: "Get Internet add-on products (Hikari Denwa, etc.)" })
async getInternetAddons() {
return this.catalogService.getInternetAddons();
}
@Get('internet/installations')
@ApiOperation({ summary: "Get Internet installation options with pricing" })
async getInternetInstallations() {
return this.catalogService.getInternetInstallations();
}
}