package com.bcxin.tenant.open.domains.services.commands;

import com.bcxin.tenant.open.infrastructures.commands.CommandAbstract;
import lombok.Getter;

import java.util.Collection;

@Getter
public class BatchDeviceLocationHistoryCommand extends CommandAbstract {

    private final Collection<DeviceLocationHistoryItemCommand> historyItems;

    public BatchDeviceLocationHistoryCommand(Collection<DeviceLocationHistoryItemCommand> historyItems) {
        this.historyItems = historyItems;
    }


    public static BatchDeviceLocationHistoryCommand create(Collection<DeviceLocationHistoryItemCommand> historyItems) {
        return new BatchDeviceLocationHistoryCommand(historyItems);
    }

    @Getter
    public static class DeviceLocationHistoryItemCommand extends CommandAbstract {
        private final String deviceId;
        private final String dispatchNo;
        private final double lon;
        private final double lat;

        public DeviceLocationHistoryItemCommand(String deviceId,String dispatchNo, double lon, double lat) {
            this.deviceId=deviceId;
            this.dispatchNo = dispatchNo;
            this.lon = lon;
            this.lat = lat;
        }

        public static DeviceLocationHistoryItemCommand create(String deviceId,String dispatchNo, double lon, double lat) {
            return new DeviceLocationHistoryItemCommand(deviceId,dispatchNo, lon, lat);
        }
    }
}
