...
1) GetAgreements
Route: GET
- GET /bright/agreements
ParamsParams:
- customerId (required)
...
- serviceId (required)
...
- serviceId MUST be the EAN / MeteringPointId (ediel number).
- (+ CancellationToken)
...
...
Returns
- 200 OK -> IEnumerable<BrightAgreement>
- 400 BadRequest (declared; see note below)
...
- 401 Unauthorized
What What it does:
Returns the list of active agreements for the given customer + service.
It first validates the customer exists and validates input (customerId required; serviceId required and digits
only).
Validation Validation that affects the result (all surface as HTTP 500 with a message): -
- Customer does not exist -> commonValidator.ValidateCustomer throws
...
- Missing customerId -> "Missing parameter 'CustomerId'."
...
- Missing serviceId -> "Missing parameter 'ServiceId'."
...
- serviceId not digits-only -> "Parameter 'ServiceId' must contain
...
- digits only."
...
- Duplicate ContractName in out -> "Duplicate ContractName(s) found: ..."
...
- Rows for >1 customer / wrong -> "Agreements belong to
...
- multiple customer
- Agreements belongs to wrong CustomerId. Expected id: {id}"
--------------------------------------------------------------------------------
RESPONSE STRUCTURE (BrightAgreement)
--------------------------------------------------------------------------------
...