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

60 lines
1.7 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';
import { RefundType } from 'src/modules/transaction/refund/constants';
import { GateType } from 'src/modules/web-information/gate/constants';
@ApiTags('configuration - constant')
@Controller('v1/constant')
@Public(true)
export class ConstantController {
@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);
}
@Get('transaction-user-type')
async userType(): Promise<any> {
return ['group', 'vip'];
}
@Get('transaction-payment-type')
async transactionPaymentType(): Promise<any> {
return ['midtrans', 'bank transfer', 'qris', 'counter'];
}
@Get('transaction-type')
async transactionType(): Promise<any> {
return ['counter', 'admin', 'online'];
}
@Get('refund-type')
async refundType(): Promise<any> {
return Object.values(RefundType);
}
@Get('gate-type')
async gateType(): Promise<any> {
return Object.values(GateType);
}
}