DAR-148 — Add JPA associations and explicit column mappings to KYC models
Summary
-
KycDocument: added@Column(name = "kyc_id")tokycIdfield. -
KycReview: added@Column(name = "kyc_id")tokycIdfield; added lazy@OneToOneback-reference toKycRequest(join onkyc_id). -
KycRequest: addedname = "user_id"to the existing@ColumnonuserId; added lazy@OneToManytoKycDocument(viakyc_id), lazy@OneToOnetoKycReview(mapped bykycRequest), and lazy@OneToOnetoInvestorProfile(viauser_id). -
InvestorProfile: added@Column(name = "user_id")to the@Idfield.
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.LAZYand read-only (insertable = false, updatable = false) — no schema changes. -
CHANGELOG.mdupdated under[0.0.28-RELEASE].