1. Fetch Exchange Rate

2. List of currencies/products
3. List of GL accounts
4. Signup level product specific account opening.
Nabeel-DG-BS
Raja Nabeel 2 years ago
parent d8d084b708
commit 82fdb03b7f

@ -0,0 +1,33 @@
package com.mfsys.uco.controller;
import com.mfsys.uco.UCOURI;
import com.mfsys.uco.model.ChartOfAccount;
import com.mfsys.uco.model.Product;
import com.mfsys.uco.model.TransactionTrail;
import com.mfsys.uco.service.DepositUcoProductsService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequiredArgsConstructor
public class DepositUcoProductController {
private final DepositUcoProductsService depositUcoProductsService;
@GetMapping(UCOURI.FETCH_UCO_DEPOSIT_PRODUCTS)
public List<Product> getUcoDepositProducts(
@RequestParam String porOrgacode) {
return depositUcoProductsService.fetchDepositUcoProducts(porOrgacode);
}
@GetMapping(UCOURI.FETCH_UCO_GLS)
public List<ChartOfAccount> getUcoGls(
@RequestParam String porOrgacode) {
return depositUcoProductsService.fetchUcoGls(porOrgacode);
}
}

@ -0,0 +1,29 @@
package com.mfsys.uco.model;
import com.mfsys.comm.util.FieldNameLength;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.RequiredArgsConstructor;
@Data
@RequiredArgsConstructor
@Entity(name = "PR_GL_CA_ACCOUNT")
@Table(name = "PR_GL_CA_ACCOUNT")
@IdClass(ChartOfAccountId.class)
public class ChartOfAccount {
@Id
@Column(name = "POR_ORGACODE", nullable = false, updatable = false, columnDefinition = FieldNameLength.POR_ORGACODE)
private String porOrgacode;
@Id
@Column(name = "PCA_GLACCODE", nullable = false, updatable = false, columnDefinition = FieldNameLength.PCA_GLACCODE)
private String pcaGlaccode;
@Column(name = "PCA_GLACDESC", nullable = false, columnDefinition = FieldNameLength.PCA_GLACDESC)
private String pcaGlacdesc;
@Column(name = "PCA_GLACSHORT", nullable = false, columnDefinition = FieldNameLength.PCA_GLACDESC)
private String pcaGlacshort;
}

