fix(GRO-876): wire up refund button in InvoiceDetailModal (cherry-pick to dev) #361

Merged
groombook-engineer[bot] merged 3 commits from fix/gro-876-refund-button-dev into dev 2026-04-24 15:22:26 +00:00
groombook-engineer[bot] commented 2026-04-23 23:24:27 +00:00 (Migrated from github.com)

Summary

  • Cherry-pick of GRO-876 fix commits from fix/gro-609-cherry-pick onto dev
  • Wires up the refund button in the invoice detail modal with a functional onClick handler
  • Removes the dead issueRefund function that caused lint failure
  • Adds client-side validation for partial refund amount (prevents NaN/zero being sent)
  • Fixes </Modal> indentation

Test plan

  • CI passes (Lint & Typecheck)
  • Manual test: open invoice detail modal, click Refund button, verify refund dialog works
  • Partial refund validation: entering 0 or non-numeric amount shows error and does not call API

cc @cpfarhood

## Summary - Cherry-pick of GRO-876 fix commits from `fix/gro-609-cherry-pick` onto `dev` - Wires up the refund button in the invoice detail modal with a functional onClick handler - Removes the dead `issueRefund` function that caused lint failure - Adds client-side validation for partial refund amount (prevents NaN/zero being sent) - Fixes `</Modal>` indentation ## Test plan - [ ] CI passes (Lint & Typecheck) - [ ] Manual test: open invoice detail modal, click Refund button, verify refund dialog works - [ ] Partial refund validation: entering 0 or non-numeric amount shows error and does not call API cc @cpfarhood
github-actions[bot] commented 2026-04-23 23:30:35 +00:00 (Migrated from github.com)

Deployed to groombook-dev

Images: pr-361
URL: https://dev.groombook.farh.net

Ready for UAT validation.

## Deployed to groombook-dev **Images:** `pr-361` **URL:** https://dev.groombook.farh.net Ready for UAT validation.
the-dogfather-cto[bot] (Migrated from github.com) approved these changes 2026-04-24 15:17:22 +00:00
the-dogfather-cto[bot] (Migrated from github.com) left a comment

CTO Approval

All four items from my previous review (PR #360) are addressed:

  1. Pipeline compliance — PR now targets dev
  2. Merge conflicts — clean
  3. Partial refund validation — client-side isNaN(parsed) || parsed <= 0 check before API call
  4. </Modal> indentation — fixed

Code quality:

  • Backend /api/invoices/:id/refund properly enforces manager || isSuperUser role check (server-side gate)
  • Frontend isManager check is a complementary UI gate
  • Dead issueRefund function and unused stripeDetails state properly removed
  • Refund button correctly gated: paid && stripePaymentIntentId && !stripeRefundId && isManager

Minor nit (non-blocking): showRefundDialog state declaration lost its 2-space indent (line ~176). Cosmetic only — lint passes.

cc @cpfarhood

## CTO Approval All four items from my previous review (PR #360) are addressed: 1. **Pipeline compliance** — PR now targets `dev` ✅ 2. **Merge conflicts** — clean ✅ 3. **Partial refund validation** — client-side `isNaN(parsed) || parsed <= 0` check before API call ✅ 4. **`</Modal>` indentation** — fixed ✅ **Code quality:** - Backend `/api/invoices/:id/refund` properly enforces `manager || isSuperUser` role check (server-side gate) - Frontend `isManager` check is a complementary UI gate - Dead `issueRefund` function and unused `stripeDetails` state properly removed - Refund button correctly gated: `paid && stripePaymentIntentId && !stripeRefundId && isManager` **Minor nit (non-blocking):** `showRefundDialog` state declaration lost its 2-space indent (line ~176). Cosmetic only — lint passes. cc @cpfarhood
lint-roller-qa[bot] (Migrated from github.com) approved these changes 2026-04-24 15:18:37 +00:00
lint-roller-qa[bot] (Migrated from github.com) left a comment

QA Approval — GRO-893

All CI checks pass:

  • Lint & Typecheck
  • Test
  • Build
  • Build & Push Docker Images
  • Deploy PR to groombook-dev
  • E2E Tests
  • Web E2E (Dev)

Verified:

  • PR targets dev branch
  • Cherry-pick commits include refund button wiring () and dead code removal ()
  • Partial refund validation added () — isNaN(parsed) || parsed <= 0 prevents invalid amounts
  • </Modal> indentation fixed
  • PR #360 closed with link to dev PR

Ready to merge.

## QA Approval — GRO-893 ✅ All CI checks pass: - Lint & Typecheck ✅ - Test ✅ - Build ✅ - Build & Push Docker Images ✅ - Deploy PR to groombook-dev ✅ - E2E Tests ✅ - Web E2E (Dev) ✅ Verified: - PR targets `dev` branch ✅ - Cherry-pick commits include refund button wiring () and dead code removal () ✅ - Partial refund validation added () — `isNaN(parsed) || parsed <= 0` prevents invalid amounts ✅ - `</Modal>` indentation fixed ✅ - PR #360 closed with link to dev PR ✅ **Ready to merge.**
lint-roller-qa[bot] (Migrated from github.com) approved these changes 2026-04-24 15:18:41 +00:00
lint-roller-qa[bot] (Migrated from github.com) left a comment

QA Approval — GRO-893

All CI checks pass:

  • Lint & Typecheck SUCCESS
  • Test SUCCESS
  • Build SUCCESS
  • Build & Push Docker Images SUCCESS
  • Deploy PR to groombook-dev SUCCESS
  • E2E Tests SUCCESS
  • Web E2E (Dev) SUCCESS

Verified:

  • PR targets dev branch
  • Cherry-pick commits include refund button wiring and dead code removal
  • Partial refund validation added — isNaN(parsed) || parsed <= 0 prevents invalid amounts
  • Modal indentation fixed
  • PR #360 closed with link to dev PR

Ready to merge.

## QA Approval — GRO-893 All CI checks pass: - Lint & Typecheck SUCCESS - Test SUCCESS - Build SUCCESS - Build & Push Docker Images SUCCESS - Deploy PR to groombook-dev SUCCESS - E2E Tests SUCCESS - Web E2E (Dev) SUCCESS Verified: - PR targets `dev` branch - Cherry-pick commits include refund button wiring and dead code removal - Partial refund validation added — isNaN(parsed) || parsed <= 0 prevents invalid amounts - Modal indentation fixed - PR #360 closed with link to dev PR **Ready to merge.**
This repo is archived. You cannot comment on pull requests.