diff --git a/service/src/main/java/io/mifos/teller/service/internal/command/handler/TellerAggregate.java b/service/src/main/java/io/mifos/teller/service/internal/command/handler/TellerAggregate.java index a4f01f6..6540f4e 100644 --- a/service/src/main/java/io/mifos/teller/service/internal/command/handler/TellerAggregate.java +++ b/service/src/main/java/io/mifos/teller/service/internal/command/handler/TellerAggregate.java @@ -136,6 +136,10 @@ public String process(final ChangeTellerCommand changeTellerCommand) { tellerEntity.setVaultAccountIdentifier(teller.getVaultAccountIdentifier()); tellerEntity.setChequesReceivableAccount(teller.getChequesReceivableAccount()); tellerEntity.setCashdrawLimit(teller.getCashdrawLimit()); + tellerEntity.setCashOverShortAccount(teller.getCashOverShortAccount()); + tellerEntity.setDenominationRequired( + teller.getDenominationRequired() != null ? teller.getDenominationRequired() : Boolean.FALSE + ); tellerEntity.setLastModifiedBy(UserContextHolder.checkedGetUser()); tellerEntity.setLastModifiedOn(LocalDateTime.now(Clock.systemUTC())); diff --git a/service/src/main/java/io/mifos/teller/service/internal/mapper/TellerMapper.java b/service/src/main/java/io/mifos/teller/service/internal/mapper/TellerMapper.java index baeea0d..3f7895d 100644 --- a/service/src/main/java/io/mifos/teller/service/internal/mapper/TellerMapper.java +++ b/service/src/main/java/io/mifos/teller/service/internal/mapper/TellerMapper.java @@ -34,6 +34,7 @@ public static Teller map(final TellerEntity tellerEntity) { teller.setAssignedEmployee(tellerEntity.getAssignedEmployeeIdentifier()); teller.setChequesReceivableAccount(tellerEntity.getChequesReceivableAccount()); teller.setCashOverShortAccount(tellerEntity.getCashOverShortAccount()); + teller.setDenominationRequired(tellerEntity.getDenominationRequired()); teller.setState(tellerEntity.getState()); if (tellerEntity.getCreatedBy() != null) { teller.setCreatedBy(tellerEntity.getCreatedBy()); @@ -59,8 +60,11 @@ public static TellerEntity map(final String officeIdentifier, final Teller telle tellerEntity.setTellerAccountIdentifier(teller.getTellerAccountIdentifier()); tellerEntity.setVaultAccountIdentifier(teller.getVaultAccountIdentifier()); tellerEntity.setChequesReceivableAccount(teller.getChequesReceivableAccount()); - tellerEntity.setCashOverShortAccount(teller.getCashOverShortAccount()); tellerEntity.setCashdrawLimit(teller.getCashdrawLimit()); + tellerEntity.setCashOverShortAccount(teller.getCashOverShortAccount()); + tellerEntity.setDenominationRequired( + teller.getDenominationRequired() != null ? teller.getDenominationRequired() : Boolean.FALSE + ); tellerEntity.setAssignedEmployeeIdentifier(teller.getAssignedEmployee()); if (teller.getState() != null) { tellerEntity.setState(teller.getState()); diff --git a/service/src/main/java/io/mifos/teller/service/internal/repository/TellerEntity.java b/service/src/main/java/io/mifos/teller/service/internal/repository/TellerEntity.java index c8c156b..3dd3ff5 100644 --- a/service/src/main/java/io/mifos/teller/service/internal/repository/TellerEntity.java +++ b/service/src/main/java/io/mifos/teller/service/internal/repository/TellerEntity.java @@ -53,6 +53,8 @@ public class TellerEntity { private String chequesReceivableAccount; @Column(name = "cash_over_short_account", nullable = false, length = 34) private String cashOverShortAccount; + @Column(name = "denomination_required", nullable = false) + private Boolean denominationRequired; @Column(name = "assigned_employee_identifier", nullable = true, length = 32) private String assignedEmployeeIdentifier; @Column(name = "a_state", nullable = false, length = 256) @@ -158,6 +160,14 @@ public void setCashOverShortAccount(final String cashOverShortAccount) { this.cashOverShortAccount = cashOverShortAccount; } + public Boolean getDenominationRequired() { + return this.denominationRequired; + } + + public void setDenominationRequired(final Boolean denominationRequired) { + this.denominationRequired = denominationRequired; + } + public String getAssignedEmployeeIdentifier() { return this.assignedEmployeeIdentifier; } diff --git a/service/src/main/resources/db/migrations/mariadb/V5__add_teller_denomination.sql b/service/src/main/resources/db/migrations/mariadb/V5__add_teller_denomination.sql index 301f5b1..ab58994 100644 --- a/service/src/main/resources/db/migrations/mariadb/V5__add_teller_denomination.sql +++ b/service/src/main/resources/db/migrations/mariadb/V5__add_teller_denomination.sql @@ -15,6 +15,7 @@ -- ALTER TABLE tajet_teller ADD cash_over_short_account VARCHAR(34) NULL; +ALTER TABLE tajet_teller ADD denomination_required BOOLEAN NOT NULL DEFAULT FALSE; CREATE TABLE tajet_teller_denominations ( id BIGINT NOT NULL AUTO_INCREMENT,