Skip to content

feat: usage counter fields on payment OfferResp - #1513

Merged
khuzema786 merged 1 commit into
mainfrom
feat/offer-usage-fields
Sep 11, 2026
Merged

khuzema786 merged 1 commit into
mainfrom
feat/offer-usage-fields

Conversation

@shivendrashah

@shivendrashah shivendrashah commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Optional minimumAmount and a counters object (frequencyType, appliedCount, maxApplyCount) on Interface.Types.OfferResp for domain offers; the Juspay adapter leaves both empty.

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates

Description

Additional Changes

  • This PR modifies the database schema (database migration added)
  • This PR modifies dhall configs/environment variables

Motivation and Context

How did you test it?

Checklist

  • I formatted the code and addressed linter errors ./dev/format-all-files.sh
  • I reviewed submitted code
  • I added unit tests for my changes where possible
  • I added a CHANGELOG entry if applicable

Summary by CodeRabbit

  • Enhancements
    • Offer responses now support additional optional details, including offer frequency, applied count, maximum application count, and minimum eligible amount.
    • Existing product discount information remains supported alongside these offer details.
    • When these values are unavailable, the response leaves them unset rather than providing inaccurate information.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 8a78bd7e-b9ea-4b95-b91d-194ccae9ece4

📥 Commits

Reviewing files that changed from the base of the PR and between 4c6c4b2 and aa8ff7d.

📒 Files selected for processing (2)
  • lib/mobility-core/src/Kernel/External/Payment/Interface/Juspay.hs
  • lib/mobility-core/src/Kernel/External/Payment/Interface/Types.hs

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

OfferResp now includes four optional offer fields. mkOfferResp initializes these fields to Nothing.

Changes

Offer response contract

Layer / File(s) Summary
Extend offer response mapping
lib/mobility-core/src/Kernel/External/Payment/Interface/Types.hs, lib/mobility-core/src/Kernel/External/Payment/Interface/Juspay.hs
OfferResp adds optional frequency, application-count, and minimum-amount fields. mkOfferResp initializes them to Nothing.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Feature

Merge Risk: ⚪ Minimal · up to aa8ff

The offer response contract is extended compatibly, and Juspay leaves the new optional values absent as intended.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately identifies the addition of usage counter fields to payment OfferResp. It does not mention frequencyType or minimumAmount, but it clearly describes the primary change.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/offer-usage-fields

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit checks the offer’s flow
Four new fields now softly show
Frequency waits in quiet space
Counts and minimum find their place
Juspay leaves them blank for now

Comment @coderabbitai help to get the list of available commands.

@shivendrashah
shivendrashah force-pushed the feat/offer-usage-fields branch from bec965d to aa8ff7d Compare September 11, 2026 04:12
@coderabbitai
coderabbitai Bot requested a review from khuzema786 September 11, 2026 04:12
Optional minimumAmount and a counters object (frequencyType, appliedCount, maxApplyCount) for
domain offers; the Juspay adapter leaves both empty.
@shivendrashah
shivendrashah force-pushed the feat/offer-usage-fields branch from aa8ff7d to 53f9356 Compare September 11, 2026 05:03
@khuzema786
khuzema786 merged commit 2a2485a into main Sep 11, 2026
2 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