package com.neusoft.smart.pos.payment.dto.request;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

@Data
@ApiModel
public class FumaoPosOrderSyncRequest {
    @ApiModelProperty(name = "deviceSN", value = "设备ID,pos机的SN号", dataType = "String", example="213123123",required=true)
    private String deviceSN;

    @ApiModelProperty(name = "memId", value = "富茂会员ID", dataType = "String" ,example="213124578",required=true)
    private String memId;

    @ApiModelProperty(name = "memPhone", value = "富茂会员手机号", dataType = "String" ,example="13500000000",required=true)
    private String memPhone;

    @ApiModelProperty(name = "businessType", value = "交易场景,枚举类型，0核销；1订单交易", dataType = "String",example="1", required=true)
    private String businessType;

    @ApiModelProperty(name = "orderAmount", value = "订单总支付金额,单位分,不能包含小数", dataType = "String",example="1000", required=true)
    private String orderAmount;

    @ApiModelProperty(name = "orderAmountLeft", value = "订单未支付金额,单位分,不能包含小数", dataType = "String",example="1000")
    private String orderAmountLeft;

    @ApiModelProperty(name = "orderNumber", value = "订单编号", dataType = "String",example="125483369874", required=true)
    private String orderNumber;

    @ApiModelProperty(name = "orderTimeOfPlatform", value = "订单创建时间", dataType = "String",example="2020-02-30 21:11:00", required=true)
    private String orderTimeOfPlatform;

    @ApiModelProperty(name = "orderStatus", value = "订单状态: 0有效(支付完成),1取消（退款完成）,根据订单状态处理优惠券", dataType = "String", required=true)
    private String orderStatus;

    @ApiModelProperty(name = "merchantId", value = "富茂的商户ID", dataType = "String" ,example="320833942159982592",required=true)
    private String merchantId;

    @ApiModelProperty(name = "tenantId", value = "富茂的广场ID", dataType = "String" ,example="456",required=true)
    private String tenantId;

    @ApiModelProperty(name = "orderOperatorId", value = "富茂系统登录操作员ID", dataType = "String" ,example="320833942159982521",required=true)
    private String orderOperatorId;

    @ApiModelProperty(name = "paymentDetailList", value = "支付详情", dataType = "List")
    private List<PaymentDetail> paymentDetailList;

    @ApiModelProperty(name = "paymentDetailList", value = "退款详情", dataType = "List")
    private List<RefundDetail> refundDetailList;

    @Data
    @ApiModel
    public static class PaymentDetail {
        private String payment_type;  // 0微信;1支付宝;2现金;3会员折扣;4优惠券;5预付卡;6银行卡;7记账;8东软预付卡
        private String payment_number_of_platform; //东软平台支付订单号,
        private String payment_amount; //支付金额,
        private String payment_order_time; //东软平台支付订单创建时间(yyyyMMddHHmmssSSS),
        private String outer_payment_number; //第三方（微信、支付宝、富茂预付卡）支付订单流水号，富茂优惠券ID，现金、富茂会员折扣和东软预付卡时为空
    }

    @Data
    @ApiModel
    public static class RefundDetail {
        private String payType; //付款方式: 0微信;1支付宝;2现金;3会员折扣;4优惠券;5预付卡;6银行卡;7记账,
        private String payment_number_of_platform;  //东软平台支付订单号,
        private String refund_number_of_platform; //东软平台退款订单号,
        private String refund_amount; //退款金额,
        private String refund_order_time; //东软平台退款订单创建时间,
        private String refund_status; //退款状态:0非手动, 1手动退款, 2手动释放同步,
        private String refund_type; //退款方式: 0微信;1支付宝;2现金;3会员折扣;4优惠券;5预付卡;6银行卡;7记账;
        // 退款方式可以与支付方式不同，但只能是记账，作为线下手动操作退款方式
        private String outer_refund_number; //第三方（微信、支付宝、富茂预付卡）支付订单流水号，富茂优惠券ID，现金和富茂会员折扣时为空,
        private String refund_time; //第三方支付系统返回的支付时间，现金和富茂会员折扣时为空
    }
}
