import type { PageParam } from '@/api';

/**
 * 商城设置
 */
export interface ShopSetting {
  // 设置ID
  settingId?: number;
  // 设置分类: basic/order/points/dealer/notify/payment
  category?: string;
  // 设置项标识
  settingKey?: string;
  // 设置项名称
  settingName?: string;
  // 设置值（JSON格式）
  settingValue?: string;
  // 设置类型: string/number/boolean/json
  valueType?: string;
  // 设置说明
  description?: string;
  // 排序号
  sortNumber?: number;
  // 是否启用 0否 1是
  isEnabled?: number;
  // 是否公开（前端可读）0否 1是
  isPublic?: number;
  // 租户id
  tenantId?: number;
  // 创建时间
  createdTime?: number;
  // 更新时间
  updatedTime?: number;

  /* ——— 基础设置 ——— */
  shopName?: string;
  shopLogo?: string;
  shopDesc?: string;
  shopPhone?: string;
  shopAddress?: string;
  shopEnabled?: boolean | number;

  /* ——— 订单设置 ——— */
  orderAutoConfirmDays?: number;
  orderAutoCloseMins?: number;
  orderAutoCommentDays?: number;
  orderFreightFreeAmount?: number;
  orderRefundEnabled?: boolean | number;

  /* ——— 积分设置 ——— */
  pointsEnabled?: boolean | number;
  pointsSigninEnabled?: boolean | number;
  pointsSigninAmount?: number;
  pointsOrderRate?: number;
  pointsExchangeRate?: number;

  /* ——— 分销设置 ——— */
  dealerEnabled?: boolean | number;
  dealerApplyEnabled?: boolean | number;
  dealerLevel1Rate?: number;
  dealerLevel2Rate?: number;
  dealerWithdrawMin?: number;

  /* ——— 通知设置 ——— */
  notifyOrderEnabled?: boolean | number;
  notifyPayEnabled?: boolean | number;
  notifyRefundEnabled?: boolean | number;
  notifyShipEnabled?: boolean | number;
  notifySignEnabled?: boolean | number;

  /* ——— 支付设置 ——— */
  payWechatEnabled?: boolean | number;
  payWechatAppId?: string;
  payWechatMchId?: string;
  payWechatApiKey?: string;
  payAlipayEnabled?: boolean | number;
  payAlipayAppId?: string;
  payAlipayPrivateKey?: string;
  payAlipayPublicKey?: string;
  payBalanceEnabled?: boolean | number;
}

/**
 * 商城设置搜索条件
 */
export interface ShopSettingParam extends PageParam {
  settingId?: number;
  category?: string;
  settingKey?: string;
  keywords?: string;
}
