package com.erp.aftersale.dto.response;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class AfterSaleResponse {

    private Long id;
    private String shortId;
    private Long orderId;
    private String orderShortId;
    private String platformOrderSn;
    private Long shopId;
    private String shopName;
    private Long customerId;
    private String customerName;
    private String customerPhone;

    // 类型与原因
    private String type;
    private String typeDesc;
    private String reason;
    private String reasonDetail;
    private String description;

    // 金额
    private BigDecimal applyAmount;
    private BigDecimal approveAmount;
    private BigDecimal freightRefund;
    private BigDecimal actualRefund;

    // 状态
    private String status;
    private String statusDesc;
    private String auditStatus;
    private String auditStatusDesc;
    private String previousStatus;

    // 审核
    private String auditComment;
    private Long auditorId;
    private String auditorName;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime auditTime;

    // 退款/收货
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime refundTime;
    private String returnTrackingNo;
    private String returnExpressCompany;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime receiveTime;
    private String receiveComment;

    // 完成/关闭
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime completeTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime closeTime;
    private String closeReason;

    // 图片
    private List<String> images;

    // 关联
    private Long exchangeOrderId;
    private Long repairOrderId;
    private Long financeRefundId;

    // 审计
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createdAt;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updatedAt;

    // 明细
    private List<AfterSaleItemResponse> items;
}