@ -0,0 +1,71 @@
package com.mfsys.uco.model;
import java.io.Serializable;
public class ChartOfAccountId implements Serializable {
private static final long serialVersionUID = 1L;
private String porOrgacode;
private String pcaGlaccode;
public ChartOfAccountId(String porOrgacode, String pcaGlaccode) {
super();
this.porOrgacode = porOrgacode;
this.pcaGlaccode = pcaGlaccode;
}
public ChartOfAccountId() {
super();
}
public String getPorOrgacode() {
return porOrgacode;
}
public void setPorOrgacode(String porOrgacode) {
this.porOrgacode = porOrgacode;
}
public String getPcaGlaccode() {
return pcaGlaccode;
}
public void setPcaGlaccode(String pcaGlaccode) {
this.pcaGlaccode = pcaGlaccode;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((pcaGlaccode == null) ? 0 : pcaGlaccode.hashCode());
result = prime * result + ((porOrgacode == null) ? 0 : porOrgacode.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ChartOfAccountId other = (ChartOfAccountId) obj;
if (pcaGlaccode == null) {
if (other.pcaGlaccode != null)
return false;
} else if (!pcaGlaccode.equals(other.pcaGlaccode))
return false;
if (porOrgacode == null) {
if (other.porOrgacode != null)
return false;
} else if (!porOrgacode.equals(other.porOrgacode))
return false;
return true;
}
}

@ -0,0 +1,32 @@
package com.mfsys.uco.model;
import com.mfsys.comm.util.FieldNameLength;
import jakarta.persistence.*;
import lombok.Data;
@IdClass(ProductId.class)
@Data
@Entity(name ="BN_PD_DP_DEPOSITUCOPRODUCT")
@Table(name ="BN_PD_DP_DEPOSITUCOPRODUCT")
public class Product {
@Id
@Column(name = "POR_ORGACODE", nullable = false, updatable = false, columnDefinition = FieldNameLength.POR_ORGACODE)
private String porOrgacode;
@Id
@Column(name = "DMP_PRODCODE", nullable = false, updatable = false, columnDefinition = FieldNameLength.DMP_PRODCODE)
private String dmpProdcode;
@Column(name = "DMP_PRODDESC", nullable = false, columnDefinition = FieldNameLength.DESCRIPTION_LONG)
private String dmpProddesc;
@Column(name = "DMP_PRODSHORT", nullable = false, columnDefinition = FieldNameLength.DESCRIPTION_SHORT)
private String dmpProdshort;
@Column(name = "PCR_CURRCODE", nullable = false, columnDefinition = FieldNameLength.PCR_CURRCODE)
private String pcrCurrcode;
@Column(name = "DMP_PRODACTIVE", nullable = false, columnDefinition = FieldNameLength.BOOLEAN_BIT)
private boolean dmpProdactive=true;
}

@ -0,0 +1,67 @@
package com.mfsys.uco.model;
import java.io.Serializable;
public class ProductId implements Serializable {
private static final long serialVersionUID = 1L;
private String porOrgacode;
private String dmpProdcode;
public ProductId() {
}
public ProductId(String porOrgacode, String dmpProdcode) {
this.porOrgacode = porOrgacode;
this.dmpProdcode = dmpProdcode;
}
public String getPorOrgacode() {
return porOrgacode;
}
public void setPorOrgacode(String porOrgacode) {
this.porOrgacode = porOrgacode;
}
public String getdmpProdcode() {
return dmpProdcode;
}
public void setdmpProdcode(String dmpProdcode) {
this.dmpProdcode = dmpProdcode;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((dmpProdcode == null) ? 0 : dmpProdcode.hashCode());
result = prime * result + ((porOrgacode == null) ? 0 : porOrgacode.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ProductId other = (ProductId) obj;
if (dmpProdcode == null) {
if (other.dmpProdcode != null)
return false;
} else if (!dmpProdcode.equals(other.dmpProdcode))
return false;
if (porOrgacode == null) {
if (other.porOrgacode != null)
return false;
} else if (!porOrgacode.equals(other.porOrgacode))
return false;
return true;
}
}

@ -0,0 +1,18 @@
package com.mfsys.uco.repository;
import com.mfsys.uco.model.ChartOfAccount;
import com.mfsys.uco.model.ChartOfAccountId;
import com.mfsys.uco.model.Product;
import com.mfsys.uco.model.ProductId;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface ChartOfAccountRepository extends JpaRepository<ChartOfAccount, ChartOfAccountId> {
@Query("SELECT p FROM PR_GL_CA_ACCOUNT p WHERE p.porOrgacode = :porOrgacode")
List<ChartOfAccount> fetchBankGls(String porOrgacode);
}

@ -0,0 +1,18 @@
package com.mfsys.uco.repository;
import com.mfsys.uco.model.Product;
import com.mfsys.uco.model.ProductId;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Optional;
@Repository
public interface DepositUcoProductsRepository extends JpaRepository<Product, ProductId> {
@Query("SELECT p FROM BN_PD_DP_DEPOSITUCOPRODUCT p WHERE p.porOrgacode = :porOrgacode AND p.dmpProdactive = true")
List<Product> fetchAllUcoActiveProducts(String porOrgacode);
}

@ -0,0 +1,29 @@
package com.mfsys.uco.service;
import com.mfsys.uco.model.ChartOfAccount;
import com.mfsys.uco.model.Product;
import com.mfsys.uco.model.TransactionTrail;
import com.mfsys.uco.repository.ChartOfAccountRepository;
import com.mfsys.uco.repository.DepositUcoProductsRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
@RequiredArgsConstructor
public class DepositUcoProductsService {
private final DepositUcoProductsRepository depositUcoProductsRepository;
private final ChartOfAccountRepository chartOfAccountRepository;
public List<Product> fetchDepositUcoProducts(String porOrgacode) {
return depositUcoProductsRepository.fetchAllUcoActiveProducts(porOrgacode);
}
public List<ChartOfAccount> fetchUcoGls(String porOrgacode) {
return chartOfAccountRepository.fetchBankGls(porOrgacode);
}
}
Loading…
Cancel
Save