Skip to content

DAR-148 — Add JPA associations and explicit column mappings to KYC models

Summary

  • KycDocument: added @Column(name = "kyc_id") to kycId field.
  • KycReview: added @Column(name = "kyc_id") to kycId field; added lazy @OneToOne back-reference to KycRequest (join on kyc_id).
  • KycRequest: added name = "user_id" to the existing @Column on userId; added lazy @OneToMany to KycDocument (via kyc_id), lazy @OneToOne to KycReview (mapped by kycRequest), and lazy @OneToOne to InvestorProfile (via user_id).
  • InvestorProfile: added @Column(name = "user_id") to the @Id field.

Motivation

The explicit @Column mappings on FK fields are required for the referencedColumnName attributes in the new @JoinColumn declarations to resolve correctly. Together, these changes allow consuming services to navigate the full KYC object graph (request → documents, review, investor profile) without issuing separate queries.

Notes

  • All new associations are FetchType.LAZY and read-only (insertable = false, updatable = false) — no schema changes.
  • CHANGELOG.md updated under [0.0.28-RELEASE].

Rapports de requête de fusion