pos-be/src/modules/configuration/constant/infrastructure/constant.controller.ts

35 lines
1.0 KiB
TypeScript

import { Controller, Get } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { Public } from 'src/core/guards';
import { STATUS } from 'src/core/strings/constants/base.constants';
import { ItemType } from 'src/modules/item-related/item-category/constants';
import { LimitType } from 'src/modules/item-related/item/constants';
import { PaymentMethodType } from 'src/modules/transaction/payment-method/constants';
@ApiTags('configuration - constant')
@Controller('constant')
@Public(true)
export class ConstantController {
constructor() {}
@Get('master-data-status')
async masterDataStatus(): Promise<any> {
return [STATUS.ACTIVE, STATUS.DRAFT, STATUS.INACTIVE];
}
@Get('category-item-type')
async categoryType(): Promise<any> {
return Object.values(ItemType);
}
@Get('item-limit-type')
async limitType(): Promise<any> {
return Object.values(LimitType);
}
@Get('payment-type')
async paymentMethodType(): Promise<any> {
return Object.values(PaymentMethodType);
}
}