Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

Commit

Permalink
store denomination flag in DB
Browse files Browse the repository at this point in the history
  • Loading branch information
mgeiss committed Oct 17, 2017
1 parent 0d73a37 commit 3254284
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
Expand Up @@ -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()));

Expand Down
Expand Up @@ -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());
Expand All @@ -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());
Expand Down
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
}
Expand Down
Expand Up @@ -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,
Expand Down

0 comments on commit 3254284

Please sign in to comment.