After discussion, we realized that we need a non-authenticated API endpoint that allows public users to find out whether a given portal's usage (by its instanceId and quotaType) is active. This allows us to conditionally render paid features for the portal.
[x] Add the GET /usages/status?instanceId=:instanceId"aType=:quotaType method to the Swagger API
[x] Create a UsageStatus model with one status property with values of active or inactive:
{
"status": ":status"
}
Note: Should the UsageStatus model also include the "object": "usagestatus" field to be consistent with our other models?
[x] Modify UsagesResource and add the getStatus() method (leave out the @PermitAll annotation) which returns a UsageStatus model in 200 responses, otherwise 404 if not found.
[x] Write up a UsageTest serialization/deserialization unit test for the model using a usagestatus.json fixture
After discussion, we realized that we need a non-authenticated API endpoint that allows public users to find out whether a given portal's usage (by its
instanceId
andquotaType
) is active. This allows us to conditionally render paid features for the portal.GET /usages/status?instanceId=:instanceId"aType=:quotaType
method to the Swagger APIUsageStatus
model with onestatus
property with values ofactive
orinactive
:UsagesResource
and add thegetStatus()
method (leave out the@PermitAll
annotation) which returns aUsageStatus
model in200
responses, otherwise404
if not found.UsageTest
serialization/deserialization unit test for the model using ausagestatus.json
fixture