Contract: cancel_invoice for pending invoices

Aperta
#29 3 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@robertocarlous ci sta già lavorando.

Dal 21/11/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

contract difficulty: intermediate enhancement needs-discussion Stellar Wave web

Difficulty: Intermediate

Description

An invoice is immutable once created. A freelancer who typed the wrong client or amount can never retract it, and it keeps showing as Pending (and eventually Overdue) forever.

Implementation suggestions

Add InvoiceStatus::Cancelled = 2 (appended). cancel_invoice(invoice_id) requires freelancer auth and works only on Pending. Add Error::NotCancellable, an InvoiceCancelled event, and make fund_invoice reject cancelled invoices. Update decodeInvoice, StatusBadge, the dashboard totals, the History filters and the pay page.

Acceptance criteria

  • Tests cover cancel by the freelancer, cancel by an impostor and with no auth (both rejected), cancel after Paid (rejected), and funding after cancel (rejected).
  • The UI shows a Cancelled badge.
  • Docs are updated.

Dependencies / related

Needs discussion (redeploy and a status-decoding change; see the numeric status decoding comment in web/lib/contract.ts). Batch with #27, #28 and #30. Extend the error map in #12.

Lingua principale
TypeScript
Stelle
0
Fork
4
Merge medio
54m
PR unite (30g)
6

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Yormee-103/PayLoop

Tutte le issue di Yormee-103/PayLoop

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.