Skip to content

Matching hint net of refunds, and older payment notices while payment requests are stopped #93

Open

Description

@JOY

Goal

Two leftovers found by the reviews of #89 (PRs DOS/DOS.Me#1551 and #91):

  1. The creator's matching hint ignores refunds: waitsFor in apps/web/src/lib/reconciliation.ts compares a transfer with intended_amount - received_amount, so after a partial refund it no longer suggests the pledge for a transfer of the amount really due (intended - (received - refunded), as give.pledge_payment computes since DB: pledge amounts net of partial refunds, refund_owed for overpaid pledges, and a stop on payment requests #89).
  2. Notices sent before a stop still say "pay": payment_due and payment_reminder notices created before a moderator stopped the payment requests keep "Hãy thanh toán … / Thanh toán ngay" (apps/web/src/lib/notices.ts). The linked pledge page shows the stop, so nothing leaks, but the notice text is misleading while the campaign is stopped.

Requirements

  • Matching hint uses the net amount due (refunds read from give.pledge_balances or a candidate column the creator may read; no gross fallback).
  • While a campaign's payment requests are stopped (payments_stopped_at), older payment_due / payment_reminder notices render neutrally ("Give đang tạm dừng yêu cầu thanh toán…") with a "Xem cam kết" link.

Acceptance

  • Vitest for both: a partially refunded pledge is suggested for its net amount due; an older reminder on a stopped campaign shows the stop wording.

Files

apps/web/src/lib/reconciliation.ts, apps/web/src/lib/notices.ts, apps/web/src/app/me/notices/ (campaign stop lookup), tests.

Follow-up of #89.

Activity

  1. added theissue type on Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions