use of org.killbill.billing.util.customfield.CustomField in project killbill by killbill.
the class JaxRsResourceBase method createCustomFieldResponse.
protected Response createCustomFieldResponse(final Iterable<CustomField> fields, final AuditMode auditMode, final TenantContext context) {
final Collection<CustomFieldJson> result = new LinkedList<CustomFieldJson>();
for (final CustomField cur : fields) {
// TODO PIERRE - Bulk API
final List<AuditLog> auditLogs = auditUserApi.getAuditLogs(cur.getId(), ObjectType.CUSTOM_FIELD, auditMode.getLevel(), context);
result.add(new CustomFieldJson(cur, auditLogs));
}
return Response.status(Response.Status.OK).entity(result).build();
}
use of org.killbill.billing.util.customfield.CustomField in project killbill by killbill.
the class DefaultCustomFieldUserApi method removeCustomFields.
@Override
public void removeCustomFields(final List<CustomField> customFields, final CallContext context) throws CustomFieldApiException {
if (!customFields.isEmpty()) {
final InternalCallContext internalCallContext = internalCallContextFactory.createInternalCallContext(customFields.get(0).getObjectId(), customFields.get(0).getObjectType(), context);
final Iterable<UUID> curstomFieldIds = Iterables.transform(customFields, new Function<CustomField, UUID>() {
@Override
public UUID apply(final CustomField input) {
return input.getId();
}
});
customFieldDao.deleteCustomFields(curstomFieldIds, internalCallContext);
}
}
Aggregations