Skip to content

Tiered loyalty & rewards program engine#411

Merged
Cybermaxi7 merged 5 commits into
MarketXpress:mainfrom
ZuLu0890:Tiered-Loyalty-&-Rewards-Program-Engine
Apr 26, 2026
Merged

Tiered loyalty & rewards program engine#411
Cybermaxi7 merged 5 commits into
MarketXpress:mainfrom
ZuLu0890:Tiered-Loyalty-&-Rewards-Program-Engine

Conversation

@ZuLu0890
Copy link
Copy Markdown
Contributor

Summary

Provide a short description of the change. Reference related issue(s):

Resolves: # (if applicable)

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Tests
  • Chore / Maintenance

Checklist

  • Tests added/updated (unit and/or integration)
  • Migrations included (if applicable) and migration notes provided below
  • Documentation updated (README, docs/, or module-level docs)
  • Manual verification steps included
  • CI is green for this branch
  • Changelog entry added or linked to an issue

Migration Notes

If this change requires schema or data migrations, include:

  • migration file paths
  • commands to run the migration and rollback
  • expected downtime or rollout notes

How to run tests locally

Provide the commands and any env/setup required to run the tests locally, for example:

# install deps
npm ci

# run unit tests
npm run test:unit

# run integration/e2e (if applicable)
npm run test:integration

Verification steps

List manual steps a reviewer can use to validate the change.

Additional context

If this PR touches sensitive domains (payments, escrow, reconciliation, migrations involving money), add a high-level design note and request a core-team reviewer.


See docs/pr-checklist.md for more guidance on expectations for tests, migrations, and documentation.

Summary

Short description of the change and the problem it solves.


Related Issue

  • Fixes: # (issue number)

Checklist (required for all PRs)

  • I have read the PR checklist and followed its guidance.
  • I added or updated tests that verify my change (unit / integration / e2e as appropriate).
  • I updated or added migrations, and included migration notes in the description if applicable.
  • I updated relevant documentation (README, docs/, or module-level docs).
  • I ran npm run pr:check locally and it passes.
  • I added steps for manual verification in the description.
  • This PR includes a concise changelog entry or references the issue tracking the user-visible change.

Testing Steps

Describe how to run the tests and verify the change locally.

Migration Notes

If this change requires database migrations or data migrations, document them here (how to run, rollback plan, risk notes).

Docs / Release Notes

If this change affects usage, configuration, or public APIs, include the updated docs and a short release note.

name.ZuLu0890 and others added 5 commits April 26, 2026 13:31
- Add RewardsModule to PaymentsModule for dependency injection
- Inject RewardsService into PaymentsService to enable points redemption
- Add pointsToUse field to InitiatePaymentDto to allow customers to use points during checkout
- Implement logic in initiatePayment to apply reward points discount before payment
- Points are converted to discount (100 points = ) and deducted from final payment amount
- Gracefully handle points redemption failures without blocking payment

This completes the integration of the Tiered Loyalty & Rewards Program Engine with the checkout flow.
- Update from deprecated zricethezav/gitleaks-action@v8 to gitleaks/gitleaks-action@v2
- Resolves CI/CD error: Unable to resolve action zricethezav/gitleaks-action@v8
- Include src/rewards/**/*.ts in format:check
- Include payments module files (payments.module.ts, payments.service.ts, payment.dto.ts) in format:check
- Ensures new loyalty rewards code follows project formatting standards
- Keep both RewardsModule and LoggerModule in payments module
- Keep both RewardsService and LoggerService in payments service
- Resolve logging method conflicts (use logger.info)
- This maintains both loyalty program and structured logging features
@Cybermaxi7 Cybermaxi7 merged commit b9d689e into MarketXpress:main Apr 26, 2026
1 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants