Files
sase.tr/apps/api/src/plans/plans.controller.ts
Fusion f4fea1e429
Some checks failed
Sync dev → Gitea / Mirror dev to Gitea (push) Has been cancelled
feat(FN-094): add comment line for deployment verification
- Added a comment line to main.ts for deployment verification purposes
2026-05-11 02:07:03 +00:00

42 lines
1.0 KiB
TypeScript

import { Body, Controller, Get, Param, Patch, Post, UseGuards } from "@nestjs/common";
import { Public } from "../common/decorators/public.decorator";
import { Roles } from "../common/decorators/roles.decorator";
import { RolesGuard } from "../common/guards/roles.guard";
import { PlansService } from "./plans.service";
@Controller("plans")
export class PlansController {
constructor(private plansService: PlansService) {}
@Get()
@Public()
async findAll() {
return this.plansService.findAll();
}
@Post()
@UseGuards(RolesGuard)
@Roles("admin")
async create(
@Body() body: { name: string; brandCount: number; priceMonthly: number; priceYearly: number },
) {
return this.plansService.create(body);
}
@Patch(":id")
@UseGuards(RolesGuard)
@Roles("admin")
async update(
@Param("id") id: string,
@Body() body: {
name?: string;
brandCount?: number;
priceMonthly?: number;
priceYearly?: number;
isActive?: boolean;
},
) {
return this.plansService.update(id, body);
}
}