Skip to content

Add metadata/Stripe-charge-id search and amount range to payments index - #2210

Merged
maebeale merged 6 commits into
mainfrom
maebeale/payments-search-amount-filter
Aug 15, 2026
Merged

Add metadata/Stripe-charge-id search and amount range to payments index#2210
maebeale merged 6 commits into
mainfrom
maebeale/payments-search-amount-filter

Conversation

@maebeale

Copy link
Copy Markdown
Collaborator

🤖 suggested review level: 3 Read 📖 small filter additions to one model + one filter partial, covered by model specs

What is the goal of this PR and why is this important?

  • The payments index had no way to find a payment by its metadata, Stripe charge id, or amount.

How did you approach the change?

  • Extended Payment.search_by_params with a search filter (CAST(metadata AS CHAR) LIKE ? OR stripe_charge_id LIKE ?, wildcard-escaped) and amount_min/amount_max dollar→cents range filters — all no-ops when blank, so an empty form returns every row.
  • Added a "Search metadata / Stripe charge ID" text box and min/max amount fields to the filter partial; they flow through the existing collection Stimulus controller and payments_results turbo frame.

Anything else to add?

  • Folded Stripe charge id into the same text box as metadata (one OR search) rather than a separate field.
  • metadata is a MySQL JSON column, so search is a substring match over the serialized JSON, not key-scoped.

Copilot AI lite review requested due to automatic review settings August 15, 2026 14:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@maebeale
maebeale marked this pull request as ready for review August 15, 2026 14:05
Copilot AI review requested due to automatic review settings August 15, 2026 14:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings August 15, 2026 14:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings August 15, 2026 14:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

maebeale and others added 5 commits August 15, 2026 10:28
The payments index only filtered by type, payer, and remaining-amount, so
there was no way to locate a payment by its metadata contents, its Stripe
charge id, or by size.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The payments amount range fields were the only number inputs in a collection
filter form, so they never auto-submitted. Teach the shared controller to
debounce-submit (and clear) number inputs like text inputs, so the amount
range applies live and the explicit Search button is no longer needed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings August 15, 2026 14:31
@maebeale
maebeale force-pushed the maebeale/payments-search-amount-filter branch from ef672b6 to ba7ce31 Compare August 15, 2026 14:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Grey the plain selects' default 'All' option (like the events/allocations
filter selects) and put every field on the shared field_class/label_class so
placeholders read consistently with the remote search boxes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings August 15, 2026 14:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@maebeale
maebeale merged commit ccd584f into main Aug 15, 2026
3 checks passed
@maebeale
maebeale deleted the maebeale/payments-search-amount-filter branch August 15, 2026 14:51
maebeale added a commit that referenced this pull request Aug 16, 2026
CE attendance tracking (#2075), CE/licenses browse indexes (#2208), payments
Stripe/metadata/amount search (#2210), grant sector+category tagging (#2199),
richer communications log (#2177), and topic-subscription recipient filter (#2179).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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