package io.github.js0ny.ilp_coursework.data.external;

import io.github.js0ny.ilp_coursework.data.common.DroneAvailability;

import org.springframework.lang.Nullable;

public record ServicePointDrones(int servicePointId, DroneAvailability[] drones) {

    @Nullable
    public DroneAvailability locateDroneById(String droneId) {
        for (var drone : drones) {
            if (drone.id().equals(droneId)) {
                return drone;
            }
        }
        return null;
    }
}
