-
Notifications
You must be signed in to change notification settings - Fork 8
backend/enhancement/added-mandate-status-check-support #1235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -148,3 +148,32 @@ data MandateResumeReq = MandateResumeReq | |
| resume_date :: Text | ||
| } | ||
| deriving (Eq, Show, Generic, ToJSON, FromJSON, ToSchema, ToForm) | ||
|
|
||
| --- For Mandate Status --- | ||
|
|
||
| data MandateStatusReq = MandateStatusReq | ||
| { command :: Text | ||
| } | ||
| deriving (Eq, Show, Generic, ToJSON, FromJSON, ToSchema, ToForm) | ||
|
|
||
| data JuspayMandateStatusResp = JuspayMandateStatusResp | ||
| { mandate_id :: Text, | ||
| status :: Text, | ||
| frequency :: Text, | ||
| start_date :: Text, | ||
| end_date :: Text, | ||
| max_amount :: Double, | ||
| order_id :: Maybe Text, | ||
| payment_info :: Maybe MandatePaymentInfo | ||
| } | ||
| deriving (Eq, Show, Generic, ToJSON, FromJSON, ToSchema) | ||
|
Comment on lines
+159
to
+169
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Other mandate payloads in this codebase model ♻️ Proposed change data JuspayMandateStatusResp = JuspayMandateStatusResp
{ mandate_id :: Text,
status :: Text,
frequency :: Text,
start_date :: Text,
end_date :: Text,
- max_amount :: Double,
+ max_amount :: HighPrecMoney,
order_id :: Maybe Text,
payment_info :: Maybe MandatePaymentInfo
}🤖 Prompt for AI Agents |
||
|
|
||
| data MandatePaymentInfo = MandatePaymentInfo | ||
| { upi :: Maybe MandateUpiInfo | ||
| } | ||
| deriving (Eq, Show, Generic, ToJSON, FromJSON, ToSchema) | ||
|
|
||
| data MandateUpiInfo = MandateUpiInfo | ||
| { payer_vpa :: Maybe Text | ||
| } | ||
| deriving (Eq, Show, Generic, ToJSON, FromJSON, ToSchema) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
orderShortIdsilently defaults to empty string whenorder_idis absent.order_idisMaybe TextinJuspayMandateStatusResp, and here it's coalesced to"". Downstream code that treatsorderShortIdas a required, non-empty identifier (e.g., for lookups/logging correlation) will silently misbehave. Consider either:Info/Warnwhenorder_idis missing, ororderShortIdonMandateStatusRespaMaybe Text, orInternalErrorif it's truly required.Given this is a mandate-status response (not necessarily tied to a single order), the middle option is typically the cleanest.
🤖 Prompt for AI Agents