Skip to content

Commit 3f631fd

Browse files
committed
feat: optional policy payout beneficiary + holder-only updates
- Policy.beneficiary Option<Address>; initiate_policy + set_beneficiary - Payout to beneficiary.unwrap_or(holder); BeneficiaryUpdated events - Tests: policy_beneficiary + initiate_policy/Claim fixture updates - Backend: 9-arg golden vectors, BuildTransactionDto aligned with contract - Frontend: policy detail page + beneficiary mismatch warning - Remove obsolete tests/events.rs; fix duplicate contractimpl methods Made-with: Cursor
1 parent 3c90de3 commit 3f631fd

43 files changed

Lines changed: 865 additions & 525 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

backend/package-lock.json

Lines changed: 11 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/src/dto/policy.dto.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,11 @@ export interface PolicyDto {
129129
* Empty array if no claims exist.
130130
*/
131131
claims: ClaimSummaryDto[];
132+
/**
133+
* Optional payout beneficiary (on-chain). When set, approved claim proceeds
134+
* are sent here instead of the holder. Null/omitted means holder receives payout.
135+
*/
136+
beneficiary: string | null;
132137
/**
133138
* Self-link for this policy resource.
134139
* @example "/policies/GABC.../1"
@@ -188,6 +193,7 @@ export function toPolicyDto(p: Policy, claims: Claim[]): PolicyDto {
188193
avg_ledger_close_seconds: 5,
189194
},
190195
claims: claims.map(toClaimSummaryDto),
196+
beneficiary: p.beneficiary ?? null,
191197
_link: `/policies/${encodeURIComponent(p.holder)}/${p.policy_id}`,
192198
};
193199
}

0 commit comments

Comments
 (0)