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 {
  RefundReasonType,
  RefundType,
} from 'src/modules/transaction/refund/constants';
import { GateType } from 'src/modules/web-information/gate/constants';
import { InvoiceType } from '../../export/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('refund-reason-type')
  async refundReasonType(): Promise<any> {
    return Object.values(RefundReasonType);
  }

  @Get('gate-type')
  async gateType(): Promise<any> {
    return Object.values(GateType);
  }

  @Get('invoice-type')
  async invoiceType(): Promise<any> {
    return Object.values(InvoiceType);
  }
}
