feat: add 10-year long-tenure loyalty discount - #6
Conversation
Adds a 15% loyalty bracket for members of 10+ years on top of the existing 1/3/5-year tiers. This rewards the lowest-churn, lowest-claims-frequency cohort and, combined with the no-claims cap, now exercises the regulatory premium floor for the cheapest policies. Closes PRU-123 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
Walkthrough
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Comment |
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
gitleaks/gitleaks-action@v2 now requires a paid licence for organisation repos, which we do not have. gitleaks core is MIT/OSS, so run the pinned v8.30.1 release binary directly. Keeps the `gitleaks` workflow and job/check name (the required status-check context) and produces a real secret scan. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/gitleaks.yml:
- Around line 17-20: The gitleaks install step currently extracts the downloaded
release tarball without verifying its integrity. Update the workflow step in
gitleaks.yml to fetch the published checksum file for the same VERSION, verify
the downloaded gitleaks_${VERSION}_linux_x64.tar.gz against it before calling
tar, and only proceed to ./gitleaks version and ./gitleaks detect after the
checksum matches.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 6b336bf7-c74f-4f25-a801-80dad58156ab
📒 Files selected for processing (1)
.github/workflows/gitleaks.yml
Addresses a CodeRabbit review comment: the gitleaks install step pulled the release tarball without integrity verification. Now download the published checksums file and verify the tarball's SHA-256 (sha256sum -c) before extraction — supply-chain hardening, fitting for an SDLC demo repo. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
cc-shekher has read-only access, so GitHub flagged them as an unknown owner
("needs write access") and the codeowners/errors API reported the error.
Removing them leaves the 5 valid Code Owners and clears repos.codeownersErrors
once this PR merges to the protected main branch.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Summary
Adds a new 10-year long-tenure loyalty bracket (15%) on top of the existing
1/3/5-year loyalty tiers in the quote engine. Members who have stayed 10+ years
are the lowest-churn, lowest-claims-frequency cohort and earn the deepest
loyalty discount.
Changes
src/discount.ts— new>= 10 years -> 0.15bracket inloyaltyDiscountRate.test/discount.test.ts— covers the new bracket (rate table +loyaltyDiscount).test/quote.test.ts— the deepest-discount case now exercises the regulatorypremium floor (previously unreachable), so the clamp is now under test.
Testing
npm run lint— cleannpm test -- --coverage— 40 tests pass, 100% coveragenpm run build— cleanCloses PRU-123
Summary by CodeRabbit