drop audit columns for office transactions, funds, staff, charges.
This commit is contained in:
+5
-1
@@ -12,7 +12,11 @@ public class CodeData {
|
||||
@SuppressWarnings("unused")
|
||||
private final boolean systemDefined;
|
||||
|
||||
public CodeData(final Long id, final String name, final boolean systemDefined) {
|
||||
public static CodeData instance(final Long id, final String name, final boolean systemDefined) {
|
||||
return new CodeData(id, name, systemDefined);
|
||||
}
|
||||
|
||||
private CodeData(final Long id, final String name, final boolean systemDefined) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.systemDefined = systemDefined;
|
||||
|
||||
+5
-1
@@ -14,7 +14,11 @@ public class CodeValueData {
|
||||
@SuppressWarnings("unused")
|
||||
private final Integer position;
|
||||
|
||||
public CodeValueData(final Long id, final String name, final Integer position) {
|
||||
public static CodeValueData instance(final Long id, final String name, final Integer position) {
|
||||
return new CodeValueData(id, name, position);
|
||||
}
|
||||
|
||||
private CodeValueData(final Long id, final String name, final Integer position) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.position = position;
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ public class CodeReadPlatformServiceImpl implements CodeReadPlatformService {
|
||||
final String code_name = rs.getString("code_name");
|
||||
final boolean systemDefined = rs.getBoolean("systemDefined");
|
||||
|
||||
return new CodeData(id, code_name, systemDefined);
|
||||
return CodeData.instance(id, code_name, systemDefined);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+29
-30
@@ -15,42 +15,41 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class CodeValueReadPlatformServiceImpl implements CodeValueReadPlatformService {
|
||||
|
||||
private final JdbcTemplate jdbcTemplate;
|
||||
private final PlatformSecurityContext context;
|
||||
private final JdbcTemplate jdbcTemplate;
|
||||
private final PlatformSecurityContext context;
|
||||
|
||||
@Autowired
|
||||
public CodeValueReadPlatformServiceImpl(final PlatformSecurityContext context, final TenantAwareRoutingDataSource dataSource) {
|
||||
this.context = context;
|
||||
this.jdbcTemplate = new JdbcTemplate(dataSource);
|
||||
}
|
||||
@Autowired
|
||||
public CodeValueReadPlatformServiceImpl(final PlatformSecurityContext context, final TenantAwareRoutingDataSource dataSource) {
|
||||
this.context = context;
|
||||
this.jdbcTemplate = new JdbcTemplate(dataSource);
|
||||
}
|
||||
|
||||
private static final class CodeValueDataMapper implements RowMapper<CodeValueData> {
|
||||
private static final class CodeValueDataMapper implements RowMapper<CodeValueData> {
|
||||
|
||||
public String schema() {
|
||||
return " cv.id as id, cv.code_value as value, cv.code_id as codeId, cv.order_position as position"
|
||||
+ " from m_code_value as cv join m_code c on cv.code_id = c.id ";
|
||||
}
|
||||
public String schema() {
|
||||
return " cv.id as id, cv.code_value as value, cv.code_id as codeId, cv.order_position as position"
|
||||
+ " from m_code_value as cv join m_code c on cv.code_id = c.id ";
|
||||
}
|
||||
|
||||
@Override
|
||||
public CodeValueData mapRow(final ResultSet rs, @SuppressWarnings("unused") final int rowNum)
|
||||
throws SQLException {
|
||||
@Override
|
||||
public CodeValueData mapRow(final ResultSet rs, @SuppressWarnings("unused") final int rowNum) throws SQLException {
|
||||
|
||||
final Long id = rs.getLong("id");
|
||||
final String value = rs.getString("value");
|
||||
final Integer position = rs.getInt("position");
|
||||
final Long id = rs.getLong("id");
|
||||
final String value = rs.getString("value");
|
||||
final Integer position = rs.getInt("position");
|
||||
|
||||
return new CodeValueData(id, value, position);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<CodeValueData> retrieveCustomIdentifierCodeValues() {
|
||||
|
||||
context.authenticatedUser();
|
||||
return CodeValueData.instance(id, value, position);
|
||||
}
|
||||
}
|
||||
|
||||
final CodeValueDataMapper rm = new CodeValueDataMapper();
|
||||
final String sql = "select " + rm.schema() + "where c.code_name like ? order by position";
|
||||
@Override
|
||||
public Collection<CodeValueData> retrieveCustomIdentifierCodeValues() {
|
||||
|
||||
return this.jdbcTemplate.query(sql, rm, new Object[] {"Customer Identifier"});
|
||||
}
|
||||
context.authenticatedUser();
|
||||
|
||||
final CodeValueDataMapper rm = new CodeValueDataMapper();
|
||||
final String sql = "select " + rm.schema() + "where c.code_name like ? order by position";
|
||||
|
||||
return this.jdbcTemplate.query(sql, rm, new Object[] { "Customer Identifier" });
|
||||
}
|
||||
}
|
||||
+2
-3
@@ -5,13 +5,12 @@ import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.mifosplatform.infrastructure.core.domain.AbstractAuditableCustom;
|
||||
import org.mifosplatform.infrastructure.documentmanagement.command.DocumentCommand;
|
||||
import org.mifosplatform.useradministration.domain.AppUser;
|
||||
import org.springframework.data.jpa.domain.AbstractPersistable;
|
||||
|
||||
@Entity
|
||||
@Table(name = "m_document")
|
||||
public class Document extends AbstractAuditableCustom<AppUser, Long> {
|
||||
public class Document extends AbstractPersistable<Long> {
|
||||
|
||||
@Column(name = "parent_entity_type", length = 50)
|
||||
private String parentEntityType;
|
||||
|
||||
+14
-17
@@ -34,24 +34,21 @@ public class OfficeTransactionData {
|
||||
@SuppressWarnings("unused")
|
||||
private final Collection<OfficeData> allowedOffices;
|
||||
|
||||
public OfficeTransactionData(final LocalDate transactionDate, final Collection<OfficeData> allowedOffices,
|
||||
final Collection<CurrencyData> currencyOptions) {
|
||||
this.transactionDate = transactionDate;
|
||||
this.allowedOffices = allowedOffices;
|
||||
this.currencyOptions = currencyOptions;
|
||||
this.id = null;
|
||||
this.fromOfficeId = null;
|
||||
this.fromOfficeName = null;
|
||||
this.toOfficeId = null;
|
||||
this.toOfficeName = null;
|
||||
this.currency = null;
|
||||
this.transactionAmount = null;
|
||||
this.description = null;
|
||||
public static OfficeTransactionData instance(final Long id, final LocalDate transactionDate, final Long fromOfficeId,
|
||||
final String fromOfficeName, final Long toOfficeId, final String toOfficeName, final CurrencyData currency,
|
||||
final BigDecimal transactionAmount, final String description) {
|
||||
return new OfficeTransactionData(id, transactionDate, fromOfficeId, fromOfficeName, toOfficeId, toOfficeName, currency,
|
||||
transactionAmount, description, null, null);
|
||||
}
|
||||
|
||||
public OfficeTransactionData(final Long id, final LocalDate transactionDate, final Long fromOfficeId, final String fromOfficeName,
|
||||
public static OfficeTransactionData template(final LocalDate transactionDate, final Collection<OfficeData> parentLookups,
|
||||
final Collection<CurrencyData> currencyOptions) {
|
||||
return new OfficeTransactionData(null, transactionDate, null, null, null, null, null, null, null, parentLookups, currencyOptions);
|
||||
}
|
||||
|
||||
private OfficeTransactionData(final Long id, final LocalDate transactionDate, final Long fromOfficeId, final String fromOfficeName,
|
||||
final Long toOfficeId, final String toOfficeName, final CurrencyData currency, final BigDecimal transactionAmount,
|
||||
final String description) {
|
||||
final String description, final Collection<OfficeData> allowedOffices, final Collection<CurrencyData> currencyOptions) {
|
||||
this.id = id;
|
||||
this.fromOfficeId = fromOfficeId;
|
||||
this.fromOfficeName = fromOfficeName;
|
||||
@@ -61,7 +58,7 @@ public class OfficeTransactionData {
|
||||
this.transactionAmount = transactionAmount;
|
||||
this.description = description;
|
||||
this.transactionDate = transactionDate;
|
||||
this.currencyOptions = null;
|
||||
this.allowedOffices = null;
|
||||
this.allowedOffices = allowedOffices;
|
||||
this.currencyOptions = currencyOptions;
|
||||
}
|
||||
}
|
||||
+2
-3
@@ -15,14 +15,13 @@ import javax.persistence.TemporalType;
|
||||
|
||||
import org.joda.time.LocalDate;
|
||||
import org.mifosplatform.infrastructure.core.api.JsonCommand;
|
||||
import org.mifosplatform.infrastructure.core.domain.AbstractAuditableCustom;
|
||||
import org.mifosplatform.organisation.monetary.domain.MonetaryCurrency;
|
||||
import org.mifosplatform.organisation.monetary.domain.Money;
|
||||
import org.mifosplatform.useradministration.domain.AppUser;
|
||||
import org.springframework.data.jpa.domain.AbstractPersistable;
|
||||
|
||||
@Entity
|
||||
@Table(name = "m_office_transaction")
|
||||
public class OfficeTransaction extends AbstractAuditableCustom<AppUser, Long> {
|
||||
public class OfficeTransaction extends AbstractPersistable<Long> {
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
|
||||
+5
-6
@@ -100,12 +100,11 @@ public class OfficeReadPlatformServiceImpl implements OfficeReadPlatformService
|
||||
|
||||
private static final class OfficeTransactionMapper implements RowMapper<OfficeTransactionData> {
|
||||
|
||||
public String officeTransactionSchema() {
|
||||
public String schema() {
|
||||
return " ot.id as id, ot.transaction_date as transactionDate, ot.from_office_id as fromOfficeId, fromoff.name as fromOfficeName, "
|
||||
+ " ot.to_office_id as toOfficeId, tooff.name as toOfficeName, ot.transaction_amount as transactionAmount, ot.description as description, "
|
||||
+ " ot.currency_code as currencyCode, rc.decimal_places as currencyDigits, "
|
||||
+ "rc.name as currencyName, rc.internationalized_name_code as currencyNameCode, rc.display_symbol as currencyDisplaySymbol "
|
||||
|
||||
+ " rc.name as currencyName, rc.internationalized_name_code as currencyNameCode, rc.display_symbol as currencyDisplaySymbol "
|
||||
+ " from m_office_transaction ot "
|
||||
+ " left join m_office fromoff on fromoff.id = ot.from_office_id "
|
||||
+ " left join m_office tooff on tooff.id = ot.to_office_id " + " join m_currency rc on rc.`code` = ot.currency_code";
|
||||
@@ -133,7 +132,7 @@ public class OfficeReadPlatformServiceImpl implements OfficeReadPlatformService
|
||||
BigDecimal transactionAmount = rs.getBigDecimal("transactionAmount");
|
||||
String description = rs.getString("description");
|
||||
|
||||
return new OfficeTransactionData(id, transactionDate, fromOfficeId, fromOfficeName, toOfficeId, toOfficeName, currencyData,
|
||||
return OfficeTransactionData.instance(id, transactionDate, fromOfficeId, fromOfficeName, toOfficeId, toOfficeName, currencyData,
|
||||
transactionAmount, description);
|
||||
}
|
||||
}
|
||||
@@ -235,7 +234,7 @@ public class OfficeReadPlatformServiceImpl implements OfficeReadPlatformService
|
||||
String hierarchySearchString = hierarchy + "%";
|
||||
|
||||
OfficeTransactionMapper rm = new OfficeTransactionMapper();
|
||||
String sql = "select " + rm.officeTransactionSchema()
|
||||
String sql = "select " + rm.schema()
|
||||
+ " where (fromoff.hierarchy like ? or tooff.hierarchy like ?) order by ot.transaction_date, ot.id";
|
||||
|
||||
return this.jdbcTemplate.query(sql, rm, new Object[] { hierarchySearchString, hierarchySearchString });
|
||||
@@ -248,6 +247,6 @@ public class OfficeReadPlatformServiceImpl implements OfficeReadPlatformService
|
||||
final Collection<OfficeData> parentLookups = retrieveAllOfficesForDropdown();
|
||||
final Collection<CurrencyData> currencyOptions = currencyReadPlatformService.retrieveAllowedCurrencies();
|
||||
|
||||
return new OfficeTransactionData(new LocalDate(), parentLookups, currencyOptions);
|
||||
return OfficeTransactionData.template(new LocalDate(), parentLookups, currencyOptions);
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -26,7 +26,7 @@ import org.mifosplatform.infrastructure.core.data.CommandProcessingResult;
|
||||
import org.mifosplatform.infrastructure.core.serialization.ApiRequestJsonSerializationSettings;
|
||||
import org.mifosplatform.infrastructure.core.serialization.DefaultToApiJsonSerializer;
|
||||
import org.mifosplatform.infrastructure.security.service.PlatformSecurityContext;
|
||||
import org.mifosplatform.organisation.office.data.OfficeLookup;
|
||||
import org.mifosplatform.organisation.office.data.OfficeData;
|
||||
import org.mifosplatform.organisation.office.service.OfficeReadPlatformService;
|
||||
import org.mifosplatform.organisation.staff.data.StaffData;
|
||||
import org.mifosplatform.organisation.staff.service.StaffReadPlatformService;
|
||||
@@ -107,7 +107,7 @@ public class StaffApiResource {
|
||||
|
||||
StaffData staff = this.readPlatformService.retrieveStaff(staffId);
|
||||
if (settings.isTemplate()) {
|
||||
final Collection<OfficeLookup> allowedOffices = officeReadPlatformService.retrieveAllOfficesForLookup();
|
||||
final Collection<OfficeData> allowedOffices = officeReadPlatformService.retrieveAllOfficesForDropdown();
|
||||
staff = StaffData.templateData(staff, allowedOffices);
|
||||
}
|
||||
|
||||
|
||||
+10
-5
@@ -2,7 +2,7 @@ package org.mifosplatform.organisation.staff.data;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.mifosplatform.organisation.office.data.OfficeLookup;
|
||||
import org.mifosplatform.organisation.office.data.OfficeData;
|
||||
|
||||
/**
|
||||
* Immutable data object representing staff data.
|
||||
@@ -18,15 +18,20 @@ public class StaffData {
|
||||
private final boolean isLoanOfficer;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private final Collection<OfficeLookup> allowedOffices;
|
||||
private final Collection<OfficeData> allowedOffices;
|
||||
|
||||
public static StaffData templateData(final StaffData staff, final Collection<OfficeLookup> allowedOffices) {
|
||||
public static StaffData templateData(final StaffData staff, final Collection<OfficeData> allowedOffices) {
|
||||
return new StaffData(staff.id, staff.firstname, staff.lastname, staff.displayName, staff.officeId, staff.officeName,
|
||||
staff.isLoanOfficer, allowedOffices);
|
||||
}
|
||||
|
||||
public StaffData(final Long id, final String firstname, final String lastname, final String displayName, final Long officeId,
|
||||
final String officeName, final boolean isLoanOfficer, final Collection<OfficeLookup> allowedOffices) {
|
||||
public static StaffData instance(final Long id, final String firstname, final String lastname, final String displayName,
|
||||
final Long officeId, final String officeName, final boolean isLoanOfficer) {
|
||||
return new StaffData(id, firstname, lastname, displayName, officeId, officeName, isLoanOfficer, null);
|
||||
}
|
||||
|
||||
private StaffData(final Long id, final String firstname, final String lastname, final String displayName, final Long officeId,
|
||||
final String officeName, final boolean isLoanOfficer, final Collection<OfficeData> allowedOffices) {
|
||||
this.id = id;
|
||||
this.firstname = firstname;
|
||||
this.lastname = lastname;
|
||||
|
||||
+2
-3
@@ -12,13 +12,12 @@ import javax.persistence.UniqueConstraint;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.mifosplatform.infrastructure.core.api.JsonCommand;
|
||||
import org.mifosplatform.infrastructure.core.domain.AbstractAuditableCustom;
|
||||
import org.mifosplatform.organisation.office.domain.Office;
|
||||
import org.mifosplatform.useradministration.domain.AppUser;
|
||||
import org.springframework.data.jpa.domain.AbstractPersistable;
|
||||
|
||||
@Entity
|
||||
@Table(name = "m_staff", uniqueConstraints = { @UniqueConstraint(columnNames = { "display_name" }, name = "display_name") })
|
||||
public class Staff extends AbstractAuditableCustom<AppUser, Long> {
|
||||
public class Staff extends AbstractPersistable<Long> {
|
||||
|
||||
@Column(name = "firstname", length = 50)
|
||||
private String firstname;
|
||||
|
||||
+5
-5
@@ -58,7 +58,7 @@ public class StaffReadPlatformServiceImpl implements StaffReadPlatformService {
|
||||
final boolean isLoanOfficer = rs.getBoolean("isLoanOfficer");
|
||||
final String officeName = rs.getString("officeName");
|
||||
|
||||
return new StaffData(id, firstname, lastname, displayName, officeId, officeName, isLoanOfficer, null);
|
||||
return StaffData.instance(id, firstname, lastname, displayName, officeId, officeName, isLoanOfficer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,8 +107,8 @@ public class StaffReadPlatformServiceImpl implements StaffReadPlatformService {
|
||||
final StaffGroupMapper staffGroupMapper = new StaffGroupMapper();
|
||||
final String groupSql = "select distinct " + staffGroupMapper.schema();
|
||||
|
||||
final List<StaffAccountSummaryCollectionData.ClientSummary> clientSummaryList = this.jdbcTemplate.query(clientSql, staffClientMapper,
|
||||
new Object[] { loanOfficerId });
|
||||
final List<StaffAccountSummaryCollectionData.ClientSummary> clientSummaryList = this.jdbcTemplate.query(clientSql,
|
||||
staffClientMapper, new Object[] { loanOfficerId });
|
||||
|
||||
for (StaffAccountSummaryCollectionData.ClientSummary clientSummary : clientSummaryList) {
|
||||
|
||||
@@ -123,8 +123,8 @@ public class StaffReadPlatformServiceImpl implements StaffReadPlatformService {
|
||||
|
||||
for (StaffAccountSummaryCollectionData.GroupSummary groupSummary : groupSummaryList) {
|
||||
|
||||
final Collection<GroupAccountSummaryData> groupLoanAccounts = this.groupReadPlatformService.retrieveGroupLoanAccountsByLoanOfficerId(
|
||||
groupSummary.getId(), loanOfficerId);
|
||||
final Collection<GroupAccountSummaryData> groupLoanAccounts = this.groupReadPlatformService
|
||||
.retrieveGroupLoanAccountsByLoanOfficerId(groupSummary.getId(), loanOfficerId);
|
||||
|
||||
groupSummary.setLoans(groupLoanAccounts);
|
||||
}
|
||||
|
||||
+1
-1
@@ -85,7 +85,7 @@ public class ChargesApiResource {
|
||||
ChargeData charge = this.readPlatformService.retrieveCharge(chargeId);
|
||||
if (settings.isTemplate()) {
|
||||
ChargeData templateData = this.readPlatformService.retrieveNewChargeDetails();
|
||||
charge = new ChargeData(charge, templateData);
|
||||
charge = ChargeData.withTemplate(charge, templateData);
|
||||
}
|
||||
|
||||
return this.toApiJsonSerializer.serialize(settings, charge, CHARGES_DATA_PARAMETERS);
|
||||
|
||||
+9
-20
@@ -27,38 +27,27 @@ public class ChargeData {
|
||||
private final List<EnumOptionData> chargeAppliesToOptions;
|
||||
private final List<EnumOptionData> chargeTimeTypeOptions;
|
||||
|
||||
public static ChargeData template(final Collection<CurrencyData> currencyOptions, final List<EnumOptionData> chargeCalculationTypeOptions,
|
||||
final List<EnumOptionData> chargeAppliesToOptions, final List<EnumOptionData> chargeTimeTypeOptions) {
|
||||
|
||||
public static ChargeData template(final Collection<CurrencyData> currencyOptions,
|
||||
final List<EnumOptionData> chargeCalculationTypeOptions, final List<EnumOptionData> chargeAppliesToOptions,
|
||||
final List<EnumOptionData> chargeTimeTypeOptions) {
|
||||
return new ChargeData(null, null, null, null, null, null, null, false, false, currencyOptions, chargeCalculationTypeOptions,
|
||||
chargeAppliesToOptions, chargeTimeTypeOptions);
|
||||
}
|
||||
|
||||
public ChargeData(final ChargeData charge, final ChargeData template) {
|
||||
this(charge.id, charge.name, charge.amount, charge.currency, charge.chargeTimeType, charge.chargeAppliesTo,
|
||||
public static ChargeData withTemplate(final ChargeData charge, final ChargeData template) {
|
||||
return new ChargeData(charge.id, charge.name, charge.amount, charge.currency, charge.chargeTimeType, charge.chargeAppliesTo,
|
||||
charge.chargeCalculationType, charge.penalty, charge.active, template.currencyOptions,
|
||||
template.chargeCalculationTypeOptions, template.chargeAppliesToOptions, template.chargeTimeTypeOptions);
|
||||
}
|
||||
|
||||
public ChargeData(final Long id, final String name, final BigDecimal amount, final CurrencyData currency,
|
||||
public static ChargeData instance(final Long id, final String name, final BigDecimal amount, final CurrencyData currency,
|
||||
final EnumOptionData chargeTimeType, final EnumOptionData chargeAppliesTo, final EnumOptionData chargeCalculationType,
|
||||
final boolean penalty, final boolean active) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.amount = amount;
|
||||
this.currency = currency;
|
||||
this.chargeTimeType = chargeTimeType;
|
||||
this.chargeAppliesTo = chargeAppliesTo;
|
||||
this.chargeCalculationType = chargeCalculationType;
|
||||
this.penalty = penalty;
|
||||
this.active = active;
|
||||
this.currencyOptions = null;
|
||||
this.chargeCalculationTypeOptions = null;
|
||||
this.chargeAppliesToOptions = null;
|
||||
this.chargeTimeTypeOptions = null;
|
||||
return new ChargeData(id, name, amount, currency, chargeTimeType, chargeAppliesTo, chargeCalculationType, penalty, active, null,
|
||||
null, null, null);
|
||||
}
|
||||
|
||||
public ChargeData(final Long id, final String name, final BigDecimal amount, final CurrencyData currency,
|
||||
private ChargeData(final Long id, final String name, final BigDecimal amount, final CurrencyData currency,
|
||||
final EnumOptionData chargeTimeType, final EnumOptionData chargeAppliesTo, final EnumOptionData chargeCalculationType,
|
||||
final boolean penalty, final boolean active, final Collection<CurrencyData> currencyOptions,
|
||||
final List<EnumOptionData> chargeCalculationTypeOptions, final List<EnumOptionData> chargeAppliesToOptions,
|
||||
|
||||
+2
-3
@@ -10,12 +10,11 @@ import javax.persistence.Table;
|
||||
import javax.persistence.UniqueConstraint;
|
||||
|
||||
import org.mifosplatform.infrastructure.core.api.JsonCommand;
|
||||
import org.mifosplatform.infrastructure.core.domain.AbstractAuditableCustom;
|
||||
import org.mifosplatform.useradministration.domain.AppUser;
|
||||
import org.springframework.data.jpa.domain.AbstractPersistable;
|
||||
|
||||
@Entity
|
||||
@Table(name = "m_charge", uniqueConstraints = { @UniqueConstraint(columnNames = { "name" }, name = "name") })
|
||||
public class Charge extends AbstractAuditableCustom<AppUser, Long> {
|
||||
public class Charge extends AbstractPersistable<Long> {
|
||||
|
||||
@Column(name = "name", length = 100)
|
||||
private String name;
|
||||
|
||||
+1
-1
@@ -185,7 +185,7 @@ public class ChargeReadPlatformServiceImpl implements ChargeReadPlatformService
|
||||
final boolean penalty = rs.getBoolean("penalty");
|
||||
final boolean active = rs.getBoolean("active");
|
||||
|
||||
return new ChargeData(id, name, amount, currency, chargeTimeType, chargeAppliesToType, chargeCalculationType, penalty, active);
|
||||
return ChargeData.instance(id, name, amount, currency, chargeTimeType, chargeAppliesToType, chargeCalculationType, penalty, active);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -87,8 +87,8 @@ public class ClientIdentifiersApiResource {
|
||||
|
||||
context.authenticatedUser().validateHasReadPermission(resourceNameForPermissions);
|
||||
|
||||
Collection<CodeValueData> codeValues = codeValueReadPlatformService.retrieveCustomIdentifierCodeValues();
|
||||
ClientIdentifierData clientIdentifierData = ClientIdentifierData.template(codeValues);
|
||||
final Collection<CodeValueData> codeValues = codeValueReadPlatformService.retrieveCustomIdentifierCodeValues();
|
||||
final ClientIdentifierData clientIdentifierData = ClientIdentifierData.template(codeValues);
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.toApiJsonSerializer.serialize(settings, clientIdentifierData, CLIENT_IDENTIFIER_DATA_PARAMETERS);
|
||||
@@ -123,8 +123,8 @@ public class ClientIdentifiersApiResource {
|
||||
@Path("{identifierId}")
|
||||
@Consumes({ MediaType.APPLICATION_JSON })
|
||||
@Produces({ MediaType.APPLICATION_JSON })
|
||||
public String getClientIdentifier(@PathParam("clientId") final Long clientId, @PathParam("identifierId") final Long clientIdentifierId,
|
||||
@Context final UriInfo uriInfo) {
|
||||
public String retrieveClientIdentifiers(@PathParam("clientId") final Long clientId,
|
||||
@PathParam("identifierId") final Long clientIdentifierId, @Context final UriInfo uriInfo) {
|
||||
|
||||
context.authenticatedUser().validateHasReadPermission(resourceNameForPermissions);
|
||||
|
||||
|
||||
@@ -12,7 +12,11 @@ public class FundData {
|
||||
@SuppressWarnings("unused")
|
||||
private String externalId;
|
||||
|
||||
public FundData(final Long id, final String name, final String externalId) {
|
||||
public static FundData instance(final Long id, final String name, final String externalId) {
|
||||
return new FundData(id, name, externalId);
|
||||
}
|
||||
|
||||
private FundData(final Long id, final String name, final String externalId) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.externalId = externalId;
|
||||
|
||||
@@ -10,13 +10,12 @@ import javax.persistence.UniqueConstraint;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.mifosplatform.infrastructure.core.api.JsonCommand;
|
||||
import org.mifosplatform.infrastructure.core.domain.AbstractAuditableCustom;
|
||||
import org.mifosplatform.useradministration.domain.AppUser;
|
||||
import org.springframework.data.jpa.domain.AbstractPersistable;
|
||||
|
||||
@Entity
|
||||
@Table(name = "m_fund", uniqueConstraints = { @UniqueConstraint(columnNames = { "name" }, name = "fund_name_org"),
|
||||
@UniqueConstraint(columnNames = { "external_id" }, name = "fund_externalid_org") })
|
||||
public class Fund extends AbstractAuditableCustom<AppUser, Long> {
|
||||
public class Fund extends AbstractPersistable<Long> {
|
||||
|
||||
@Column(name = "name")
|
||||
private String name;
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ public class FundReadPlatformServiceImpl implements FundReadPlatformService {
|
||||
final String name = rs.getString("name");
|
||||
final String externalId = rs.getString("externalId");
|
||||
|
||||
return new FundData(id, name, externalId);
|
||||
return FundData.instance(id, name, externalId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user