chore: complete the the invoice module - not tested
This commit is contained in:
@@ -12,16 +12,16 @@ import { Roles } from "../../common/decorators/roles.decorator";
|
||||
import { ParamDto } from "../../common/DTO/param.dto";
|
||||
import { RoleEnum } from "../users/enums/role.enum";
|
||||
|
||||
@Controller("services")
|
||||
@Controller("danak-services")
|
||||
@ApiTags("Danak-Services")
|
||||
export class DanakServicesController {
|
||||
constructor(private readonly danakServicesService: DanakServicesService) {}
|
||||
|
||||
//
|
||||
//------------------------ service categories ------------------------
|
||||
@AuthGuards()
|
||||
@Roles(RoleEnum.ADMIN)
|
||||
@ApiOperation({ summary: "Create a new service category => admin route" })
|
||||
@Post("category")
|
||||
@Post("categories")
|
||||
createCategory(@Body() createDto: CreateCategoryDto) {
|
||||
return this.danakServicesService.createCategory(createDto);
|
||||
}
|
||||
@@ -29,7 +29,7 @@ export class DanakServicesController {
|
||||
@AuthGuards()
|
||||
@Roles(RoleEnum.ADMIN)
|
||||
@ApiOperation({ summary: "Get all service categories => admin route" })
|
||||
@Get("category")
|
||||
@Get("categories")
|
||||
getCategories(@Query() queryDto: CategorySearchQueryDto) {
|
||||
return this.danakServicesService.getCategories(queryDto);
|
||||
}
|
||||
@@ -38,11 +38,27 @@ export class DanakServicesController {
|
||||
@Roles(RoleEnum.ADMIN)
|
||||
@ApiOperation({ summary: "Get all service categories => admin route" })
|
||||
@Pagination()
|
||||
@Get("category-list")
|
||||
@Get("categories/list")
|
||||
getCategoryList(@Query() queryDto: CategoryListSearchQueryDto) {
|
||||
return this.danakServicesService.getCategoryList(queryDto);
|
||||
}
|
||||
|
||||
@AuthGuards()
|
||||
@Roles(RoleEnum.USER)
|
||||
@ApiOperation({ summary: "Get all service categories user side" })
|
||||
@Get("categories/public")
|
||||
getCategoriesUserSide() {
|
||||
return this.danakServicesService.getCategoriesUserSide();
|
||||
}
|
||||
|
||||
@AuthGuards()
|
||||
@Roles(RoleEnum.USER)
|
||||
@ApiOperation({ summary: "get category services with category id" })
|
||||
@Get("categories/:id/services")
|
||||
getCategoryServices(@Param() paramDto: ParamDto) {
|
||||
return this.danakServicesService.getCategoryServices(paramDto.id);
|
||||
}
|
||||
|
||||
@AuthGuards()
|
||||
@Roles(RoleEnum.ADMIN)
|
||||
@ApiOperation({ summary: "toggle status of categories => admin route" })
|
||||
@@ -51,7 +67,7 @@ export class DanakServicesController {
|
||||
toggleCategoryStatus(@Param() paramDto: ParamDto) {
|
||||
return this.danakServicesService.toggleCategoryStatus(paramDto);
|
||||
}
|
||||
|
||||
//-------------------- service management --------------------------
|
||||
@AuthGuards()
|
||||
@Roles(RoleEnum.ADMIN)
|
||||
@ApiOperation({ summary: "create new danak services => admin route" })
|
||||
@@ -63,7 +79,7 @@ export class DanakServicesController {
|
||||
@AuthGuards()
|
||||
@ApiOperation({ summary: "get all danak services ==> admin route" })
|
||||
@Roles(RoleEnum.ADMIN)
|
||||
@Get("list")
|
||||
@Get()
|
||||
getServices(@Query() queryDto: DanakServicesSearchQueryDto) {
|
||||
return this.danakServicesService.getServicesList(queryDto);
|
||||
}
|
||||
@@ -77,6 +93,22 @@ export class DanakServicesController {
|
||||
return this.danakServicesService.toggleServiceStatus(paramDto);
|
||||
}
|
||||
|
||||
@ApiOperation({ summary: "get services for user side" })
|
||||
@AuthGuards()
|
||||
@Roles(RoleEnum.USER)
|
||||
@Get("suggested")
|
||||
getDanakSuggestServices() {
|
||||
return this.danakServicesService.getDanakSuggestServices();
|
||||
}
|
||||
|
||||
@ApiOperation({ summary: "get danak service by id" })
|
||||
@AuthGuards()
|
||||
@Roles(RoleEnum.USER)
|
||||
@Get(":id")
|
||||
getDanakServiceById(@Param() paramDto: ParamDto) {
|
||||
return this.danakServicesService.getDanakServiceByID(paramDto.id);
|
||||
}
|
||||
|
||||
// @AuthGuards()
|
||||
// @Roles(RoleEnum.USER)
|
||||
// @ApiOperation({ summary: "get all user purchased danak services" })
|
||||
|
||||
Reference in New Issue
Block a user