/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package cn.ysk.cashier.pojo.shop;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import java.math.BigDecimal;
import java.io.Serializable;

/**
* @website https://eladmin.vip
* @description /
* @author lyf
* @date 2024-01-05
**/
@Entity
@Data
@Table(name="tb_shop_currency")
public class TbShopCurrency implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "`id`")
    @ApiModelProperty(value = "自增id")
    private Integer id;

    @Column(name = "`shop_id`")
    @ApiModelProperty(value = "店铺Id")
    private String shopId;

    @Column(name = "`prepare_amount`")
    @ApiModelProperty(value = "备用金")
    private BigDecimal prepareAmount;

    @Column(name = "`currency`")
    @ApiModelProperty(value = "货币单位 ￥，$")
    private String currency;

    @Column(name = "`decimals_digits`")
    @ApiModelProperty(value = "小数位，0，1，2，无，元，角，分")
    private Integer decimalsDigits;

    @Column(name = "`discount_round`")
    @ApiModelProperty(value = "无，四舍五入，五舍六入none,round4up5,round5up6,round12up34")
    private String discountRound;

    @Column(name = "`merchant_id`")
    @ApiModelProperty(value = "商户Id")
    private String merchantId;

    @Column(name = "`small_change`")
    @ApiModelProperty(value = "订单抹零 -1无，0元 1角2分  0.5=0.5元")
    private Integer smallChange;

    @Column(name = "`enable_custom_discount`")
    @ApiModelProperty(value = "使折扣生效")
    private Integer enableCustomDiscount;

    @Column(name = "`max_discount`")
    @ApiModelProperty(value = "最大抹零金额(100)")
    private BigDecimal maxDiscount;

    @Column(name = "`max_percent`")
    @ApiModelProperty(value = "最大折扣百分比,，优先级高于max_discount")
    private Double maxPercent;

    @Column(name = "`discount_configs`")
    @ApiModelProperty(value = "折扣显示详情")
    private String discountConfigs;

    @Column(name = "`biz_duration`")
    @ApiModelProperty(value = "营业时间(弃用)")
    private String bizDuration;

    @Column(name = "`allow_web_pay`")
    @ApiModelProperty(value = "允许网络支付")
    private Integer allowWebPay;

    @Column(name = "`is_auto_to_zero`")
    @ApiModelProperty(value = "自动抹零，开启时，系统自动抹零")
    private Integer isAutoToZero;

    @Column(name = "`is_include_tax_price`")
    @ApiModelProperty(value = "商品含税")
    private Integer isIncludeTaxPrice;

    @Column(name = "`service_charge`")
    @ApiModelProperty(value = "服务费配置（小费）")
    private String serviceCharge;

    @Column(name = "`tax_number`")
    @ApiModelProperty(value = "税号")
    private String taxNumber;

    @Column(name = "`created_at`")
    @ApiModelProperty(value = "createdAt")
    private Long createdAt;

    @Column(name = "`updated_at`")
    @ApiModelProperty(value = "updatedAt")
    private Long updatedAt;

    @Column(name = "`auto_lock_screen`")
    @ApiModelProperty(value = "自动锁屏")
    private Integer autoLockScreen;

    @Column(name = "`voice_notification`")
    @ApiModelProperty(value = "语音通知")
    private Integer voiceNotification;

    public void copy(TbShopCurrency source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
