Nabeel-DG-BS
Raja Nabeel 1 year ago
parent 57c4f7152b
commit dd230bffea

@ -34,6 +34,6 @@ public interface UCOURI {
String FETCH_UCO_GLS = "/deposit/fetchUcoGls";
String REVERSE_TRANSACTION = "/reverseTransaction";
String CORE_REVERSE_TRANSACTION = "/deposit/transactions/uco/reverse-transaction";
String ADD_BENEFICIARY = "/addBeneficary";
}

@ -7,6 +7,7 @@ import com.itextpdf.layout.element.Paragraph;
import com.mfsys.uco.UCOURI;
import com.mfsys.uco.dto.*;
import com.mfsys.uco.dto.webclientdto.AccountDetail;
import com.mfsys.uco.model.Beneficiary;
import com.mfsys.uco.model.CustomerAccountActivity;
import com.mfsys.uco.model.CustomerProfile;
import com.mfsys.uco.service.*;
@ -166,4 +167,9 @@ public class UserController {
customerProfileService.updateCustomerProfile(updateProfileRequestPayload);
return ResponseEntity.ok(HttpStatus.OK);
}
@PostMapping(UCOURI.ADD_BENEFICIARY)
public ResponseEntity<HttpStatus> updateCustomerProfile(@RequestBody Beneficiary beneficiary) {
customerProfileService.addBeneficiary(beneficiary);
return ResponseEntity.ok(HttpStatus.OK);
}
}

@ -0,0 +1,46 @@
package com.mfsys.uco.model;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.mfsys.comm.util.FieldNameLength;
import jakarta.persistence.*;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import java.time.LocalDateTime;
@Entity(name = "UCO_CS_OC_UCOBENEFICARY")
@Table(name = "UCO_CS_OC_UCOBENEFICARY")
@Data
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Beneficiary {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "SERIAL", nullable = false, updatable = false, columnDefinition = FieldNameLength.BIGINT)
private Long serial;
@Column(name = "POR_ORGACODE", nullable = false, updatable = false, columnDefinition = FieldNameLength.POR_ORGACODE)
private String porOrgacode;
@Column(name = "email", nullable = false, columnDefinition = FieldNameLength.CODE_50)
private String email;
@Column(name = "PCR_CURRDCODE", nullable = false, updatable = true, columnDefinition = FieldNameLength.DESCRIPTION_SHORT)
private String pcrCurrcode;
@Column(name = "PCR_CURRDESC", nullable = false, updatable = true, columnDefinition = FieldNameLength.DESCRIPTION_SHORT)
private String pcrCurrdesc;
@Column(name = "PCR_CURRSHORT", nullable = false, updatable = true, columnDefinition = FieldNameLength.DESCRIPTION_SHORT)
private String pcrCurrshort;
@Column(name = "MBM_BKMSTITLE_REF", nullable = false, updatable = true, columnDefinition = FieldNameLength.ACCOUNT_TITLE)
private String mbmBkmstitleRef;
@Column(name = "MBM_BKMSNUMBER_REF", nullable = false, updatable = true, columnDefinition = FieldNameLength.ACCOUNT_NUMBER)
private String mbmBkmsnumberRef;
// @Column(name = "OCB_BENEFICIARYVERIFIED", nullable = false, updatable = true, columnDefinition = FieldNameLength.BOOLEAN_BIT)
// private boolean ocbBeneficiaryverified;
// @Column(name = "OCB_BENEFICIARYVERIFYDATE", nullable = true, updatable = true, columnDefinition = FieldNameLength.DATETIME)
// private LocalDateTime ocbBeneficiaryverifydate;
@Column(name = "REF_PHONE_NUMBER", nullable = true, columnDefinition = FieldNameLength.CODE_50)
private String refPhoneNumber;
@Column(name = "REF_EMAIL", nullable = true, columnDefinition = FieldNameLength.CODE_50)
private String refEmail;
@Column(name = "REF_NICK_NAME", nullable = true, columnDefinition = FieldNameLength.CODE_50)
private String refNickName;
}

@ -0,0 +1,14 @@
package com.mfsys.uco.repository;
import com.mfsys.uco.model.Beneficiary;
import com.mfsys.uco.model.BeneficiaryId;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.Optional;
@Repository
public interface BeneficiaryRepository extends JpaRepository<Beneficiary, Long> {
Optional<Beneficiary> findBeneficiaryByEmailAndPorOrgacodeAndMbmBkmsnumberRef(String email, String porOrgacode, String mbmBkmsnumberRef);
}

@ -18,7 +18,7 @@ public interface TransactionTrailRepository extends JpaRepository<TransactionTra
@Query(value = "SELECT * " +
"FROM bn_ms_ua_ucoaccounttrail " +
"WHERE (dr_mbm_bkmsnumber = :mbmBkmsnumber AND (bat_acnttransent = TRUE OR bat_acnttranreceived = TRUE)) " +
" OR (cr_mbm_bkmsnumber = :mbmBkmsnumber AND (bat_acnttransent = TRUE AND bat_acnttranreceived = TRUE)) ORDER BY id DESC", nativeQuery = true)
" OR (cr_mbm_bkmsnumber = :mbmBkmsnumber AND (bat_acnttransent = TRUE AND bat_acnttranreceived = TRUE AND batAcnttranReversed = false)) ORDER BY id DESC", nativeQuery = true)
Optional<List<TransactionTrail>> fetchDepositAccountStatement(String mbmBkmsnumber);
TransactionTrail findByPorOrgacodeAndSgtSentNodeIdAndSgtSentGntrnumber(String porOrgacode, String sgtSentNodeId, String sgtSentGntrnumber);

@ -1,8 +1,10 @@
package com.mfsys.uco.service;
import com.mfsys.uco.dto.UpdateProfileRequestPayload;
import com.mfsys.uco.model.Beneficiary;
import com.mfsys.uco.model.CustomerProfile;
import com.mfsys.uco.model.CustomerProfileId;
import com.mfsys.uco.repository.BeneficiaryRepository;
import com.mfsys.uco.repository.CustomerProfileRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
@ -13,6 +15,7 @@ import java.util.Optional;
@RequiredArgsConstructor
public class CustomerProfileService {
private final CustomerProfileRepository customerProfileRepository;
private final BeneficiaryRepository beneficiaryRepository;
public CustomerProfile fetchCustcodeBasedOnEmail(String porOrgacode, String email) {
return customerProfileRepository.findbyEmail(porOrgacode, email);
@ -25,4 +28,10 @@ public class CustomerProfileService {
customerProfileRepository.save(customerProfile);
});
}
public void addBeneficiary(Beneficiary beneficiary) {
OptionalbeneficiaryRepository.findBeneficiaryByEmailAndPorOrgacodeAndMbmBkmsnumberRef(beneficiary.getEmail(),beneficiary.getPorOrgacode(), beneficiary.getMbmBkmsnumberRef());
if()
beneficiaryRepository.save(beneficiary);
}
}

Loading…
Cancel
Save