export interface SubmitApprovalRequestData {
  orderGoodsId: number
  returnQuantity: number
  returnImages: string
  returnRemark: string
  corpid: string
  applyUserid: string
}

export interface HandleApprovalRequestData {
  /** 审批ID */
  approvalId: number
  /** 审批状态 */
  status: number
  returnAmount: number
  auditImages: string
  auditRemark: string
  userid: string
  corpid: string
  auditUserid: string
}

export interface HandleApprovalAssetRequestData extends HandleApprovalRequestData {
  /** 审批商品ID */
  approvalGoodsList: ApprovalGoodsEntity[]
}

export interface SearchApiReturnApprovalQuery {
  pageNum: number
  pageSize: number
  approvalId?: number
  orderId?: number
  goodsId?: number
  status?: number
  startTime?: string
  endTime?: string
  approvalType?: number
  corpid?: string
  handleStatus?: number;
  searchStr?: string;
}

export interface ApiResponsePageData<T> {
  code: number
  msg: string
  data: {
    total: number
    rows: T[]
  }
}

export interface ReturnApprovalEntity {
  /** 审批编号 */
  approvalId: number
  /** 关联订单ID */
  orderId: number
  /** 关联商品ID */
  goodsId: number
  /** 关联订单商品ID */
  orderGoodsId: number
  /** 外部归属类型的商品ID */
  externalGoodsId?: number
  /** 外部归属类型的审批ID */
  externalApprovalId?: number
  /** 审批码 */
  code?: string
  /** 审批码校验状态(0未核销 1已核销) */
  codeCheck?: number
  /** 企业微信id */
  corpid?: string
  /** 申请人企业UserID */
  applyUserid?: string
  /** 申请人姓名 */
  applyUserName?: string
  /** 审批人企业UserID */
  auditUserid?: string
  /** 申请数量 */
  applyQuantity?: number
  /** 审批类型（0为借还柜 1为固资通） */
  approvalType?: number
  /** 申请说明 */
  applyRemark?: string
  /** 归还数量 */
  returnQuantity: number
  /** 商品单价 */
  goodsPrice: number
  /** 退还金额 */
  returnAmount: number
  /** 归还图片路径数组 */
  returnImages: string
  /** 审核图片路径数组 */
  auditImages: string
  /** 归还说明 */
  returnRemark: string
  /** 审核说明 */
  auditRemark: string
  /** 审批人姓名 */
  auditName: string
  /** 审批状态(1待审核 2已通过 3已驳回 4开柜中) */
  status: number
  /** 审批时间 */
  approvalTime?: string
  createTime: string
  updateTime: string
  /** 商品名称 */
  goodsName: string
  /** 封面图URL */
  coverImg: string
  /** 手机号码 */
  mobile: string
  /** 企业微信用户ID或汇邦云用户ID */
  userid: string
  /** 用户姓名 */
  name: string
  /** 是否内部用户（0否 1汇邦云用户 2企业微信用户） */
  isInternal: number
  /** 支付方式 */
  paymentMethod?: string
}

export interface ApprovalGoodsEntity {
  approvalGoodsId: number;
  approvalId: number;
  goodsName: string;
  goodsId: number;
  externalGoodsId?: number;
  corpid?: string;
  belongType: number;
  price: number;
  applyQuantity: number;
  approvalQuantity?: number;
  coverImg?: string;
}

export interface ReturnApprovalAssetDTO extends ReturnApprovalEntity {
  goodsList?: ApprovalGoodsEntity[];
}

export interface ReturnApprovalDetailDTO extends ReturnApprovalAssetDTO {
  statusStr: string;
  approvalGoodsCellList?: ApprovalGoodsCellEntity[];
}

export interface SearchReturnApprovalAssetQuery {
  pageNum: number;
  pageSize: number;
  approvalId?: number;
  orderId?: number;
  goodsId?: number;
  status?: number;
  startTime?: string;
  endTime?: string;
  approvalType?: number;
  corpid?: string;
  code?: string;
  codeCheck?: number;
  handleStatus?: number;
  searchStr?: string;
}

export interface ApprovalGoodsCellEntity {
  /** 主键ID */
  approvalGoodsCellId: number;
  /** 审批ID */
  approvalId: number;
  /** 申请领用商品ID */
  approvalGoodsId: number;
  /** 商店ID */
  shopId: number;
  /** 柜机ID */
  cabinetId: number;
  /** 格口ID */
  cellId: number;
  /** 分配数量 */
  allocateQuantity: number;
  /** 商店名称 */
  shopName: string;
  /** 柜机名称 */
  cabinetName: string;
  /** 格口号 */
  cellNo: number;
}

export type SubmitApprovalResponseData = ApiResponseMsgData<{
  approvalId: number
  status: number
}>