/*
*  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 me.zhengjie.modules.dm.dmReadingRoomApplay.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import me.zhengjie.base.BaseEntity;
import me.zhengjie.modules.dm.dmReadingRoom.domain.DmReadingRoom;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import javax.persistence.*;
import javax.validation.constraints.*;
import java.math.BigDecimal;
import java.io.Serializable;
import java.util.List;

/**
* @website https://el-admin.vip
* @description /
* @author longda
* @date 2022-03-01
**/
@Entity
@Data
@Table(name="dm_reading_room_applay")
public class DmReadingRoomApplay extends BaseEntity implements Serializable {

    @Column(name = "reading_room_id")
    @ApiModelProperty(value = "关联阅览室记录id")
    private String readingRoomId;

    @Id
    @Column(name = "readomg_room_applay_id")
    @ApiModelProperty(value = "消费记录id")
    private String readomgRoomApplayId;

    @Column(name = "readomg_room_applay_money")
    @ApiModelProperty(value = "消费金额")
    private BigDecimal readomgRoomApplayMoney;

    @Column(name = "overdue_amount")
    @ApiModelProperty(value = "逾期金额")
    private BigDecimal overdueAmount;

    @Column(name = "overdue_amount_max")
    @ApiModelProperty(value = "上限")
    private BigDecimal overdueAmountMax;

    @Column(name = "readomg_room_applay_type")
    @ApiModelProperty(value = "消费类型")
    private String readomgRoomApplayType;

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