Skip to content

Commit

Permalink
refactor: add lombok to closure module
Browse files Browse the repository at this point in the history
  • Loading branch information
hmg65 authored and galovics committed Jul 25, 2022
1 parent d6f8ef8 commit da920b1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,15 @@
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Collection;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import lombok.Data;
import org.apache.fineract.organisation.office.data.OfficeData;

/**
* Immutable object representing a General Ledger Account
*
* Note: no getter/setters required as google-gson will produce json from fields of object.
*/
@RequiredArgsConstructor
@Getter
@Data
public class GLClosureData {

private final Long id;
Expand All @@ -48,6 +45,5 @@ public class GLClosureData {
private final String lastUpdatedByUsername;
private final String comments;

@Setter
private Collection<OfficeData> allowedOffices = new ArrayList<>();
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.apache.fineract.accounting.closure.api.GLClosureJsonInputParams;
import org.apache.fineract.infrastructure.core.api.JsonCommand;
Expand All @@ -36,6 +39,8 @@
@Entity
@Table(name = "acc_gl_closure", uniqueConstraints = {
@UniqueConstraint(columnNames = { "office_id", "closing_date" }, name = "office_id_closing_date") })
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Getter
public class GLClosure extends AbstractAuditableCustom {

@ManyToOne
Expand All @@ -51,10 +56,6 @@ public class GLClosure extends AbstractAuditableCustom {
@Column(name = "comments", nullable = true, length = 500)
private String comments;

protected GLClosure() {
//
}

public GLClosure(final Office office, final LocalDate closingDate, final String comments) {
this.office = office;
this.deleted = false;
Expand Down Expand Up @@ -89,12 +90,4 @@ private void handlePropertyUpdate(final JsonCommand command, final Map<String, O
}
}

public LocalDate getClosingDate() {
return this.closingDate;
}

public Office getOffice() {
return this.office;
}

}

0 comments on commit da920b1

Please sign in to comment.