import { TypeOfValue } from "../types";
const createPath = (name: string) => {
  const preFix = "/saturn";
  return `${preFix}${name}`;
};

export const PATH = {
  /** 用户基本信息 */
  LOGIN: createPath("/login"),
  /** 用户基本信息 */
  USERINFO: createPath("/userinfo"),
  /** 认证页 */
  AUTHENTICATION: createPath("/authentication/:type"),
  /** 用户信息修改 */
  INFO_EDIT: createPath("/userinfo/edit/:type"),
  /** 费用管理 */
  COST_MANAGE: createPath("/cost"),
  /** 交易详细记录 */
  CONST_HISTORY: createPath("/cost/history"),
  /** 充值 */
  CONST_RECHARGE: createPath("/cost/recharge"),
  /** 提现 */
  CONST_WITHDRAWAL: createPath("/cost/withdrawal"),
  /** 发票管理 */
  INVOICE_MANAGE: createPath("/invoice"),
  /** 合同管理 */
  CONTRACT_MANAGE: createPath("/contract"),
};

/** 排序方式 */
export const SORT = {
  /** 升序 */
  ASC: {
    value: 1,
    code: "asc",
  },
  /** 降序 */
  DESC: {
    value: -1,
    code: "desc",
  },
} as const;

/** 排序方式枚举类型 */
export type SORT_TYPE = TypeOfValue<typeof SORT>["value"];
export type SORT_CODE_TYPE = TypeOfValue<typeof SORT>["code"];

/** 认证类型 */
export const AUTH = {
  PERSONAL: {
    value: 1,
    code: "personal",
    cname: "个人",
  },
  COMPANY: {
    value: 2,
    code: "company",
    cname: "企业",
  },
} as const;
export type AUTH_TYPE_CODE = TypeOfValue<typeof AUTH>["code"];

/** 认证状态 */
export const AUTH_STATUS = {
  /** 已认证 */
  RESOLVE: {
    value: 1,
    cname: "已认证",
  },
  /** 未认证 */
  REJECT: {
    value: 0,
    cname: "未认证",
  },
} as const;
/** 认证状态枚举类型 */
export type AUTH_STATUS_TYPE = TypeOfValue<typeof AUTH_STATUS>["value"];

/** 充值方式 */
export const PAY = {
  /** 已认证 */
  ALI: {
    value: 1,
    cname: "支付宝",
  },
  /** 未认证 */
  WECHAT: {
    value: 2,
    cname: "微信",
  },
} as const;
/** 认证状态枚举类型 */
export type PAY_TYPE = TypeOfValue<typeof PAY>["value"];

/** 证件类型 */
export const PERSONAL_CER = {
  ID_CARD: {
    value: 1,
    cname: "身份证",
  },
};
export type PERSONAL_CER_TYPE = TypeOfValue<typeof PERSONAL_CER>["value"];

/** 企业证件类型 */
export const COMPANY_CER = {
  BUSINESS: {
    value: 1,
    cname: "营业执照",
  },
};
export type COMPANY_CER_TYPE = TypeOfValue<typeof COMPANY_CER>["value"];

/** 验证码发送类型 */
export const V_CODE_SEND = {
  /** 注册 */
  REGISTER: {
    value: 1,
  },
  /** 更改密码 */
  UPDATE_PASSWORD: {
    value: 2,
  },
  /** 重置/忘记密码 */
  RESET_PASSWORD: {
    value: 3,
  },
  /** 官网中的联系我们 */
  ABOUT: {
    value: 4,
  },
  /** 企业认证 */
  COMPANY_AUTH: {
    value: 5,
  },
  /** 个人认证 */
  PERSONAL_AUTH: {
    value: 6,
  },
} as const;
/** 验证码发送类型枚举 */
export type V_CODE_SEND_TYPE = TypeOfValue<typeof V_CODE_SEND>["value"];

/** 发票类型 */
export const INVOICE = {
  /** 增值税普通发票 */
  VAT_NORMAL: {
    value: 1,
    cname: "增值税普通发票",
  },
} as const;
/** 发票类型枚举 */
export type INVOICE_TYPE = TypeOfValue<typeof INVOICE>["value"];

/** 发票状态 */
export const INVOICE_STATUS = {
  /** 处理中 */
  PENDING: {
    value: 1,
    cname: "处理中",
  },
} as const;
/** 发票类型枚举 */
export type INVOICE_STATUS_TYPE = TypeOfValue<typeof INVOICE_STATUS>["value"];
