package com.yuchen.saas.parking.charge.api.pojo;

import com.yuchen.saas.parking.charge.api.po.ParkingPlaceEvent;
import lombok.Data;

/**
 * TODO 
 * @author 钱江
 * @date 2022/9/28 下午5:31
 * @version 2.0.0
 */
@Data
public class PlaceKV {

    private String placeId;

    // 0 = 未离开，1 = 已离开
    private Integer currentState;

    private ParkingPlaceEvent start;

    private ParkingPlaceEvent end;

    private Integer stakeType ;

    private Long chargeTerminalId ;

    public boolean isValid() {
        return start != null && end != null && start.getEventTime().before(end.getEventTime());
    }
}
