package com.bcxin.tenant.open.domains.dtos;

import com.bcxin.tenant.open.infrastructures.components.JsonProvider;
import com.bcxin.tenant.open.infrastructures.enums.DutySignInType;
import com.bcxin.tenant.open.infrastructures.valueTypes.LonLatValueType;
import lombok.Getter;

@Getter
public class UpdateEmployeeLocationDTO {
    private final String id;
    private final DutySignInType signInType;
    private final String lonLat;

    public UpdateEmployeeLocationDTO(String id, DutySignInType signInType, Double lon, Double lat, JsonProvider jsonProvider) {
        this.id = id;
        this.signInType = signInType;
        LonLatValueType lonLatValueType = new LonLatValueType();
        lonLatValueType.setLat(lat);
        lonLatValueType.setLon(lon);

        this.lonLat = jsonProvider.getJson(lonLatValueType);
    }

    public static UpdateEmployeeLocationDTO create(String id, DutySignInType signInType, Double lon, Double lat, JsonProvider jsonProvider) {
        return new UpdateEmployeeLocationDTO(id, signInType, lon, lat, jsonProvider);
    }
}
