Search in sources :

Example 6 with AuditLogWithHistory

use of org.killbill.billing.util.audit.AuditLogWithHistory in project killbill by killbill.

the class CustomFieldResource method getCustomFieldAuditLogsWithHistory.

@TimedResource
@GET
@Path("/{customFieldId:" + UUID_PATTERN + "}/" + AUDIT_LOG_WITH_HISTORY)
@Produces(APPLICATION_JSON)
@ApiOperation(value = "Retrieve custom field audit logs with history by id", response = AuditLogJson.class, responseContainer = "List")
@ApiResponses(value = { @ApiResponse(code = 404, message = "Account not found") })
public Response getCustomFieldAuditLogsWithHistory(@PathParam("customFieldId") final UUID customFieldId, @javax.ws.rs.core.Context final HttpServletRequest request) throws AccountApiException {
    final TenantContext tenantContext = context.createTenantContextNoAccountId(request);
    final List<AuditLogWithHistory> auditLogWithHistory = customFieldUserApi.getCustomFieldAuditLogsWithHistoryForId(customFieldId, AuditLevel.FULL, tenantContext);
    return Response.status(Status.OK).entity(getAuditLogsWithHistory(auditLogWithHistory)).build();
}
Also used : TenantContext(org.killbill.billing.util.callcontext.TenantContext) AuditLogWithHistory(org.killbill.billing.util.audit.AuditLogWithHistory) 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)

Example 7 with AuditLogWithHistory

use of org.killbill.billing.util.audit.AuditLogWithHistory in project killbill by killbill.

the class InvoiceItemResource method getInvoiceItemAuditLogsWithHistory.

@TimedResource
@GET
@Path("/{invoiceItemId:" + UUID_PATTERN + "}/" + AUDIT_LOG_WITH_HISTORY)
@Produces(APPLICATION_JSON)
@ApiOperation(value = "Retrieve invoice item audit logs with history by id", response = AuditLogJson.class, responseContainer = "List")
@ApiResponses(value = { @ApiResponse(code = 404, message = "Invoice item not found") })
public Response getInvoiceItemAuditLogsWithHistory(@PathParam("invoiceItemId") final UUID invoiceItemId, @javax.ws.rs.core.Context final HttpServletRequest request) {
    final TenantContext tenantContext = context.createTenantContextNoAccountId(request);
    final List<AuditLogWithHistory> auditLogWithHistory = invoiceApi.getInvoiceItemAuditLogsWithHistoryForId(invoiceItemId, AuditLevel.FULL, tenantContext);
    return Response.status(Status.OK).entity(getAuditLogsWithHistory(auditLogWithHistory)).build();
}
Also used : TenantContext(org.killbill.billing.util.callcontext.TenantContext) AuditLogWithHistory(org.killbill.billing.util.audit.AuditLogWithHistory) 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)

Example 8 with AuditLogWithHistory

use of org.killbill.billing.util.audit.AuditLogWithHistory in project killbill by killbill.

the class AccountResource method getBlockingStateAuditLogsWithHistory.

@TimedResource
@GET
@Path("/" + BLOCK + "/{blockingId:" + UUID_PATTERN + "}/" + AUDIT_LOG_WITH_HISTORY)
@Produces(APPLICATION_JSON)
@ApiOperation(value = "Retrieve blocking state audit logs with history by id", response = AuditLogJson.class, responseContainer = "List")
@ApiResponses(value = { @ApiResponse(code = 404, message = "Blocking state  not found") })
public Response getBlockingStateAuditLogsWithHistory(@PathParam("blockingId") final UUID blockingId, @javax.ws.rs.core.Context final HttpServletRequest request) {
    final TenantContext tenantContext = context.createTenantContextNoAccountId(request);
    final List<AuditLogWithHistory> auditLogWithHistory = subscriptionApi.getBlockingStateAuditLogsWithHistoryForId(blockingId, AuditLevel.FULL, tenantContext);
    return Response.status(Status.OK).entity(getAuditLogsWithHistory(auditLogWithHistory)).build();
}
Also used : TenantContext(org.killbill.billing.util.callcontext.TenantContext) AuditLogWithHistory(org.killbill.billing.util.audit.AuditLogWithHistory) 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)

