activation-and-invoicing

Manages course activation requests and per-course invoice issuance in the PalFish GMV backend.

1|Updated May 23, 2026
One-click install
npx skills add https://github.com/palfish-t-i-u/palfish-t-i-u-h-th-ng-ver-2 --skill activation-and-invoicing-palfish-t-i-u
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: activation-and-invoicing
Source: https://github.com/palfish-t-i-u/palfish-t-i-u-h-th-ng-ver-2/tree/main/.claude/skills/activation-and-invoicing
Command: npx skills add https://github.com/palfish-t-i-u/palfish-t-i-u-h-th-ng-ver-2 --skill activation-and-invoicing-palfish-t-i-u

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? It guides work on the B3 course-activation and B4 invoice-issuance flows of the PalFish GMV Manager, where Active Requests, CRM order_id matching, INV code allocation, tax ZIP export, and reminder notifications all live in one backend module with several non-obvious rules and legacy boundaries. ## Core Features & Use Cases - Active Request lifecycle management: Create, edit, and transition ARs through the status machine (pending_order → partial_order → activated → ready_invoice → invoiced) in backend/activation_routes.py. - Invoice issuance and tax export: Allocate per-course INV codes from invoice_sequences, generate the 3-file tax ZIP, and record delivery logs. - Address-required rule debugging: Diagnose why a customer is blocked from invoice export, keeping the duplicated FE/BE country lists in sync. - Reminder and notification flows: Work on invoice-remind (sale → accountant), activation-urgent-remind (sale → Ops Zalo), and the in-app notification bell. - Use Case: A sale reports that an overseas customer cannot export an invoice. Use this Skill to trace the address-validation rule across ActivationTab.tsx and activation_routes.py, find the country-list divergence, and fix both sides. ## Quick Start Ask the assistant to use the activation-and-invoicing skill to debug why a specific Active Request is blocked from invoice export.

Frequently Asked Questions about activation-and-invoicing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new feature to the course activation or invoice flow?

Add all new B3/B4 code to backend/activation_routes.py, never to the legacy invoice_routes.py. Check the AR status machine before adding transitions, then run frontend unit tests, npx tsc -b, and a full build before pushing.

Why is a customer blocked from invoice export?

The address-required rule blocks export when address fields are incomplete. VN customers need province, ward, and street; overseas customers only need the country in the province field. The rule is duplicated in ActivationTab.tsx and activation_routes.py, so check both for diverging country lists.

Why does the notification bell show fake data after a sandbox reset?

The notifications table is created by docs/sql/notifications_exchange_rates.sql, which sits outside the numbered migrations. If it is missing, useNotifications.ts silently falls back to MOCK_NOTIFICATIONS with no visible error. Re-run the SQL file in the Supabase SQL Editor.

What is the difference between invoice-remind and activation-urgent-remind?

Invoice-remind notifies the accountant that a paid PR needs an invoice, uses the invoice_reminders table with a 24h throttle, and lives in payment_request_routes.py. Activation-urgent-remind pings Ops via Zalo about pending CRM order_ids, uses activation_reminders with a 15-minute throttle, and lives in activation_routes.py.

When should I use the legacy invoice_routes.py instead of activation_routes.py?

Never for new B3/B4 work. invoice_routes.py only serves the legacy M3/M4 flow on the don_hang table with its own status vocabulary. Both are live in production, but all Active Request and per-course invoice features belong in activation_routes.py.

Why does bulk invoice issuance return HTTP 200 with failures?

The bulk-issue endpoint continues on per-item errors and always returns HTTP 200. Inspect the response body for error_count and the errors array; a non-zero error_count means some invoices were not issued despite the success status.