Class SupplyApiService

java.lang.Object
energy.eddie.regionconnector.es.datadis.services.SupplyApiService

@Service public class SupplyApiService extends Object
  • Constructor Details

    • SupplyApiService

      public SupplyApiService(SupplyApi supplyApi)
  • Method Details

    • fetchSupplyForPermissionRequest

      public reactor.core.publisher.Mono<Supply> fetchSupplyForPermissionRequest(EsPermissionRequest permissionRequest)
      Fetches the supply information for a given permission request. This method retrieves supply details based on the NIF and distributor code provided in the permission request. It performs a series of validations including checking for correct metering point and ensuring the point type supports the requested measurement type. If these conditions are not met, appropriate exceptions are thrown.
      Parameters:
      permissionRequest - The permission request containing the NIF, distributor code, metering point ID, and measurement type.
      Returns:
      A Supply object containing the supply details if successful.

      NoSuppliesException If no supplies are found for the provided NIF a nd distributor code.

      NoSupplyForMeteringPointException If no supply is found for the given metering point ID.

      DatadisApiException If the API call fails.