swagger
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
||||
Post,
|
||||
UseGuards,
|
||||
} from '@nestjs/common';
|
||||
import { ApiBearerAuth, ApiTags } from '@nestjs/swagger';
|
||||
import { CurrentUser } from '../auth/decorators/current-user.decorator';
|
||||
import { Permissions } from '../auth/decorators/permissions.decorator';
|
||||
import { Roles } from '../auth/decorators/roles.decorator';
|
||||
@@ -19,7 +20,10 @@ import { AllowWithoutSubscription } from '../auth/decorators/allow-without-subsc
|
||||
import { PurchaseSmsPackageDto } from './dto/purchase-sms-package.dto';
|
||||
import { PurchaseSubscriptionDto } from './dto/purchase-subscription.dto';
|
||||
import { SalonSubscriptionsService } from './salon-subscriptions.service';
|
||||
import { SWAGGER_JWT_AUTH } from '../swagger/swagger.setup';
|
||||
|
||||
@ApiTags('Salon Subscriptions')
|
||||
@ApiBearerAuth(SWAGGER_JWT_AUTH)
|
||||
@Controller('salon-subscriptions')
|
||||
@UseGuards(RolesGuard, PermissionsGuard)
|
||||
export class SalonSubscriptionsController {
|
||||
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
Post,
|
||||
UseGuards,
|
||||
} from '@nestjs/common';
|
||||
import { ApiBearerAuth, ApiTags } from '@nestjs/swagger';
|
||||
import { Public } from '../auth/decorators/public.decorator';
|
||||
import { Permissions } from '../auth/decorators/permissions.decorator';
|
||||
import { Roles } from '../auth/decorators/roles.decorator';
|
||||
@@ -20,7 +21,11 @@ import { AllowWithoutSubscription } from '../auth/decorators/allow-without-subsc
|
||||
import { CreateSmsPackageDto } from './dto/create-sms-package.dto';
|
||||
import { UpdateSmsPackageDto } from './dto/update-sms-package.dto';
|
||||
import { SmsPackagesService } from './sms-packages.service';
|
||||
import { ApiPublicEndpoint } from '../swagger/decorators/swagger-auth.decorator';
|
||||
import { SWAGGER_JWT_AUTH } from '../swagger/swagger.setup';
|
||||
|
||||
@ApiTags('SMS Packages')
|
||||
@ApiBearerAuth(SWAGGER_JWT_AUTH)
|
||||
@Controller('sms-packages')
|
||||
@UseGuards(RolesGuard, PermissionsGuard)
|
||||
export class SmsPackagesController {
|
||||
@@ -35,6 +40,7 @@ export class SmsPackagesController {
|
||||
|
||||
@Public()
|
||||
@AllowWithoutSubscription()
|
||||
@ApiPublicEndpoint('List active SMS packages')
|
||||
@Get()
|
||||
findAll() {
|
||||
return this.smsPackagesService.findAll(true);
|
||||
@@ -42,6 +48,7 @@ export class SmsPackagesController {
|
||||
|
||||
@Public()
|
||||
@AllowWithoutSubscription()
|
||||
@ApiPublicEndpoint('Get SMS package by ID')
|
||||
@Get(':id')
|
||||
findOne(@Param('id', ParseUUIDPipe) id: string) {
|
||||
return this.smsPackagesService.findOne(id);
|
||||
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
Post,
|
||||
UseGuards,
|
||||
} from '@nestjs/common';
|
||||
import { ApiBearerAuth, ApiTags } from '@nestjs/swagger';
|
||||
import { CurrentUser } from '../auth/decorators/current-user.decorator';
|
||||
import { Public } from '../auth/decorators/public.decorator';
|
||||
import { Permissions } from '../auth/decorators/permissions.decorator';
|
||||
@@ -22,7 +23,11 @@ import { AllowWithoutSubscription } from '../auth/decorators/allow-without-subsc
|
||||
import { CreateSubscriptionPlanDto } from './dto/create-subscription-plan.dto';
|
||||
import { UpdateSubscriptionPlanDto } from './dto/update-subscription-plan.dto';
|
||||
import { SubscriptionPlansService } from './subscription-plans.service';
|
||||
import { ApiPublicEndpoint } from '../swagger/decorators/swagger-auth.decorator';
|
||||
import { SWAGGER_JWT_AUTH } from '../swagger/swagger.setup';
|
||||
|
||||
@ApiTags('Subscription Plans')
|
||||
@ApiBearerAuth(SWAGGER_JWT_AUTH)
|
||||
@Controller('subscription-plans')
|
||||
@UseGuards(RolesGuard, PermissionsGuard)
|
||||
export class SubscriptionPlansController {
|
||||
@@ -39,6 +44,7 @@ export class SubscriptionPlansController {
|
||||
|
||||
@Public()
|
||||
@AllowWithoutSubscription()
|
||||
@ApiPublicEndpoint('List active subscription plans')
|
||||
@Get()
|
||||
findAll() {
|
||||
return this.subscriptionPlansService.findAll(true);
|
||||
@@ -46,6 +52,7 @@ export class SubscriptionPlansController {
|
||||
|
||||
@Public()
|
||||
@AllowWithoutSubscription()
|
||||
@ApiPublicEndpoint('Get subscription plan by ID')
|
||||
@Get(':id')
|
||||
findOne(@Param('id', ParseUUIDPipe) id: string) {
|
||||
return this.subscriptionPlansService.findOne(id);
|
||||
|
||||
Reference in New Issue
Block a user