We need to sort the products on Buy Cover page by booked/used capacity (aka active cover amount, or allocationAmount). Atm we get products capacities values from the cover router api /v2/capacityGET endpoint. To support the sorting feature we need to get data for the booked capacity as well.
It would be great to have that info passed on the same endpoint response.
type CapacityApiResponse = {
capacity: Array<{
assetId: string;
amount: string;
}>;
allocationAmount: string; // always denominated in NXM so no need for assetId
productId: string;
};
Naming of the new field can be discussed if something else makes more sense in the given context.
Context
We need to sort the products on Buy Cover page by booked/used capacity (aka active cover amount, or allocationAmount). Atm we get products capacities values from the cover router api
/v2/capacity
GET
endpoint. To support the sorting feature we need to get data for the booked capacity as well. It would be great to have that info passed on the same endpoint response.The current response looks like:
The new response would be great to look like:
Naming of the new field can be discussed if something else makes more sense in the given context.