protected AuditLog getAccountCreationAuditLog(final UUID accountId, final AccountAuditLogs accountAuditLogs) throws OSGIServiceNotAvailable { final List<AuditLog> auditLogsForAccount = accountAuditLogs.getAuditLogsForAccount(); for (final AuditLog auditLog : auditLogsForAccount) { if (auditLog.getChangeType().equals(ChangeType.INSERT)) { return auditLog; } } logService.log(LogService.LOG_WARNING, "Unable to find Account creation audit log for id " + accountId); return null; }
/** * ******************************************** ACCOUNT ******************************************************* */ public void checkAccountCreated(final Account account, final CallContext context) { final AccountAuditLogs result = auditUserApi.getAccountAuditLogs(account.getId(), AuditLevel.FULL, context); checkAuditLog(ChangeType.INSERT, context, result.getAuditLogsForAccount().get(0), account.getId(), AccountSqlDao.class, true, true); // Payment method if (account.getPaymentMethodId() != null) { checkAuditLog(ChangeType.UPDATE, context, result.getAuditLogsForAccount().get(1), account.getId(), AccountSqlDao.class, true, true); } }
public AccountJson(final Account account, final BigDecimal accountBalance, final BigDecimal accountCBA, @Nullable final AccountAuditLogs accountAuditLogs) { super(toAuditLogJson(accountAuditLogs == null ? null : accountAuditLogs.getAuditLogsForAccount())); this.accountCBA = accountCBA; this.accountBalance = accountBalance; this.accountId = account.getId(); this.externalKey = account.getExternalKey(); this.name = account.getName(); this.firstNameLength = account.getFirstNameLength(); this.email = account.getEmail(); this.billCycleDayLocal = account.getBillCycleDayLocal(); this.currency = account.getCurrency(); this.parentAccountId = account.getParentAccountId(); this.isPaymentDelegatedToParent = account.isPaymentDelegatedToParent(); this.paymentMethodId = account.getPaymentMethodId(); this.referenceTime = account.getReferenceTime(); this.timeZone = account.getTimeZone() != null ? account.getTimeZone().toString() : null; this.address1 = account.getAddress1(); this.address2 = account.getAddress2(); this.postalCode = account.getPostalCode(); this.company = account.getCompanyName(); this.city = account.getCity(); this.state = account.getStateOrProvince(); this.country = account.getCountry(); this.locale = account.getLocale(); this.phone = account.getPhone(); this.notes = account.getNotes(); this.isMigrated = account.isMigrated(); }