Search in sources :

Example 1 with OverdueStateJson

use of org.killbill.billing.jaxrs.json.OverdueStateJson in project killbill by killbill.

the class AccountResource method getOverdueAccount.

/*
     * ************************** OVERDUE ********************************
     */
@TimedResource
@GET
@Path("/{accountId:" + UUID_PATTERN + "}/" + OVERDUE)
@Produces(APPLICATION_JSON)
@ApiOperation(value = "Retrieve overdue state for account", response = OverdueStateJson.class)
@ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid account id supplied"), @ApiResponse(code = 404, message = "Account not found") })
public Response getOverdueAccount(@PathParam("accountId") final String accountId, @javax.ws.rs.core.Context final HttpServletRequest request) throws AccountApiException, OverdueException, OverdueApiException {
    final TenantContext tenantContext = context.createContext(request);
    final Account account = accountUserApi.getAccountById(UUID.fromString(accountId), tenantContext);
    final OverdueState overdueState = overdueApi.getOverdueStateFor(account.getId(), tenantContext);
    return Response.status(Status.OK).entity(new OverdueStateJson(overdueState, paymentConfig)).build();
}
Also used : Account(org.killbill.billing.account.api.Account) OverdueStateJson(org.killbill.billing.jaxrs.json.OverdueStateJson) TenantContext(org.killbill.billing.util.callcontext.TenantContext) OverdueState(org.killbill.billing.overdue.api.OverdueState) Path(javax.ws.rs.Path) TimedResource(org.killbill.commons.metrics.TimedResource) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) ApiOperation(io.swagger.annotations.ApiOperation) ApiResponses(io.swagger.annotations.ApiResponses)

Aggregations

ApiOperation (io.swagger.annotations.ApiOperation)1 ApiResponses (io.swagger.annotations.ApiResponses)1 GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 Produces (javax.ws.rs.Produces)1 Account (org.killbill.billing.account.api.Account)1 OverdueStateJson (org.killbill.billing.jaxrs.json.OverdueStateJson)1 OverdueState (org.killbill.billing.overdue.api.OverdueState)1 TenantContext (org.killbill.billing.util.callcontext.TenantContext)1 TimedResource (org.killbill.commons.metrics.TimedResource)1