Example 9 with AuditLogWithHistory

use of org.killbill.billing.util.audit.AuditLogWithHistory in project killbill by killbill.

the class AccountResource method getAccountAuditLogsWithHistory.

@TimedResource
@GET
@Path("/{accountId:" + UUID_PATTERN + "}/" + AUDIT_LOG_WITH_HISTORY)
@Produces(APPLICATION_JSON)
@ApiOperation(value = "Retrieve account audit logs with history by account id", response = AuditLogJson.class, responseContainer = "List")
@ApiResponses(value = { @ApiResponse(code = 404, message = "Account not found") })
public Response getAccountAuditLogsWithHistory(@PathParam("accountId") final UUID accountId, @javax.ws.rs.core.Context final HttpServletRequest request) throws AccountApiException {
    final TenantContext tenantContext = context.createTenantContextWithAccountId(accountId, request);
    final List<AuditLogWithHistory> auditLogWithHistory = accountUserApi.getAuditLogsWithHistoryForId(accountId, AuditLevel.FULL, tenantContext);
    return Response.status(Status.OK).entity(getAuditLogsWithHistory(auditLogWithHistory)).build();
}
Also used : TenantContext(org.killbill.billing.util.callcontext.TenantContext) AuditLogWithHistory(org.killbill.billing.util.audit.AuditLogWithHistory) 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)

Example 10 with AuditLogWithHistory

use of org.killbill.billing.util.audit.AuditLogWithHistory in project killbill by killbill.

the class SubscriptionResource method getSubscriptionAuditLogsWithHistory.

@TimedResource
@GET
@Path("/{subscriptionId:" + UUID_PATTERN + "}/" + AUDIT_LOG_WITH_HISTORY)
@Produces(APPLICATION_JSON)
@ApiOperation(value = "Retrieve subscription audit logs with history by id", response = AuditLogJson.class, responseContainer = "List")
@ApiResponses(value = { @ApiResponse(code = 404, message = "Subscription not found") })
public Response getSubscriptionAuditLogsWithHistory(@PathParam("subscriptionId") final UUID subscriptionId, @javax.ws.rs.core.Context final HttpServletRequest request) {
    final TenantContext tenantContext = context.createTenantContextNoAccountId(request);
    final List<AuditLogWithHistory> auditLogWithHistory = subscriptionApi.getSubscriptionAuditLogsWithHistoryForId(subscriptionId, AuditLevel.FULL, tenantContext);
    return Response.status(Status.OK).entity(getAuditLogsWithHistory(auditLogWithHistory)).build();
}
Also used : TenantContext(org.killbill.billing.util.callcontext.TenantContext) AuditLogWithHistory(org.killbill.billing.util.audit.AuditLogWithHistory) 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

AuditLogWithHistory (org.killbill.billing.util.audit.AuditLogWithHistory)23 ApiOperation (io.swagger.annotations.ApiOperation)16 ApiResponses (io.swagger.annotations.ApiResponses)16 GET (javax.ws.rs.GET)16 Path (javax.ws.rs.Path)16 Produces (javax.ws.rs.Produces)16 TenantContext (org.killbill.billing.util.callcontext.TenantContext)16 TimedResource (org.killbill.commons.metrics.TimedResource)16 Test (org.testng.annotations.Test)7 UUID (java.util.UUID)3 BigDecimal (java.math.BigDecimal)2 DateTime (org.joda.time.DateTime)2 Payment (org.killbill.billing.payment.api.Payment)2 Account (org.killbill.billing.account.api.Account)1 AccountData (org.killbill.billing.account.api.AccountData)1 DefaultAccount (org.killbill.billing.account.api.DefaultAccount)1 DefaultMutableAccountData (org.killbill.billing.account.api.DefaultMutableAccountData)1 MutableAccountData (org.killbill.billing.account.api.MutableAccountData)1 BlockingState (org.killbill.billing.entitlement.api.BlockingState)1 DefaultBlockingState (org.killbill.billing.junction.DefaultBlockingState)1