Search in sources :

Example 16 with AuditLogWithHistory

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

the class BundleResource method getBundleAuditLogsWithHistory.

@TimedResource
@GET
@Path("/{bundleId:" + UUID_PATTERN + "}/" + AUDIT_LOG_WITH_HISTORY)
@Produces(APPLICATION_JSON)
@ApiOperation(value = "Retrieve bundle audit logs with history by id", response = AuditLogJson.class, responseContainer = "List")
@ApiResponses(value = { @ApiResponse(code = 404, message = "Subscription bundle not found") })
public Response getBundleAuditLogsWithHistory(@PathParam("bundleId") final UUID bundleId, @javax.ws.rs.core.Context final HttpServletRequest request) {
    final TenantContext tenantContext = context.createTenantContextNoAccountId(request);
    final List<AuditLogWithHistory> auditLogWithHistory = subscriptionApi.getSubscriptionBundleAuditLogsWithHistoryForId(bundleId, 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 17 with AuditLogWithHistory

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

the class PaymentResource method getPaymentAttemptAuditLogsWithHistory.

@TimedResource
@GET
@Path("/" + ATTEMPTS + "/{paymentAttemptId:" + UUID_PATTERN + "}/" + AUDIT_LOG_WITH_HISTORY)
@Produces(APPLICATION_JSON)
@ApiOperation(value = "Retrieve payment attempt audit logs with history by id", response = AuditLogJson.class, responseContainer = "List")
@ApiResponses(value = { @ApiResponse(code = 404, message = "Account not found") })
public Response getPaymentAttemptAuditLogsWithHistory(@PathParam("paymentAttemptId") final UUID paymentAttemptId, @javax.ws.rs.core.Context final HttpServletRequest request) throws AccountApiException {
    final TenantContext tenantContext = context.createTenantContextNoAccountId(request);
    final List<AuditLogWithHistory> auditLogWithHistory = paymentApi.getPaymentAttemptAuditLogsWithHistoryForId(paymentAttemptId, 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 18 with AuditLogWithHistory

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

the class TagResource method getTagAuditLogsWithHistory.

@TimedResource
@GET
@Path("/{tagId:" + UUID_PATTERN + "}/" + AUDIT_LOG_WITH_HISTORY)
@Produces(APPLICATION_JSON)
@ApiOperation(value = "Retrieve tag audit logs with history by id", response = AuditLogJson.class, responseContainer = "List")
@ApiResponses(value = { @ApiResponse(code = 404, message = "Account not found") })
public Response getTagAuditLogsWithHistory(@PathParam("tagId") final UUID tagId, @javax.ws.rs.core.Context final HttpServletRequest request) throws AccountApiException {
    final TenantContext tenantContext = context.createTenantContextNoAccountId(request);
    final List<AuditLogWithHistory> auditLogWithHistory = tagUserApi.getTagAuditLogsWithHistoryForId(tagId, 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 19 with AuditLogWithHistory

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

the class InvoicePaymentResource method getInvoicePaymentAuditLogsWithHistory.

@TimedResource
@GET
@Path("/{invoicePaymentId:" + UUID_PATTERN + "}/" + AUDIT_LOG_WITH_HISTORY)
@Produces(APPLICATION_JSON)
@ApiOperation(value = "Retrieve invoice payment audit logs with history by id", response = AuditLogJson.class, responseContainer = "List")
@ApiResponses(value = { @ApiResponse(code = 404, message = "Invoice payment not found") })
public Response getInvoicePaymentAuditLogsWithHistory(@PathParam("invoicePaymentId") final UUID invoicePaymentId, @javax.ws.rs.core.Context final HttpServletRequest request) {
    final TenantContext tenantContext = context.createTenantContextNoAccountId(request);
    final List<AuditLogWithHistory> auditLogWithHistory = invoiceApi.getInvoicePaymentAuditLogsWithHistoryForId(invoicePaymentId, 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 20 with AuditLogWithHistory

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

the class InvoiceResource method getInvoiceAuditLogsWithHistory.

@TimedResource
@GET
@Path("/{invoiceId:" + UUID_PATTERN + "}/" + AUDIT_LOG_WITH_HISTORY)
@Produces(APPLICATION_JSON)
@ApiOperation(value = "Retrieve invoice audit logs with history by id", response = AuditLogJson.class, responseContainer = "List")
@ApiResponses(value = { @ApiResponse(code = 404, message = "Invoice not found") })
public Response getInvoiceAuditLogsWithHistory(@PathParam("invoiceId") final UUID invoiceId, @javax.ws.rs.core.Context final HttpServletRequest request) {
    final TenantContext tenantContext = context.createTenantContextNoAccountId(request);
    final List<AuditLogWithHistory> auditLogWithHistory = invoiceApi.getInvoiceAuditLogsWithHistoryForId(invoiceId, 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