package com.kym.entity.queryParams;

import com.kym.entity.common.PageParams;
import lombok.Data;
import lombok.experimental.Accessors;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;

@Data
@Accessors(chain = true)
public class WalletDetailQueryParam extends PageParams {

    private Long userId;

    private String mobilePhone;

    private Integer type;

    private Integer status;

    public void setStartDate(String startDate) {
        if (startDate != null && !startDate.isEmpty()) {
            this.startDate = LocalDateTime.of(LocalDate.parse(startDate), LocalTime.MIN);
        }
    }

    private LocalDateTime startDate;

    public void setEndDate(String endDate) {
        if (endDate != null && !endDate.isEmpty()) {
            this.endDate = LocalDateTime.of(LocalDate.parse(endDate), LocalTime.MAX);
        }
    }

    private LocalDateTime endDate;
}
