Skip to content
Permalink
Browse files
edited during review
  • Loading branch information
mgeiss committed Jun 7, 2017
1 parent 480ddbd commit d66dbe2dba8540aaae497bee9cc8b659216cddd1
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 21 deletions.
@@ -25,7 +25,7 @@
public interface TellerManager {

@RequestMapping(
value = "/management/{officeIdentifier}",
value = "/offices/{officeIdentifier}",
method = RequestMethod.POST,
consumes = MediaType.APPLICATION_JSON_VALUE,
produces = MediaType.APPLICATION_JSON_VALUE
@@ -38,7 +38,7 @@ public interface TellerManager {
void create(@PathVariable("officeIdentifier") final String officeIdentifier, @RequestBody @Valid final Teller teller);

@RequestMapping(
value = "/management/{officeIdentifier}/teller/{tellerCode}",
value = "/offices/{officeIdentifier}/teller/{tellerCode}",
method = RequestMethod.GET,
consumes = MediaType.APPLICATION_JSON_VALUE,
produces = MediaType.ALL_VALUE
@@ -50,7 +50,7 @@ Teller find(@PathVariable("officeIdentifier") final String officeIdentifier,
@PathVariable("tellerCode") final String tellerCode);

@RequestMapping(
value = "/management/{officeIdentifier}/teller",
value = "/offices/{officeIdentifier}/teller",
method = RequestMethod.GET,
consumes = MediaType.APPLICATION_JSON_VALUE,
produces = MediaType.ALL_VALUE
@@ -61,7 +61,7 @@ Teller find(@PathVariable("officeIdentifier") final String officeIdentifier,
List<Teller> fetch(@PathVariable("officeIdentifier") final String officeIdentifier);

@RequestMapping(
value = "/management/{officeIdentifier}/teller/{tellerCode}",
value = "/offices/{officeIdentifier}/teller/{tellerCode}",
method = RequestMethod.PUT,
consumes = MediaType.APPLICATION_JSON_VALUE,
produces = MediaType.APPLICATION_JSON_VALUE
@@ -75,7 +75,7 @@ void change(@PathVariable("officeIdentifier") final String officeIdentifier,
@RequestBody @Valid final Teller teller);

@RequestMapping(
value = "/management/{officeIdentifier}/teller/{tellerCode}/commands",
value = "/offices/{officeIdentifier}/teller/{tellerCode}/commands",
method = RequestMethod.POST,
consumes = MediaType.APPLICATION_JSON_VALUE,
produces = MediaType.APPLICATION_JSON_VALUE
@@ -89,7 +89,7 @@ void post(@PathVariable("officeIdentifier") final String officeIdentifier,
@RequestBody @Valid final TellerManagementCommand tellerManagementCommand);

@RequestMapping(
value = "/management/{officeIdentifier}/teller/{tellerCode}/balance",
value = "/offices/{officeIdentifier}/teller/{tellerCode}/balance",
method = RequestMethod.GET,
consumes = MediaType.APPLICATION_JSON_VALUE,
produces = MediaType.ALL_VALUE
@@ -101,7 +101,7 @@ TellerBalanceSheet getBalance(@PathVariable("officeIdentifier") final String off
@PathVariable("tellerCode") final String tellerCode);

@RequestMapping(
value = "/operations/{tellerCode}/auth",
value = "/teller/{tellerCode}/auth",
method = RequestMethod.POST,
consumes = MediaType.APPLICATION_JSON_VALUE,
produces = MediaType.APPLICATION_JSON_VALUE
@@ -114,7 +114,7 @@ void auth(@PathVariable("tellerCode") final String tellerCode,
@RequestBody @Valid final TellerAuthentication tellerAuthentication);

@RequestMapping(
value = "/operations/{tellerCode}",
value = "/teller/{tellerCode}",
method = RequestMethod.POST,
consumes = MediaType.APPLICATION_JSON_VALUE,
produces = MediaType.APPLICATION_JSON_VALUE
@@ -126,7 +126,7 @@ void post(@PathVariable("tellerCode") final String tellerCode,
@RequestParam(value = "command", required = true) final String command);

@RequestMapping(
value = "/operations/{tellerCode}/transactions",
value = "/teller/{tellerCode}/transactions",
method = RequestMethod.POST,
consumes = MediaType.APPLICATION_JSON_VALUE,
produces = MediaType.APPLICATION_JSON_VALUE
@@ -139,7 +139,7 @@ TellerTransactionCosts post(@PathVariable("tellerCode") final String tellerCode,
@RequestBody @Valid final TellerTransaction tellerTransaction);

@RequestMapping(
value = "/operations/{tellerCode}/transactions/{identifier}",
value = "/teller/{tellerCode}/transactions/{identifier}",
method = RequestMethod.POST,
consumes = MediaType.APPLICATION_JSON_VALUE,
produces = MediaType.APPLICATION_JSON_VALUE
@@ -150,4 +150,16 @@ TellerTransactionCosts post(@PathVariable("tellerCode") final String tellerCode,
void confirm(@PathVariable("tellerCode") final String tellerCode,
@PathVariable("identifier") final String tellerTransactionIdentifier,
@RequestParam(value = "command", required = true) final String command);

@RequestMapping(
value = "/teller/{tellerCode}/transactions",
method = RequestMethod.GET,
consumes = MediaType.APPLICATION_JSON_VALUE,
produces = MediaType.ALL_VALUE
)
@ThrowsExceptions({
@ThrowsException(status = HttpStatus.NOT_FOUND, exception = TellerNotFoundException.class)
})
List<TellerTransaction> fetch(@PathVariable("tellerCode") final String tellerCode,
@RequestParam(value = "status", required = false) final String status);
}
@@ -26,7 +26,7 @@ public enum Status {
private String tellerAccountIdentifier;
@ValidIdentifier
private String vaultAccountIdentifier;
private String status;
private Status status;
private String createdBy;
private String createdOn;
private String lastModifiedBy;
@@ -77,11 +77,11 @@ public void setVaultAccountIdentifier(final String vaultAccountIdentifier) {
}

public String getStatus() {
return this.status;
return this.status.name();
}

public void setStatus(final String status) {
this.status = status;
this.status = Status.valueOf(status);
}

public String getCreatedBy() {
@@ -3,7 +3,7 @@
public class TellerAuthentication {

private String employeeIdentifier;
private String password;
private byte[] password;

public TellerAuthentication() {
super();
@@ -17,11 +17,11 @@ public void setEmployeeIdentifier(final String employeeIdentifier) {
this.employeeIdentifier = employeeIdentifier;
}

public String getPassword() {
public byte[] getPassword() {
return this.password;
}

public void setPassword(final String password) {
public void setPassword(final byte[] password) {
this.password = password;
}
}
@@ -1,5 +1,9 @@
package io.mifos.teller.domain;

import io.mifos.core.lang.validation.constraints.ValidIdentifier;

import javax.validation.constraints.NotNull;

public class TellerManagementCommand {

public enum Action {
@@ -12,9 +16,11 @@ public enum Adjustment {
CREDIT
}

@NotNull
private Action action;
private Adjustment adjustment;
private Double amount;
@ValidIdentifier(optional = true)
private String assignedEmployeeIdentifier;

public TellerManagementCommand() {
@@ -2,6 +2,9 @@

import io.mifos.core.lang.validation.constraints.ValidIdentifier;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotNull;

public class TellerTransaction {

public enum State {
@@ -12,11 +15,18 @@ public enum State {

@ValidIdentifier(optional = true)
private String identifier;
@NotNull
private String transactionType;
@NotNull
private String transactionDate;
@ValidIdentifier
private String productIdentifier;
private String accountIdentifier;
@ValidIdentifier
private String customerAccountIdentifier;
@ValidIdentifier
private String clerk;
@NotNull
@DecimalMin("0.00")
private Double amount;
private State state;

@@ -56,12 +66,12 @@ public void setProductIdentifier(final String productIdentifier) {
this.productIdentifier = productIdentifier;
}

public String getAccountIdentifier() {
return this.accountIdentifier;
public String getCustomerAccountIdentifier() {
return this.customerAccountIdentifier;
}

public void setAccountIdentifier(final String accountIdentifier) {
this.accountIdentifier = accountIdentifier;
public void setCustomerAccountIdentifier(final String customerAccountIdentifier) {
this.customerAccountIdentifier = customerAccountIdentifier;
}

public String getClerk() {

0 comments on commit d66dbe2

Please sign in to comment.