Skip to content

Overweights Chargeback UI

Frontend behavior for applying chargeback (individual or bulk) from the Overweights screen when the ticket status filter is Solved.

Where It Lives

The same Overweights table used for accept/reject overweight refunds. When the user filters by ticket status Solved, the context shifts to "refunds to reverse" and the bulk action and row actions show chargeback instead of accept/reject.

Main Screens and Purpose

Screen / areaPurpose
Overweights tableLists overweight records; filters include ticket status (e.g. Pending, Solved).
Filter "Solved"When only Solved is selected, table shows rows whose ticket is already Solved; only rows with an approved compensation are eligible for chargeback.
Bulk action barWhen filter is only Solved: shows "Apply bulk chargeback" (or i18n equivalent). Otherwise: shows "Accept masive" / "Reject masive".
Row actionsWhen the row is eligible (Solved + approved compensation): shows "Apply chargeback" in addition to or instead of accept/reject.

Chargeback Modal

  • Opened when the user clicks "Apply bulk chargeback" or "Apply chargeback" on a row.
  • Required: Chargeback reason (review_comment).
  • On confirm: call POST /overweights/chargeback with compensation_ids (selected rows' compensation_id values) and review_comment.
  • On success: reload table, clear selection, show toast. On error (e.g. 400 ineligible): show error message.

Selection Rules

When the ticket status filter is only Solved:

  • Only rows with ticket_status_id === ACCEPTED and a valid compensation_id (and optionally compensation status ACCEPTED) are selectable.
  • Rows without a compensation or not Solved should not be selectable in this mode so the user cannot send ineligible ids to the API.

User Flows

  1. Bulk chargeback — Set filter to Solved → select one or more eligible rows → click "Apply bulk chargeback" → enter reason → confirm. Backend applies chargeback to each compensation; balance debited, ticket set to Rejected, audit record created.
  2. Individual chargeback — Set filter to Solved (or navigate to a Solved row) → open row actions → "Apply chargeback" → enter reason → confirm. Same backend behavior for a single compensation.
  3. Accept/Reject (unchanged) — When filter is not only Solved, bulk actions remain "Accept masive" and "Reject masive"; chargeback actions are not shown.

Components and API

  • Overweights Table — Conditional bulkButtons and itemsSelectedFilter based on ticketStatus filter; row actions depend on eligibility (Solved + compensation_id).
  • API — e.g. api.overweight.applyChargeback({ compensation_ids, review_comment }) calling POST /overweights/chargeback.

Envia Admin