Introduce Lombok to teller module (FINERACT-1779)
This commit is contained in:
committed by
Aleksandar Vidakovic
parent
cd9439fbbf
commit
fe50763549
+27
-160
@@ -21,6 +21,10 @@ package org.apache.fineract.organisation.teller.data;
|
|||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
import org.apache.fineract.organisation.staff.data.StaffData;
|
import org.apache.fineract.organisation.staff.data.StaffData;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -32,48 +36,28 @@ import org.apache.fineract.organisation.staff.data.StaffData;
|
|||||||
* @see org.apache.fineract.organisation.teller.domain.Cashier
|
* @see org.apache.fineract.organisation.teller.domain.Cashier
|
||||||
* @since 2.0.0
|
* @since 2.0.0
|
||||||
*/
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Accessors(chain = true)
|
||||||
public final class CashierData implements Serializable {
|
public final class CashierData implements Serializable {
|
||||||
|
|
||||||
private final Long id;
|
private Long id;
|
||||||
private final Long tellerId;
|
private Long tellerId;
|
||||||
private final Long officeId;
|
private Long officeId;
|
||||||
private final Long staffId;
|
private Long staffId;
|
||||||
private final String description;
|
private String description;
|
||||||
private final LocalDate startDate;
|
private LocalDate startDate;
|
||||||
private final LocalDate endDate;
|
private LocalDate endDate;
|
||||||
private final Boolean isFullDay;
|
private Boolean isFullDay;
|
||||||
private final String startTime;
|
private String startTime;
|
||||||
private final String endTime;
|
private String endTime;
|
||||||
|
|
||||||
// Template fields
|
// Template fields
|
||||||
private final String officeName;
|
private String officeName;
|
||||||
private final String tellerName;
|
private String tellerName;
|
||||||
private final String staffName;
|
private String staffName;
|
||||||
private final Collection<StaffData> staffOptions;
|
private Collection<StaffData> staffOptions;
|
||||||
|
|
||||||
/*
|
|
||||||
* Creates a new cashier.
|
|
||||||
*/
|
|
||||||
private CashierData(final Long id, final Long officeId, String officeName, final Long staffId, final String staffName,
|
|
||||||
final Long tellerId, final String tellerName, final String description, final LocalDate startDate, final LocalDate endDate,
|
|
||||||
final Boolean isFullDay, final String startTime, final String endTime, Collection<StaffData> staffOptions) {
|
|
||||||
this.id = id;
|
|
||||||
this.officeId = officeId;
|
|
||||||
this.staffId = staffId;
|
|
||||||
this.tellerId = tellerId;
|
|
||||||
this.description = description;
|
|
||||||
this.startDate = startDate;
|
|
||||||
this.endDate = endDate;
|
|
||||||
this.isFullDay = isFullDay;
|
|
||||||
this.startTime = startTime;
|
|
||||||
this.endTime = endTime;
|
|
||||||
|
|
||||||
this.officeName = officeName;
|
|
||||||
this.tellerName = tellerName;
|
|
||||||
this.staffName = staffName;
|
|
||||||
this.staffOptions = staffOptions;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new cashier.
|
* Creates a new cashier.
|
||||||
@@ -115,8 +99,9 @@ public final class CashierData implements Serializable {
|
|||||||
public static CashierData instance(final Long id, final Long officeId, String officeName, final Long staffId, final String staffName,
|
public static CashierData instance(final Long id, final Long officeId, String officeName, final Long staffId, final String staffName,
|
||||||
final Long tellerId, final String tellerName, final String description, final LocalDate startDate, final LocalDate endDate,
|
final Long tellerId, final String tellerName, final String description, final LocalDate startDate, final LocalDate endDate,
|
||||||
final Boolean isFullDay, final String startTime, final String endTime) {
|
final Boolean isFullDay, final String startTime, final String endTime) {
|
||||||
return new CashierData(id, officeId, officeName, staffId, staffName, tellerId, tellerName, description, startDate, endDate,
|
return new CashierData().setId(id).setOfficeId(officeId).setOfficeName(officeName).setStaffId(staffId).setStaffName(staffName)
|
||||||
isFullDay, startTime, endTime, null);
|
.setTellerId(tellerId).setTellerName(tellerName).setDescription(description).setStartDate(startDate).setEndDate(endDate)
|
||||||
|
.setIsFullDay(isFullDay).setStartTime(startTime).setEndTime(endTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -124,125 +109,7 @@ public final class CashierData implements Serializable {
|
|||||||
*/
|
*/
|
||||||
public static CashierData template(final Long officeId, final String officeName, final Long tellerId, final String tellerName,
|
public static CashierData template(final Long officeId, final String officeName, final Long tellerId, final String tellerName,
|
||||||
final Collection<StaffData> staffOptions) {
|
final Collection<StaffData> staffOptions) {
|
||||||
return new CashierData(null, officeId, officeName, null, null, tellerId, tellerName, null, null, null, null, null, null,
|
return new CashierData().setOfficeId(officeId).setOfficeName(officeName).setTellerId(tellerId).setTellerName(tellerName)
|
||||||
staffOptions);
|
.setStaffOptions(staffOptions);
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the primary key of this cashier.
|
|
||||||
*
|
|
||||||
* @return the primary key of this cashier
|
|
||||||
*/
|
|
||||||
public Long getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the primary key of this cashiers related office.
|
|
||||||
*
|
|
||||||
* @return the primary key of this cashiers related office
|
|
||||||
*/
|
|
||||||
public Long getOfficeId() {
|
|
||||||
return officeId;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the primary key of this cashiers related staff.
|
|
||||||
*
|
|
||||||
* @return the primary key of this cashiers related staff
|
|
||||||
*/
|
|
||||||
public Long getStaffId() {
|
|
||||||
return staffId;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the primary key of this cashiers related teller.
|
|
||||||
*
|
|
||||||
* @return the primary key of this cashiers related teller
|
|
||||||
*/
|
|
||||||
public Long getTellerId() {
|
|
||||||
return tellerId;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the description of this cashier.
|
|
||||||
*
|
|
||||||
* @return the description of this cashier
|
|
||||||
*/
|
|
||||||
public String getDescription() {
|
|
||||||
return description;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the valid from date of this cashier.
|
|
||||||
*
|
|
||||||
* <p>
|
|
||||||
* The valid from/to dates may be used to define a time period in which the cashier is assignable to a teller.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @return the valid from date of this cashier
|
|
||||||
*/
|
|
||||||
public LocalDate getStartDate() {
|
|
||||||
return startDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the valid to date of this cashier.
|
|
||||||
*
|
|
||||||
* <p>
|
|
||||||
* The valid from/to dates may be used to define a time period in which the cashier is assignable to a teller.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @return the valid to date of this cashier
|
|
||||||
*/
|
|
||||||
public LocalDate getEndDate() {
|
|
||||||
return endDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns whether this cashier works part time or not.
|
|
||||||
*
|
|
||||||
* @return {@code true} if this cashier works part time; {@code false} otherwise
|
|
||||||
*/
|
|
||||||
public Boolean isFullDay() {
|
|
||||||
return isFullDay;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the start time of this cashier.
|
|
||||||
*
|
|
||||||
* <p>
|
|
||||||
* The start/end times may be used to define a time period in which the cashier works part time.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @return the start time of this cashier
|
|
||||||
*/
|
|
||||||
public String getStartTime() {
|
|
||||||
return startTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the end time of this cashier.
|
|
||||||
*
|
|
||||||
* <p>
|
|
||||||
* The start/end times may be used to define a time period in which the cashier works part time.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @return the start time of this cashier
|
|
||||||
*/
|
|
||||||
public String getEndTime() {
|
|
||||||
return endTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getOfficeName() {
|
|
||||||
return officeName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTellerName() {
|
|
||||||
return tellerName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getStaffName() {
|
|
||||||
return staffName;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+33
-123
@@ -23,145 +23,55 @@ import java.math.BigDecimal;
|
|||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.OffsetDateTime;
|
import java.time.OffsetDateTime;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
import org.apache.fineract.organisation.monetary.data.CurrencyData;
|
import org.apache.fineract.organisation.monetary.data.CurrencyData;
|
||||||
import org.apache.fineract.organisation.teller.domain.CashierTxnType;
|
import org.apache.fineract.organisation.teller.domain.CashierTxnType;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Accessors(chain = true)
|
||||||
public final class CashierTransactionData implements Serializable {
|
public final class CashierTransactionData implements Serializable {
|
||||||
|
|
||||||
private final Long id;
|
private Long id;
|
||||||
private final Long cashierId;
|
private Long cashierId;
|
||||||
private final CashierTxnType txnType;
|
private CashierTxnType txnType;
|
||||||
private final BigDecimal txnAmount;
|
private BigDecimal txnAmount;
|
||||||
private final LocalDate txnDate;
|
private LocalDate txnDate;
|
||||||
private final Long entityId;
|
private Long entityId;
|
||||||
private final String entityType;
|
private String entityType;
|
||||||
private final String txnNote;
|
private String txnNote;
|
||||||
private final OffsetDateTime createdDate;
|
private OffsetDateTime createdDate;
|
||||||
|
|
||||||
// Template fields
|
// Template fields
|
||||||
private final Long officeId;
|
private Long officeId;
|
||||||
private final String officeName;
|
private String officeName;
|
||||||
private final Long tellerId;
|
private Long tellerId;
|
||||||
private final String tellerName;
|
private String tellerName;
|
||||||
private final String cashierName;
|
private String cashierName;
|
||||||
|
private CashierData cashierData;
|
||||||
private final CashierData cashierData;
|
private LocalDate startDate;
|
||||||
private final LocalDate startDate;
|
private LocalDate endDate;
|
||||||
private final LocalDate endDate;
|
private Collection<CurrencyData> currencyOptions;
|
||||||
|
|
||||||
private final Collection<CurrencyData> currencyOptions;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Creates a new cashier.
|
|
||||||
*/
|
|
||||||
private CashierTransactionData(final Long id, final Long cashierId, CashierTxnType txnType, final BigDecimal txnAmount,
|
|
||||||
final LocalDate txnDate, String txnNote, String entityType, Long entityId, OffsetDateTime createdDate, Long officeId,
|
|
||||||
String officeName, Long tellerId, String tellerName, String cashierName, CashierData cashierData, LocalDate startDate,
|
|
||||||
LocalDate endDate, final Collection<CurrencyData> currencyOptions) {
|
|
||||||
this.id = id;
|
|
||||||
this.cashierId = cashierId;
|
|
||||||
this.txnType = txnType;
|
|
||||||
this.txnAmount = txnAmount;
|
|
||||||
this.txnDate = txnDate;
|
|
||||||
this.txnNote = txnNote;
|
|
||||||
this.entityType = entityType;
|
|
||||||
this.entityId = entityId;
|
|
||||||
this.createdDate = createdDate;
|
|
||||||
|
|
||||||
this.officeId = officeId;
|
|
||||||
this.officeName = officeName;
|
|
||||||
this.tellerId = tellerId;
|
|
||||||
this.tellerName = tellerName;
|
|
||||||
this.cashierName = cashierName;
|
|
||||||
this.cashierData = cashierData;
|
|
||||||
|
|
||||||
this.startDate = startDate;
|
|
||||||
this.endDate = endDate;
|
|
||||||
|
|
||||||
this.currencyOptions = currencyOptions;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static CashierTransactionData instance(final Long id, final Long cashierId, CashierTxnType txnType, final BigDecimal txnAmount,
|
public static CashierTransactionData instance(final Long id, final Long cashierId, CashierTxnType txnType, final BigDecimal txnAmount,
|
||||||
final LocalDate txnDate, final String txnNote, final String entityType, final Long entityId, final OffsetDateTime createdDate,
|
final LocalDate txnDate, final String txnNote, final String entityType, final Long entityId, final OffsetDateTime createdDate,
|
||||||
final Long officeId, final String officeName, final Long tellerId, final String tellerName, final String cashierName,
|
final Long officeId, final String officeName, final Long tellerId, final String tellerName, final String cashierName,
|
||||||
final CashierData cashierData, LocalDate startDate, LocalDate endDate) {
|
final CashierData cashierData, LocalDate startDate, LocalDate endDate) {
|
||||||
return new CashierTransactionData(id, cashierId, txnType, txnAmount, txnDate, txnNote, entityType, entityId, createdDate, officeId,
|
return new CashierTransactionData().setId(id).setCashierId(cashierId).setTxnType(txnType).setTxnAmount(txnAmount)
|
||||||
officeName, tellerId, tellerName, cashierName, cashierData, startDate, endDate, null);
|
.setTxnDate(txnDate).setTxnNote(txnNote).setEntityType(entityType).setEntityId(entityId).setCreatedDate(createdDate)
|
||||||
|
.setOfficeId(officeId).setOfficeName(officeName).setTellerId(tellerId).setTellerName(tellerName).setCashierName(cashierName)
|
||||||
|
.setCashierData(cashierData).setStartDate(startDate).setEndDate(endDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static CashierTransactionData template(final Long cashierId, final Long tellerId, final String tellerName, final Long officeId,
|
public static CashierTransactionData template(final Long cashierId, final Long tellerId, final String tellerName, final Long officeId,
|
||||||
final String officeName, final String cashierName, final CashierData cashierData, LocalDate startDate, LocalDate endDate,
|
final String officeName, final String cashierName, final CashierData cashierData, LocalDate startDate, LocalDate endDate,
|
||||||
final Collection<CurrencyData> currencyOptions) {
|
final Collection<CurrencyData> currencyOptions) {
|
||||||
return new CashierTransactionData(null, cashierId, null, null, null, null, null, null, null, officeId, officeName, tellerId,
|
return new CashierTransactionData().setCashierId(cashierId).setOfficeId(officeId).setOfficeName(officeName).setTellerId(tellerId)
|
||||||
tellerName, cashierName, cashierData, startDate, endDate, currencyOptions);
|
.setTellerName(tellerName).setCashierName(cashierName).setCashierData(cashierData).setStartDate(startDate)
|
||||||
|
.setEndDate(endDate).setCurrencyOptions(currencyOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getCashierId() {
|
|
||||||
return cashierId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public CashierTxnType getTxnType() {
|
|
||||||
return txnType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BigDecimal getTxnAmount() {
|
|
||||||
return txnAmount;
|
|
||||||
}
|
|
||||||
|
|
||||||
public LocalDate getTxnDate() {
|
|
||||||
return txnDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTxnNote() {
|
|
||||||
return txnNote;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getEntityType() {
|
|
||||||
return entityType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getEntityId() {
|
|
||||||
return entityId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OffsetDateTime getCreatedDate() {
|
|
||||||
return createdDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getOfficeId() {
|
|
||||||
return officeId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getOfficeName() {
|
|
||||||
return officeName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getTellerId() {
|
|
||||||
return tellerId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTellerName() {
|
|
||||||
return tellerName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCashierName() {
|
|
||||||
return cashierName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public LocalDate getStartDate() {
|
|
||||||
return startDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public LocalDate getEndDate() {
|
|
||||||
return endDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public CashierData getCashierData() {
|
|
||||||
return cashierData;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -79,8 +79,8 @@ public class CashierTransactionDataValidator {
|
|||||||
Long staffId = cashier.getStaff().getId();
|
Long staffId = cashier.getStaff().getId();
|
||||||
final LocalDate fromDate = cashier.getStartDate();
|
final LocalDate fromDate = cashier.getStartDate();
|
||||||
final LocalDate endDate = cashier.getEndDate();
|
final LocalDate endDate = cashier.getEndDate();
|
||||||
final LocalDate tellerFromDate = teller.getStartLocalDate();
|
final LocalDate tellerFromDate = teller.getStartDate();
|
||||||
final LocalDate tellerEndDate = teller.getEndLocalDate();
|
final LocalDate tellerEndDate = teller.getEndDate();
|
||||||
/**
|
/**
|
||||||
* to validate cashier date range in range of teller date range
|
* to validate cashier date range in range of teller date range
|
||||||
*/
|
*/
|
||||||
@@ -95,7 +95,7 @@ public class CashierTransactionDataValidator {
|
|||||||
+ "' BETWEEN c.start_date AND c.end_date OR '" + endDate + "' BETWEEN c.start_date AND c.end_date )"
|
+ "' BETWEEN c.start_date AND c.end_date OR '" + endDate + "' BETWEEN c.start_date AND c.end_date )"
|
||||||
+ " OR ( c.start_date BETWEEN '" + fromDate + "' AND '" + endDate + "' OR c.end_date BETWEEN '" + fromDate + "' AND '"
|
+ " OR ( c.start_date BETWEEN '" + fromDate + "' AND '" + endDate + "' OR c.end_date BETWEEN '" + fromDate + "' AND '"
|
||||||
+ endDate + "'))";
|
+ endDate + "'))";
|
||||||
if (!cashier.isFullDay()) {
|
if (!cashier.getIsFullDay()) {
|
||||||
String startTime = cashier.getStartTime();
|
String startTime = cashier.getStartTime();
|
||||||
String endTime = cashier.getEndTime();
|
String endTime = cashier.getEndTime();
|
||||||
sql = sql + " AND ( Time(c.start_time) BETWEEN TIME(?) and TIME('" + endTime + "') or Time(c.end_time) BETWEEN TIME('"
|
sql = sql + " AND ( Time(c.start_time) BETWEEN TIME(?) and TIME('" + endTime + "') or Time(c.end_time) BETWEEN TIME('"
|
||||||
|
|||||||
+11
-17
@@ -20,27 +20,21 @@ package org.apache.fineract.organisation.teller.data;
|
|||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Accessors(chain = true)
|
||||||
public final class CashierTransactionTypeTotalsData implements Serializable {
|
public final class CashierTransactionTypeTotalsData implements Serializable {
|
||||||
|
|
||||||
private final Integer cashierTxnType;
|
private Integer cashierTxnType;
|
||||||
private final BigDecimal cashTotal;
|
private BigDecimal cashTotal;
|
||||||
|
|
||||||
private CashierTransactionTypeTotalsData(final Integer cashierTxnType, final BigDecimal cashTotal) {
|
|
||||||
this.cashierTxnType = cashierTxnType;
|
|
||||||
this.cashTotal = cashTotal;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static CashierTransactionTypeTotalsData instance(final Integer cashierTxnType, final BigDecimal cashTotal) {
|
public static CashierTransactionTypeTotalsData instance(final Integer cashierTxnType, final BigDecimal cashTotal) {
|
||||||
return new CashierTransactionTypeTotalsData(cashierTxnType, cashTotal);
|
return new CashierTransactionTypeTotalsData().setCashierTxnType(cashierTxnType).setCashTotal(cashTotal);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getCashierTxnType() {
|
|
||||||
return cashierTxnType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BigDecimal getCashTotal() {
|
|
||||||
return cashTotal;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+25
-90
@@ -21,6 +21,10 @@ package org.apache.fineract.organisation.teller.data;
|
|||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
import org.apache.fineract.organisation.office.data.OfficeData;
|
import org.apache.fineract.organisation.office.data.OfficeData;
|
||||||
import org.apache.fineract.organisation.staff.data.StaffData;
|
import org.apache.fineract.organisation.staff.data.StaffData;
|
||||||
import org.apache.fineract.organisation.teller.domain.TellerStatus;
|
import org.apache.fineract.organisation.teller.domain.TellerStatus;
|
||||||
@@ -34,47 +38,27 @@ import org.apache.fineract.organisation.teller.domain.TellerStatus;
|
|||||||
* @see java.io.Serializable
|
* @see java.io.Serializable
|
||||||
* @since 2.0.0
|
* @since 2.0.0
|
||||||
*/
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Accessors(chain = true)
|
||||||
public final class TellerData implements Serializable {
|
public final class TellerData implements Serializable {
|
||||||
|
|
||||||
private final Long id;
|
private Long id;
|
||||||
private final Long officeId;
|
private Long officeId;
|
||||||
private final Long debitAccountId;
|
private Long debitAccountId;
|
||||||
private final Long creditAccountId;
|
private Long creditAccountId;
|
||||||
private final String name;
|
private String name;
|
||||||
|
|
||||||
private final String description;
|
|
||||||
private final LocalDate startDate;
|
|
||||||
private final LocalDate endDate;
|
|
||||||
private final TellerStatus status;
|
|
||||||
private final Boolean hasTransactions;
|
|
||||||
private final Boolean hasMappedCashiers;
|
|
||||||
|
|
||||||
|
private String description;
|
||||||
|
private LocalDate startDate;
|
||||||
|
private LocalDate endDate;
|
||||||
|
private TellerStatus status;
|
||||||
|
private Boolean hasTransactions;
|
||||||
|
private Boolean hasMappedCashiers;
|
||||||
private String officeName;
|
private String officeName;
|
||||||
|
private Collection<OfficeData> officeOptions;
|
||||||
private final Collection<OfficeData> officeOptions;
|
private Collection<StaffData> staffOptions;
|
||||||
private final Collection<StaffData> staffOptions;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Sole private CTOR to create a new instance.
|
|
||||||
*/
|
|
||||||
private TellerData(final Long id, final Long officeId, final Long debitAccountId, final Long creditAccountId, final String name,
|
|
||||||
final String description, final LocalDate startDate, final LocalDate endDate, final TellerStatus status,
|
|
||||||
final Boolean hasTransactions, final Boolean hasMappedCashiers) {
|
|
||||||
|
|
||||||
this.id = id;
|
|
||||||
this.officeId = officeId;
|
|
||||||
this.debitAccountId = debitAccountId;
|
|
||||||
this.creditAccountId = creditAccountId;
|
|
||||||
this.name = name;
|
|
||||||
this.description = description;
|
|
||||||
this.startDate = startDate;
|
|
||||||
this.endDate = endDate;
|
|
||||||
this.status = status;
|
|
||||||
this.hasTransactions = hasTransactions;
|
|
||||||
this.hasMappedCashiers = hasMappedCashiers;
|
|
||||||
this.officeOptions = null;
|
|
||||||
this.staffOptions = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new teller data object.
|
* Creates a new teller data object.
|
||||||
@@ -106,61 +90,12 @@ public final class TellerData implements Serializable {
|
|||||||
public static TellerData instance(final Long id, final Long officeId, final Long debitAccountId, final Long creditAccountId,
|
public static TellerData instance(final Long id, final Long officeId, final Long debitAccountId, final Long creditAccountId,
|
||||||
final String name, final String description, final LocalDate startDate, final LocalDate endDate, final TellerStatus status,
|
final String name, final String description, final LocalDate startDate, final LocalDate endDate, final TellerStatus status,
|
||||||
final String officeName, final Boolean hasTransactions, final Boolean hasMappedCashiers) {
|
final String officeName, final Boolean hasTransactions, final Boolean hasMappedCashiers) {
|
||||||
TellerData tellerData = new TellerData(id, officeId, debitAccountId, creditAccountId, name, description, startDate, endDate, status,
|
return new TellerData().setId(id).setOfficeId(officeId).setDebitAccountId(debitAccountId).setCreditAccountId(creditAccountId)
|
||||||
hasTransactions, hasMappedCashiers);
|
.setName(name).setDescription(description).setStartDate(startDate).setEndDate(endDate).setStatus(status)
|
||||||
tellerData.officeName = officeName;
|
.setOfficeName(officeName).setHasTransactions(hasTransactions).setHasMappedCashiers(hasMappedCashiers);
|
||||||
return tellerData;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TellerData lookup(final Long id, final String name) {
|
public static TellerData lookup(final Long id, final String name) {
|
||||||
return new TellerData(id, null, null, null, name, null, null, null, null, null, null);
|
return new TellerData().setId(id).setName(name);
|
||||||
}
|
|
||||||
|
|
||||||
public Long getId() {
|
|
||||||
return this.id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getOfficeId() {
|
|
||||||
return this.officeId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getDebitAccountId() {
|
|
||||||
return this.debitAccountId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getCreditAccountId() {
|
|
||||||
return this.creditAccountId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return this.name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getOfficeName() {
|
|
||||||
return this.officeName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDescription() {
|
|
||||||
return this.description;
|
|
||||||
}
|
|
||||||
|
|
||||||
public LocalDate getStartDate() {
|
|
||||||
return this.startDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public LocalDate getEndDate() {
|
|
||||||
return this.endDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public TellerStatus getStatus() {
|
|
||||||
return this.status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean hasTransactions() {
|
|
||||||
return this.hasTransactions;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean hasMappedCashiers() {
|
|
||||||
return this.hasMappedCashiers;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+19
-56
@@ -20,6 +20,10 @@ package org.apache.fineract.organisation.teller.data;
|
|||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@code TellerJournalData} represents an immutable journal data object.
|
* {@code TellerJournalData} represents an immutable journal data object.
|
||||||
@@ -30,31 +34,20 @@ import java.time.LocalDate;
|
|||||||
* @see java.io.Serializable
|
* @see java.io.Serializable
|
||||||
* @since 2.0.0
|
* @since 2.0.0
|
||||||
*/
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Accessors(chain = true)
|
||||||
public final class TellerJournalData implements Serializable {
|
public final class TellerJournalData implements Serializable {
|
||||||
|
|
||||||
private final Long officeId;
|
private Long officeId;
|
||||||
private final Long tellerId;
|
private Long tellerId;
|
||||||
private final LocalDate day;
|
private LocalDate day;
|
||||||
private final Double openingBalance;
|
private Double openingBalance;
|
||||||
private final Double settledBalance;
|
private Double settledBalance;
|
||||||
private final Double closingBalance;
|
private Double closingBalance;
|
||||||
private final Double sumReceipts;
|
private Double sumReceipts;
|
||||||
private final Double sumPayments;
|
private Double sumPayments;
|
||||||
|
|
||||||
/*
|
|
||||||
* Sole private CTOR to create a new instance.
|
|
||||||
*/
|
|
||||||
private TellerJournalData(final Long officeId, final Long tellerId, final LocalDate day, final Double openingBalance,
|
|
||||||
final Double settledBalance, final Double closingBalance, final Double sumReceipts, final Double sumPayments) {
|
|
||||||
this.officeId = officeId;
|
|
||||||
this.tellerId = tellerId;
|
|
||||||
this.day = day;
|
|
||||||
this.openingBalance = openingBalance;
|
|
||||||
this.settledBalance = settledBalance;
|
|
||||||
this.closingBalance = closingBalance;
|
|
||||||
this.sumReceipts = sumReceipts;
|
|
||||||
this.sumPayments = sumPayments;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new teller journal data object.
|
* Create a new teller journal data object.
|
||||||
@@ -79,38 +72,8 @@ public final class TellerJournalData implements Serializable {
|
|||||||
*/
|
*/
|
||||||
public static TellerJournalData instance(final Long officeId, final Long tellerId, final LocalDate day, final Double openingBalance,
|
public static TellerJournalData instance(final Long officeId, final Long tellerId, final LocalDate day, final Double openingBalance,
|
||||||
final Double settledBalance, final Double closingBalance, final Double sumReceipts, final Double sumPayments) {
|
final Double settledBalance, final Double closingBalance, final Double sumReceipts, final Double sumPayments) {
|
||||||
return new TellerJournalData(officeId, tellerId, day, openingBalance, settledBalance, closingBalance, sumReceipts, sumPayments);
|
return new TellerJournalData().setOfficeId(officeId).setTellerId(tellerId).setDay(day).setOpeningBalance(openingBalance)
|
||||||
}
|
.setSettledBalance(settledBalance).setClosingBalance(closingBalance).setSumReceipts(sumReceipts)
|
||||||
|
.setSumPayments(sumPayments);
|
||||||
public Long getOfficeId() {
|
|
||||||
return officeId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getTellerId() {
|
|
||||||
return tellerId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public LocalDate getDay() {
|
|
||||||
return day;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Double getOpeningBalance() {
|
|
||||||
return openingBalance;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Double getSettledBalance() {
|
|
||||||
return settledBalance;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Double getClosingBalance() {
|
|
||||||
return closingBalance;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Double getSumReceipts() {
|
|
||||||
return sumReceipts;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Double getSumPayments() {
|
|
||||||
return sumPayments;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+18
-56
@@ -20,6 +20,10 @@ package org.apache.fineract.organisation.teller.data;
|
|||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
|
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -31,31 +35,20 @@ import org.apache.fineract.infrastructure.core.data.EnumOptionData;
|
|||||||
* @see java.io.Serializable
|
* @see java.io.Serializable
|
||||||
* @since 2.0.0
|
* @since 2.0.0
|
||||||
*/
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Accessors(chain = true)
|
||||||
public final class TellerTransactionData implements Serializable {
|
public final class TellerTransactionData implements Serializable {
|
||||||
|
|
||||||
private final Long id;
|
private Long id;
|
||||||
private final Long officeId;
|
private Long officeId;
|
||||||
private final Long tellerId;
|
private Long tellerId;
|
||||||
private final Long cashierId;
|
private Long cashierId;
|
||||||
private final Long clientId;
|
private Long clientId;
|
||||||
private final EnumOptionData type;
|
private EnumOptionData type;
|
||||||
private final Double amount;
|
private Double amount;
|
||||||
private final LocalDate postingDate;
|
private LocalDate postingDate;
|
||||||
|
|
||||||
/*
|
|
||||||
* Sole private CTOR to create a new instance
|
|
||||||
*/
|
|
||||||
private TellerTransactionData(final Long id, final Long officeId, final Long tellerId, final Long cashierId, final Long clientId,
|
|
||||||
final EnumOptionData type, final Double amount, final LocalDate postingDate) {
|
|
||||||
this.id = id;
|
|
||||||
this.officeId = officeId;
|
|
||||||
this.tellerId = tellerId;
|
|
||||||
this.cashierId = cashierId;
|
|
||||||
this.clientId = clientId;
|
|
||||||
this.type = type;
|
|
||||||
this.amount = amount;
|
|
||||||
this.postingDate = postingDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new teller transaction data object.
|
* Creates a new teller transaction data object.
|
||||||
@@ -80,38 +73,7 @@ public final class TellerTransactionData implements Serializable {
|
|||||||
*/
|
*/
|
||||||
public static TellerTransactionData instance(final Long id, final Long officeId, final Long tellerId, final Long cashierId,
|
public static TellerTransactionData instance(final Long id, final Long officeId, final Long tellerId, final Long cashierId,
|
||||||
final Long clientId, final EnumOptionData type, final Double amount, final LocalDate postingDate) {
|
final Long clientId, final EnumOptionData type, final Double amount, final LocalDate postingDate) {
|
||||||
return new TellerTransactionData(id, officeId, tellerId, cashierId, clientId, type, amount, postingDate);
|
return new TellerTransactionData().setId(id).setOfficeId(officeId).setTellerId(tellerId).setCashierId(cashierId)
|
||||||
}
|
.setClientId(clientId).setType(type).setAmount(amount).setPostingDate(postingDate);
|
||||||
|
|
||||||
public Long getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getOfficeId() {
|
|
||||||
return officeId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getTellerId() {
|
|
||||||
return tellerId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getCashierId() {
|
|
||||||
return cashierId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getClientId() {
|
|
||||||
return clientId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public EnumOptionData getType() {
|
|
||||||
return type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Double getAmount() {
|
|
||||||
return amount;
|
|
||||||
}
|
|
||||||
|
|
||||||
public LocalDate getPostingDate() {
|
|
||||||
return postingDate;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+12
-230
@@ -31,6 +31,11 @@ import javax.persistence.ManyToOne;
|
|||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
import javax.persistence.Transient;
|
import javax.persistence.Transient;
|
||||||
import javax.persistence.UniqueConstraint;
|
import javax.persistence.UniqueConstraint;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
import org.apache.fineract.infrastructure.core.api.JsonCommand;
|
import org.apache.fineract.infrastructure.core.api.JsonCommand;
|
||||||
import org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom;
|
import org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom;
|
||||||
import org.apache.fineract.organisation.office.domain.Office;
|
import org.apache.fineract.organisation.office.domain.Office;
|
||||||
@@ -46,6 +51,11 @@ import org.apache.fineract.organisation.staff.domain.Staff;
|
|||||||
@Entity
|
@Entity
|
||||||
@Table(name = "m_cashiers", uniqueConstraints = {
|
@Table(name = "m_cashiers", uniqueConstraints = {
|
||||||
@UniqueConstraint(name = "ux_cashiers_staff_teller", columnNames = { "staff_id", "teller_id" }) })
|
@UniqueConstraint(name = "ux_cashiers_staff_teller", columnNames = { "staff_id", "teller_id" }) })
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Accessors(chain = true)
|
||||||
public class Cashier extends AbstractPersistableCustom {
|
public class Cashier extends AbstractPersistableCustom {
|
||||||
|
|
||||||
// ManyToOne(fetch = FetchType.LAZY)
|
// ManyToOne(fetch = FetchType.LAZY)
|
||||||
@@ -79,13 +89,6 @@ public class Cashier extends AbstractPersistableCustom {
|
|||||||
@Column(name = "end_time", nullable = true, length = 10)
|
@Column(name = "end_time", nullable = true, length = 10)
|
||||||
private String endTime;
|
private String endTime;
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a new cashier.
|
|
||||||
*/
|
|
||||||
public Cashier() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Cashier fromJson(final Office cashierOffice, final Teller teller, final Staff staff, final String startTime,
|
public static Cashier fromJson(final Office cashierOffice, final Teller teller, final Staff staff, final String startTime,
|
||||||
final String endTime, final JsonCommand command) {
|
final String endTime, final JsonCommand command) {
|
||||||
// final Long tellerId = teller.getId();
|
// final Long tellerId = teller.getId();
|
||||||
@@ -99,20 +102,8 @@ public class Cashier extends AbstractPersistableCustom {
|
|||||||
* command.stringValueOfParameterNamed("endTime");
|
* command.stringValueOfParameterNamed("endTime");
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return new Cashier(cashierOffice, teller, staff, description, startDate, endDate, isFullDay, startTime, endTime);
|
return new Cashier().setOffice(cashierOffice).setTeller(teller).setStaff(staff).setDescription(description).setStartDate(startDate)
|
||||||
}
|
.setEndDate(endDate).setIsFullDay(isFullDay).setStartTime(startTime).setEndTime(endTime);
|
||||||
|
|
||||||
public Cashier(Office office, Teller teller, Staff staff, String description, LocalDate startDate, LocalDate endDate, Boolean isFullDay,
|
|
||||||
String startTime, String endTime) {
|
|
||||||
this.office = office;
|
|
||||||
this.teller = teller;
|
|
||||||
this.staff = staff;
|
|
||||||
this.description = description;
|
|
||||||
this.startDate = startDate;
|
|
||||||
this.endDate = endDate;
|
|
||||||
this.isFullDay = isFullDay;
|
|
||||||
this.startTime = startTime;
|
|
||||||
this.endTime = endTime;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> update(final JsonCommand command) {
|
public Map<String, Object> update(final JsonCommand command) {
|
||||||
@@ -205,16 +196,6 @@ public class Cashier extends AbstractPersistableCustom {
|
|||||||
return actualChanges;
|
return actualChanges;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the office of this cashier.
|
|
||||||
*
|
|
||||||
* @return the office of this cashier
|
|
||||||
* @see org.apache.fineract.organisation.office.domain.Office
|
|
||||||
*/
|
|
||||||
public Office getOffice() {
|
|
||||||
return office;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getHourFromStartTime() {
|
public Long getHourFromStartTime() {
|
||||||
if (this.startTime != null && !this.startTime.equalsIgnoreCase("")) {
|
if (this.startTime != null && !this.startTime.equalsIgnoreCase("")) {
|
||||||
List<String> extractHourFromStartTime = Splitter.on(':').splitToList(this.startTime);
|
List<String> extractHourFromStartTime = Splitter.on(':').splitToList(this.startTime);
|
||||||
@@ -250,203 +231,4 @@ public class Cashier extends AbstractPersistableCustom {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the office of this cashier.
|
|
||||||
*
|
|
||||||
* @param office
|
|
||||||
* the office of this cashier
|
|
||||||
* @see org.apache.fineract.organisation.office.domain.Office
|
|
||||||
*/
|
|
||||||
public void setOffice(Office office) {
|
|
||||||
this.office = office;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the staff of this cashier.
|
|
||||||
*
|
|
||||||
* @return the staff of this cashier
|
|
||||||
* @see org.apache.fineract.organisation.staff.domain.Staff
|
|
||||||
*/
|
|
||||||
public Staff getStaff() {
|
|
||||||
return staff;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the staff of this cashier.
|
|
||||||
*
|
|
||||||
* @param staff
|
|
||||||
* the staff of this cashier
|
|
||||||
* @see org.apache.fineract.organisation.staff.domain.Staff
|
|
||||||
*/
|
|
||||||
public void setStaff(Staff staff) {
|
|
||||||
this.staff = staff;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the teller of this cashier.
|
|
||||||
*
|
|
||||||
* @return the teller of this cashier
|
|
||||||
* @see org.apache.fineract.organisation.teller.domain.Teller
|
|
||||||
*/
|
|
||||||
public Teller getTeller() {
|
|
||||||
return teller;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the teller of this cashier.
|
|
||||||
*
|
|
||||||
* @param teller
|
|
||||||
* the teller of this cashier
|
|
||||||
* @see org.apache.fineract.organisation.teller.domain.Teller
|
|
||||||
*/
|
|
||||||
public void setTeller(Teller teller) {
|
|
||||||
this.teller = teller;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the description of this cashier. .
|
|
||||||
*
|
|
||||||
* @return the description of this cashier or {@code null} if not present.
|
|
||||||
*/
|
|
||||||
public String getDescription() {
|
|
||||||
return description;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the description of this cashier.
|
|
||||||
*
|
|
||||||
* @param description
|
|
||||||
* the description of this cashier
|
|
||||||
*/
|
|
||||||
public void setDescription(String description) {
|
|
||||||
this.description = description;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the valid from date of this cashier.
|
|
||||||
*
|
|
||||||
* <p>
|
|
||||||
* The valid from/to dates may be used to define a time period in which the cashier is assignable to a teller.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @return the valid from date of this cashier
|
|
||||||
*/
|
|
||||||
public LocalDate getStartDate() {
|
|
||||||
return startDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the valid from date of this cashier.
|
|
||||||
*
|
|
||||||
* <p>
|
|
||||||
* The valid from/to dates may be used to define a time period in which the cashier is assignable to a teller.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @param startDate
|
|
||||||
* validFrom the valid from date of this cashier
|
|
||||||
*/
|
|
||||||
public void setStartDate(LocalDate startDate) {
|
|
||||||
this.startDate = startDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the valid to date of this cashier.
|
|
||||||
*
|
|
||||||
* <p>
|
|
||||||
* The valid from/to dates may be used to define a time period in which the cashier is assignable to a teller.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @return the valid to date of this cashier
|
|
||||||
*/
|
|
||||||
public LocalDate getEndDate() {
|
|
||||||
return endDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the valid to date of this cashier.
|
|
||||||
*
|
|
||||||
* <p>
|
|
||||||
* The valid from/to dates may be used to define a time period in which the cashier is assignable to a teller.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @param endDate
|
|
||||||
* validTo the valid to date of this cashier
|
|
||||||
*/
|
|
||||||
public void setEndDate(LocalDate endDate) {
|
|
||||||
this.endDate = endDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns whether this cashier works part time or not.
|
|
||||||
*
|
|
||||||
* @return {@code true} if this cashier works part time; {@code false} otherwise
|
|
||||||
*/
|
|
||||||
public Boolean isFullDay() {
|
|
||||||
return isFullDay;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the part time flag of this cashier.
|
|
||||||
*
|
|
||||||
* @param isFullDay
|
|
||||||
* partTime the part time flag of this cashier
|
|
||||||
*/
|
|
||||||
public void setFullDay(Boolean isFullDay) {
|
|
||||||
this.isFullDay = isFullDay;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the start time of this cashier.
|
|
||||||
*
|
|
||||||
* <p>
|
|
||||||
* The start/end times may be used to define a time period in which the cashier works part time.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @return the start time of this cashier
|
|
||||||
*/
|
|
||||||
public String getStartTime() {
|
|
||||||
return startTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the start time of this cashier.
|
|
||||||
*
|
|
||||||
* <p>
|
|
||||||
* The start/end times may be used to define a time period in which the cashier works part time.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @param startTime
|
|
||||||
* the start time of this cashier
|
|
||||||
*/
|
|
||||||
public void setStartTime(String startTime) {
|
|
||||||
this.startTime = startTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the end time of this cashier.
|
|
||||||
*
|
|
||||||
* <p>
|
|
||||||
* The start/end times may be used to define a time period in which the cashier works part time.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @return the end time of this cashier
|
|
||||||
*/
|
|
||||||
public String getEndTime() {
|
|
||||||
return endTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the end time of this cashier.
|
|
||||||
*
|
|
||||||
* <p>
|
|
||||||
* The start/end times may be used to define a time period in which the cashier works part time.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @param endTime
|
|
||||||
* the end time of this cashier
|
|
||||||
*/
|
|
||||||
public void setEndTime(String endTime) {
|
|
||||||
this.endTime = endTime;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
+15
-147
@@ -30,6 +30,11 @@ import javax.persistence.JoinColumn;
|
|||||||
import javax.persistence.ManyToOne;
|
import javax.persistence.ManyToOne;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
import javax.persistence.Transient;
|
import javax.persistence.Transient;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
import org.apache.fineract.infrastructure.core.api.JsonCommand;
|
import org.apache.fineract.infrastructure.core.api.JsonCommand;
|
||||||
import org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom;
|
import org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom;
|
||||||
import org.apache.fineract.infrastructure.core.service.DateUtils;
|
import org.apache.fineract.infrastructure.core.service.DateUtils;
|
||||||
@@ -37,6 +42,11 @@ import org.apache.fineract.organisation.office.domain.Office;
|
|||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "m_cashier_transactions")
|
@Table(name = "m_cashier_transactions")
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Accessors(chain = true)
|
||||||
public class CashierTransaction extends AbstractPersistableCustom {
|
public class CashierTransaction extends AbstractPersistableCustom {
|
||||||
|
|
||||||
@Transient
|
@Transient
|
||||||
@@ -68,18 +78,11 @@ public class CashierTransaction extends AbstractPersistableCustom {
|
|||||||
private Long entityId;
|
private Long entityId;
|
||||||
|
|
||||||
@Column(name = "created_date", nullable = false)
|
@Column(name = "created_date", nullable = false)
|
||||||
private LocalDateTime createdDate;
|
private LocalDateTime createdDate = DateUtils.getLocalDateTimeOfSystem();
|
||||||
|
|
||||||
@Column(name = "currency_code", nullable = true)
|
@Column(name = "currency_code", nullable = true)
|
||||||
private String currencyCode;
|
private String currencyCode;
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a new cashier.
|
|
||||||
*/
|
|
||||||
public CashierTransaction() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static CashierTransaction fromJson(final Cashier cashier, final JsonCommand command) {
|
public static CashierTransaction fromJson(final Cashier cashier, final JsonCommand command) {
|
||||||
final Integer txnType = command.integerValueOfParameterNamed("txnType");
|
final Integer txnType = command.integerValueOfParameterNamed("txnType");
|
||||||
final BigDecimal txnAmount = command.bigDecimalValueOfParameterNamed("txnAmount");
|
final BigDecimal txnAmount = command.bigDecimalValueOfParameterNamed("txnAmount");
|
||||||
@@ -90,23 +93,9 @@ public class CashierTransaction extends AbstractPersistableCustom {
|
|||||||
final String currencyCode = command.stringValueOfParameterNamed("currencyCode");
|
final String currencyCode = command.stringValueOfParameterNamed("currencyCode");
|
||||||
|
|
||||||
// TODO: get client/loan/savings details
|
// TODO: get client/loan/savings details
|
||||||
return new CashierTransaction(cashier, txnType, txnAmount, txnDate, entityType, entityId, txnNote, currencyCode);
|
return new CashierTransaction().setCashier(cashier).setTxnType(txnType).setTxnAmount(txnAmount)
|
||||||
|
.setTxnDate(txnDate != null ? txnDate : null).setEntityType(entityType).setEntityId(entityId).setTxnNote(txnNote)
|
||||||
}
|
.setCurrencyCode(currencyCode);
|
||||||
|
|
||||||
public CashierTransaction(Cashier cashier, Integer txnType, BigDecimal txnAmount, LocalDate txnDate, String entityType, Long entityId,
|
|
||||||
String txnNote, String currencyCode) {
|
|
||||||
this.cashier = cashier;
|
|
||||||
this.txnType = txnType;
|
|
||||||
if (txnDate != null) {
|
|
||||||
this.txnDate = txnDate;
|
|
||||||
}
|
|
||||||
this.txnAmount = txnAmount;
|
|
||||||
this.entityType = entityType;
|
|
||||||
this.entityId = entityId;
|
|
||||||
this.txnNote = txnNote;
|
|
||||||
this.createdDate = DateUtils.getLocalDateTimeOfSystem();
|
|
||||||
this.currencyCode = currencyCode;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> update(final JsonCommand command) {
|
public Map<String, Object> update(final JsonCommand command) {
|
||||||
@@ -124,7 +113,7 @@ public class CashierTransaction extends AbstractPersistableCustom {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final String txnDateParamName = "txnDate";
|
final String txnDateParamName = "txnDate";
|
||||||
if (command.isChangeInLocalDateParameterNamed(txnDateParamName, getTxnLocalDate())) {
|
if (command.isChangeInLocalDateParameterNamed(txnDateParamName, this.txnDate)) {
|
||||||
final String valueAsInput = command.stringValueOfParameterNamed(txnDateParamName);
|
final String valueAsInput = command.stringValueOfParameterNamed(txnDateParamName);
|
||||||
actualChanges.put(txnDateParamName, valueAsInput);
|
actualChanges.put(txnDateParamName, valueAsInput);
|
||||||
actualChanges.put("dateFormat", dateFormatAsInput);
|
actualChanges.put("dateFormat", dateFormatAsInput);
|
||||||
@@ -156,125 +145,4 @@ public class CashierTransaction extends AbstractPersistableCustom {
|
|||||||
|
|
||||||
return actualChanges;
|
return actualChanges;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the office of this cashier transaction.
|
|
||||||
*
|
|
||||||
* @return the office of this cashier transaction
|
|
||||||
* @see org.apache.fineract.organisation.office.domain.Office
|
|
||||||
*/
|
|
||||||
public Office getOffice() {
|
|
||||||
return office;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the office of this cashier transaction.
|
|
||||||
*
|
|
||||||
* @param office
|
|
||||||
* the office of this cashier transaction
|
|
||||||
* @see org.apache.fineract.organisation.office.domain.Office
|
|
||||||
*/
|
|
||||||
public void setOffice(Office office) {
|
|
||||||
this.office = office;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the teller of this cashier transaction.
|
|
||||||
*
|
|
||||||
* @return the teller of this cashier transaction
|
|
||||||
* @see org.apache.fineract.organisation.teller.domain.Teller
|
|
||||||
*/
|
|
||||||
public Teller getTeller() {
|
|
||||||
return teller;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the teller of this cashier transaction.
|
|
||||||
*
|
|
||||||
* @param teller
|
|
||||||
* the teller of this cashier transaction
|
|
||||||
* @see org.apache.fineract.organisation.teller.domain.Teller
|
|
||||||
*/
|
|
||||||
public void setTeller(Teller teller) {
|
|
||||||
this.teller = teller;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the transaction type of this cashier transaction. .
|
|
||||||
*
|
|
||||||
* @return the transaction type of this cashier transaction or {@code null} if not present.
|
|
||||||
*/
|
|
||||||
public Integer getTxnType() {
|
|
||||||
return txnType;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the transaction type of this cashier transaction.
|
|
||||||
*
|
|
||||||
* @param txnType
|
|
||||||
* description the transaction type of this cashier transaction
|
|
||||||
*/
|
|
||||||
public void setTxnType(Integer txnType) {
|
|
||||||
this.txnType = txnType;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the transaction date of this cashier transaction.
|
|
||||||
*
|
|
||||||
* @return the transaction date of this cashier transaction
|
|
||||||
*/
|
|
||||||
public LocalDate getTxnDate() {
|
|
||||||
return txnDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public LocalDate getTxnLocalDate() {
|
|
||||||
return this.txnDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the transaction date of this cashier transaction.
|
|
||||||
*
|
|
||||||
* @param txnDate
|
|
||||||
* transaction date of this cashier transaction
|
|
||||||
*/
|
|
||||||
public void setTxnDate(LocalDate txnDate) {
|
|
||||||
this.txnDate = txnDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getEntityType() {
|
|
||||||
return entityType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEntityType(String entityType) {
|
|
||||||
this.entityType = entityType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getEntityId() {
|
|
||||||
return entityId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEntityId(Long entityId) {
|
|
||||||
this.entityId = entityId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTxnNote() {
|
|
||||||
return txnNote;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BigDecimal getTxnAmount() {
|
|
||||||
return txnAmount;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTxnNote(String txnNote) {
|
|
||||||
this.txnNote = txnNote;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCurrencyCode() {
|
|
||||||
return this.currencyCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCurrencyCode(String currencyCode) {
|
|
||||||
this.currencyCode = currencyCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-12
@@ -19,7 +19,13 @@
|
|||||||
package org.apache.fineract.organisation.teller.domain;
|
package org.apache.fineract.organisation.teller.domain;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
public final class CashierTxnType implements Serializable {
|
public final class CashierTxnType implements Serializable {
|
||||||
|
|
||||||
private Integer id;
|
private Integer id;
|
||||||
@@ -30,18 +36,8 @@ public final class CashierTxnType implements Serializable {
|
|||||||
public static final CashierTxnType INWARD_CASH_TXN = new CashierTxnType(103, "Cash In");
|
public static final CashierTxnType INWARD_CASH_TXN = new CashierTxnType(103, "Cash In");
|
||||||
public static final CashierTxnType OUTWARD_CASH_TXN = new CashierTxnType(104, "Cash Out");
|
public static final CashierTxnType OUTWARD_CASH_TXN = new CashierTxnType(104, "Cash Out");
|
||||||
|
|
||||||
private CashierTxnType() {}
|
@Override
|
||||||
|
public String toString() {
|
||||||
private CashierTxnType(Integer id, String value) {
|
|
||||||
this.id = id;
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getValue() {
|
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+14
-109
@@ -30,6 +30,11 @@ import javax.persistence.ManyToOne;
|
|||||||
import javax.persistence.OneToMany;
|
import javax.persistence.OneToMany;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
import javax.persistence.UniqueConstraint;
|
import javax.persistence.UniqueConstraint;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
import org.apache.fineract.accounting.glaccount.domain.GLAccount;
|
import org.apache.fineract.accounting.glaccount.domain.GLAccount;
|
||||||
import org.apache.fineract.infrastructure.core.api.JsonCommand;
|
import org.apache.fineract.infrastructure.core.api.JsonCommand;
|
||||||
import org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom;
|
import org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom;
|
||||||
@@ -37,6 +42,11 @@ import org.apache.fineract.organisation.office.domain.Office;
|
|||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "m_tellers", uniqueConstraints = { @UniqueConstraint(name = "ux_tellers_name", columnNames = { "name" }) })
|
@Table(name = "m_tellers", uniqueConstraints = { @UniqueConstraint(name = "ux_tellers_name", columnNames = { "name" }) })
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Accessors(chain = true)
|
||||||
public class Teller extends AbstractPersistableCustom {
|
public class Teller extends AbstractPersistableCustom {
|
||||||
|
|
||||||
@ManyToOne(fetch = FetchType.LAZY)
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
@@ -69,32 +79,6 @@ public class Teller extends AbstractPersistableCustom {
|
|||||||
@OneToMany(mappedBy = "teller", fetch = FetchType.LAZY)
|
@OneToMany(mappedBy = "teller", fetch = FetchType.LAZY)
|
||||||
private Set<Cashier> cashiers;
|
private Set<Cashier> cashiers;
|
||||||
|
|
||||||
public Teller() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private Teller(final Office staffOffice, final String name, final String description, final LocalDate startDate,
|
|
||||||
final LocalDate endDate, final TellerStatus status) {
|
|
||||||
|
|
||||||
this.name = name;
|
|
||||||
this.description = description;
|
|
||||||
this.startDate = startDate;
|
|
||||||
this.endDate = endDate;
|
|
||||||
|
|
||||||
if (status != null) {
|
|
||||||
this.status = status.getValue();
|
|
||||||
}
|
|
||||||
this.office = staffOffice;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* if (StringUtils.isNotBlank(name)) { this.name = name.trim(); } else { this.name = null; }
|
|
||||||
*
|
|
||||||
* if (StringUtils.isNotBlank(description)) { this.description = description.trim(); } else { this.description =
|
|
||||||
* null; }
|
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Teller fromJson(final Office tellerOffice, final JsonCommand command) {
|
public static Teller fromJson(final Office tellerOffice, final JsonCommand command) {
|
||||||
final String name = command.stringValueOfParameterNamed("name");
|
final String name = command.stringValueOfParameterNamed("name");
|
||||||
final String description = command.stringValueOfParameterNamed("description");
|
final String description = command.stringValueOfParameterNamed("description");
|
||||||
@@ -103,7 +87,8 @@ public class Teller extends AbstractPersistableCustom {
|
|||||||
final Integer tellerStatusInt = command.integerValueOfParameterNamed("status");
|
final Integer tellerStatusInt = command.integerValueOfParameterNamed("status");
|
||||||
final TellerStatus status = TellerStatus.fromInt(tellerStatusInt);
|
final TellerStatus status = TellerStatus.fromInt(tellerStatusInt);
|
||||||
|
|
||||||
return new Teller(tellerOffice, name, description, startDate, endDate, status);
|
return new Teller().setOffice(tellerOffice).setName(name).setDescription(description).setStartDate(startDate).setEndDate(endDate)
|
||||||
|
.setStatus(status.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> update(Office tellerOffice, final JsonCommand command) {
|
public Map<String, Object> update(Office tellerOffice, final JsonCommand command) {
|
||||||
@@ -135,7 +120,7 @@ public class Teller extends AbstractPersistableCustom {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final String startDateParamName = "startDate";
|
final String startDateParamName = "startDate";
|
||||||
if (command.isChangeInLocalDateParameterNamed(startDateParamName, getStartLocalDate())) {
|
if (command.isChangeInLocalDateParameterNamed(startDateParamName, this.startDate)) {
|
||||||
final String valueAsInput = command.stringValueOfParameterNamed(startDateParamName);
|
final String valueAsInput = command.stringValueOfParameterNamed(startDateParamName);
|
||||||
actualChanges.put(startDateParamName, valueAsInput);
|
actualChanges.put(startDateParamName, valueAsInput);
|
||||||
actualChanges.put("dateFormat", dateFormatAsInput);
|
actualChanges.put("dateFormat", dateFormatAsInput);
|
||||||
@@ -145,7 +130,7 @@ public class Teller extends AbstractPersistableCustom {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final String endDateParamName = "endDate";
|
final String endDateParamName = "endDate";
|
||||||
if (command.isChangeInLocalDateParameterNamed(endDateParamName, getEndLocalDate())) {
|
if (command.isChangeInLocalDateParameterNamed(endDateParamName, this.endDate)) {
|
||||||
final String valueAsInput = command.stringValueOfParameterNamed(endDateParamName);
|
final String valueAsInput = command.stringValueOfParameterNamed(endDateParamName);
|
||||||
actualChanges.put(endDateParamName, valueAsInput);
|
actualChanges.put(endDateParamName, valueAsInput);
|
||||||
actualChanges.put("dateFormat", dateFormatAsInput);
|
actualChanges.put("dateFormat", dateFormatAsInput);
|
||||||
@@ -168,90 +153,10 @@ public class Teller extends AbstractPersistableCustom {
|
|||||||
return actualChanges;
|
return actualChanges;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Office getOffice() {
|
|
||||||
return office;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOffice(Office office) {
|
|
||||||
this.office = office;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GLAccount getDebitAccount() {
|
|
||||||
return debitAccount;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDebitAccount(GLAccount debitAccount) {
|
|
||||||
this.debitAccount = debitAccount;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GLAccount getCreditAccount() {
|
|
||||||
return creditAccount;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCreditAccount(GLAccount creditAccount) {
|
|
||||||
this.creditAccount = creditAccount;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDescription() {
|
|
||||||
return description;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDescription(String description) {
|
|
||||||
this.description = description;
|
|
||||||
}
|
|
||||||
|
|
||||||
public LocalDate getStartDate() {
|
|
||||||
return startDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public LocalDate getStartLocalDate() {
|
|
||||||
return this.startDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStartDate(LocalDate startDate) {
|
|
||||||
this.startDate = startDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public LocalDate getEndDate() {
|
|
||||||
return endDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public LocalDate getEndLocalDate() {
|
|
||||||
return this.endDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEndDate(LocalDate endDate) {
|
|
||||||
this.endDate = endDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getStatus() {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStatus(Integer status) {
|
|
||||||
this.status = status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long officeId() {
|
public Long officeId() {
|
||||||
return this.office.getId();
|
return this.office.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set<Cashier> getCashiers() {
|
|
||||||
return cashiers;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCashiers(Set<Cashier> cashiers) {
|
|
||||||
this.cashiers = cashiers;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void initializeLazyCollections() {
|
public void initializeLazyCollections() {
|
||||||
this.office.getId();
|
this.office.getId();
|
||||||
this.cashiers.size();
|
this.cashiers.size();
|
||||||
|
|||||||
+5
-14
@@ -18,10 +18,14 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.organisation.teller.domain;
|
package org.apache.fineract.organisation.teller.domain;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enum representation of teller status states.
|
* Enum representation of teller status states.
|
||||||
*/
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
public enum TellerStatus {
|
public enum TellerStatus {
|
||||||
|
|
||||||
INVALID(0, "tellerStatusType.invalid"), PENDING(100, "tellerStatusType.pending"), ACTIVE(300, "tellerStatusType.active"), INACTIVE(400,
|
INVALID(0, "tellerStatusType.invalid"), PENDING(100, "tellerStatusType.pending"), ACTIVE(300, "tellerStatusType.active"), INACTIVE(400,
|
||||||
@@ -50,23 +54,10 @@ public enum TellerStatus {
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
TellerStatus(final Integer value, final String code) {
|
|
||||||
this.value = value;
|
|
||||||
this.code = code;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean hasStateOf(final TellerStatus state) {
|
public boolean hasStateOf(final TellerStatus state) {
|
||||||
return this.value.equals(state.getValue());
|
return this.value.equals(state.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getValue() {
|
|
||||||
return this.value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCode() {
|
|
||||||
return this.code;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isPending() {
|
public boolean isPending() {
|
||||||
return this.value.equals(TellerStatus.PENDING.getValue());
|
return this.value.equals(TellerStatus.PENDING.getValue());
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-59
@@ -25,12 +25,22 @@ import javax.persistence.FetchType;
|
|||||||
import javax.persistence.JoinColumn;
|
import javax.persistence.JoinColumn;
|
||||||
import javax.persistence.ManyToOne;
|
import javax.persistence.ManyToOne;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
import org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom;
|
import org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom;
|
||||||
import org.apache.fineract.organisation.office.domain.Office;
|
import org.apache.fineract.organisation.office.domain.Office;
|
||||||
import org.apache.fineract.portfolio.client.domain.Client;
|
import org.apache.fineract.portfolio.client.domain.Client;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "m_teller_transactions")
|
@Table(name = "m_teller_transactions")
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Accessors(chain = true)
|
||||||
public class TellerTransaction extends AbstractPersistableCustom {
|
public class TellerTransaction extends AbstractPersistableCustom {
|
||||||
|
|
||||||
@ManyToOne(fetch = FetchType.LAZY)
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
@@ -58,63 +68,4 @@ public class TellerTransaction extends AbstractPersistableCustom {
|
|||||||
@Column(name = "posting_date", nullable = false)
|
@Column(name = "posting_date", nullable = false)
|
||||||
private LocalDate postingDate;
|
private LocalDate postingDate;
|
||||||
|
|
||||||
public TellerTransaction() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public Office getOffice() {
|
|
||||||
return office;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOffice(Office office) {
|
|
||||||
this.office = office;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Teller getTeller() {
|
|
||||||
return teller;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTeller(Teller teller) {
|
|
||||||
this.teller = teller;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Cashier getCashier() {
|
|
||||||
return cashier;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCashier(Cashier cashier) {
|
|
||||||
this.cashier = cashier;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Client getClient() {
|
|
||||||
return client;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setClient(Client client) {
|
|
||||||
this.client = client;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getType() {
|
|
||||||
return type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setType(Integer type) {
|
|
||||||
this.type = type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Double getAmount() {
|
|
||||||
return amount;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAmount(Double amount) {
|
|
||||||
this.amount = amount;
|
|
||||||
}
|
|
||||||
|
|
||||||
public LocalDate getPostingDate() {
|
|
||||||
return postingDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPostingDate(LocalDate postingDate) {
|
|
||||||
this.postingDate = postingDate;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-21
@@ -21,6 +21,7 @@ package org.apache.fineract.organisation.teller.service;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import javax.persistence.PersistenceException;
|
import javax.persistence.PersistenceException;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import org.apache.commons.lang3.exception.ExceptionUtils;
|
import org.apache.commons.lang3.exception.ExceptionUtils;
|
||||||
import org.apache.fineract.accounting.common.AccountingConstants.FinancialActivity;
|
import org.apache.fineract.accounting.common.AccountingConstants.FinancialActivity;
|
||||||
import org.apache.fineract.accounting.financialactivityaccount.domain.FinancialActivityAccount;
|
import org.apache.fineract.accounting.financialactivityaccount.domain.FinancialActivityAccount;
|
||||||
@@ -55,12 +56,12 @@ import org.apache.fineract.portfolio.client.domain.ClientTransaction;
|
|||||||
import org.apache.fineract.useradministration.domain.AppUser;
|
import org.apache.fineract.useradministration.domain.AppUser;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.dao.DataIntegrityViolationException;
|
import org.springframework.dao.DataIntegrityViolationException;
|
||||||
import org.springframework.orm.jpa.JpaSystemException;
|
import org.springframework.orm.jpa.JpaSystemException;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
@AllArgsConstructor
|
||||||
@Service
|
@Service
|
||||||
public class TellerWritePlatformServiceJpaImpl implements TellerWritePlatformService {
|
public class TellerWritePlatformServiceJpaImpl implements TellerWritePlatformService {
|
||||||
|
|
||||||
@@ -77,26 +78,6 @@ public class TellerWritePlatformServiceJpaImpl implements TellerWritePlatformSer
|
|||||||
private final FinancialActivityAccountRepositoryWrapper financialActivityAccountRepositoryWrapper;
|
private final FinancialActivityAccountRepositoryWrapper financialActivityAccountRepositoryWrapper;
|
||||||
private final CashierTransactionDataValidator cashierTransactionDataValidator;
|
private final CashierTransactionDataValidator cashierTransactionDataValidator;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
public TellerWritePlatformServiceJpaImpl(final PlatformSecurityContext context,
|
|
||||||
final TellerCommandFromApiJsonDeserializer fromApiJsonDeserializer, final TellerRepositoryWrapper tellerRepositoryWrapper,
|
|
||||||
final OfficeRepositoryWrapper officeRepositoryWrapper, final StaffRepository staffRepository,
|
|
||||||
CashierRepository cashierRepository, CashierTransactionRepository cashierTxnRepository,
|
|
||||||
JournalEntryRepository glJournalEntryRepository,
|
|
||||||
FinancialActivityAccountRepositoryWrapper financialActivityAccountRepositoryWrapper,
|
|
||||||
final CashierTransactionDataValidator cashierTransactionDataValidator) {
|
|
||||||
this.context = context;
|
|
||||||
this.fromApiJsonDeserializer = fromApiJsonDeserializer;
|
|
||||||
this.tellerRepositoryWrapper = tellerRepositoryWrapper;
|
|
||||||
this.officeRepositoryWrapper = officeRepositoryWrapper;
|
|
||||||
this.staffRepository = staffRepository;
|
|
||||||
this.cashierRepository = cashierRepository;
|
|
||||||
this.cashierTxnRepository = cashierTxnRepository;
|
|
||||||
this.glJournalEntryRepository = glJournalEntryRepository;
|
|
||||||
this.financialActivityAccountRepositoryWrapper = financialActivityAccountRepositoryWrapper;
|
|
||||||
this.cashierTransactionDataValidator = cashierTransactionDataValidator;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public CommandProcessingResult createTeller(JsonCommand command) {
|
public CommandProcessingResult createTeller(JsonCommand command) {
|
||||||
|
|||||||
Reference in New Issue
Block a user