Skip to content

feat(people): add fee renewals and signed receipts - #100

Draft
viganogabriele wants to merge 1 commit into
claude/eager-mayer-bsom7vfrom
claude/vigilant-euler-gkle0o
Draft

viganogabriele wants to merge 1 commit into
claude/eager-mayer-bsom7vfrom
claude/vigilant-euler-gkle0o

Conversation

@viganogabriele

Copy link
Copy Markdown
Contributor

Stacked on #97 (People): this PR targets its branch, so the diff shows only the fees and receipts work. Retarget to main once #97 is merged.

What it adds

The full membership renewal cycle on top of the People area:

  1. Member (Account › My area): bank details with copy buttons, Upload transfer receipt (file, transfer date, amount), the rejection reason when there is one, and the signed receipts to download.
  2. Admin (people:fees:write), in People › Member register and the person record:
    • Review receipt: a preview of the transfer receipt plus the member's data; Approve, or Reject with a reason.
    • Mark as paid: date, amount and method, optional note.
    • Send reminder on a row, and Send reminders for the whole register (asks for confirmation, skips members reminded in the last 3 days).
  3. System: approval or Mark as paid issues a numbered receipt (2026/042, never reused) as an Italian A4 PDF.
  4. President (people:receipts:sign), in the new People › Receipts section:
    • Download to sign (ZIP), sign with the CIE app outside the dashboard, then Upload signed.
    • Files are matched by the receipt number in their name and can be corrected by hand; each file shows an outcome: Signed, Not signed, Needs another signer, No receipt, Duplicate or Already signed.
    • Send n receipts emails them to the members.
    • The President's own receipt goes to the Vice-president.
  5. Pipeline: To sign → Signed → Sent, plus Send failed (with Retry) and Voided. Receipts are never deleted.
  6. Every fee and receipt event is written to the person's Activity. The panel shows how many receipts wait for the signed-in officer.

Code

  • Contract (people.contract.ts, docs/people/contract.md):
    • New types: FeeDetail, Receipt.
    • fees on the record and feeInstructions in My area.
    • New procedures: people.fees.*, people.receipts.*, people.me.uploadTransferReceipt, people.me.receipt.
    • Backend rules: who signs what, numbering, signature verification, email, automatic reminders.
  • Permissions (provisional): people:fees:write and people:receipts:sign, each with its own middleware.
  • Agent mode:
    • Seeds fee years and receipts with their own seed, so the rest of the sample data is unchanged.
    • Implements every procedure.
    • Renders the receipt PDF and the ZIP to sign (receipt-files.server.ts).
    • Sample people: P-0007 is the President, P-0098 the Vice-president, P-0045 has a receipt to review, P-0021 a rejected one.
  • UI:
    • fee-dialogs.tsx, receipts-page.tsx, receipt-dialogs.tsx, my-fee-card.tsx.
    • Changes to the Member register, the person record and My area.
    • New route /dashboard/people/receipts and its nav section, with the to-sign count threaded through the shell.
  • Docs:
    • New docs/people/fees.md with the flow, screens, permissions and PDF template.
    • Updates to decisions.md, plan.md (phase 11), design.md §8, the README and AGENTS.md.

Design decisions to confirm

  • Register header: Send reminders is the outline action; Export moves into the header ⋮ when the viewer has both permissions. The header allows one primary and at most one outline.
  • Mark as paid asks for the payment method (bank transfer or cash), because the receipt prints it.
  • Fee status is shown once per page: on the record and in My area it now lives in the fee card, not in Member or My roles.
  • Placeholders: the IBAN, tax codes, registered address and tax note of the PDF are placeholders. The real values belong in backend configuration.

Verification

  • pnpm check (0 errors), pnpm typecheck, pnpm test (59 pass, 11 new in tests/people-fees.test.mjs) and pnpm build all pass.
  • In agent mode, at 1440 and 390, light and dark, as the President and as a member whose receipt was rejected: approve, reject, Mark as paid, reminders, download to sign, upload and send, retry, void, and the member upload all work with no console errors.
  • The generated PDF and ZIP were checked with pdftotext and unzip -t.
  • Headless Chromium doesn't render PDFs inside iframes, so the Review receipt preview showed blank there; it needs a check in a real browser.

Still for the backend

The real procedures, the officers' configuration, automatic reminders, signature verification and email delivery: see the "Fees and receipts" section of contract.md.

🤖 Generated with Claude Code

https://claude.ai/code/session_0153QstPiakqZmaaVgTaqdnj


Generated by Claude Code

Members upload their transfer receipt in My area; admins with
people:fees:write approve it, reject it with a reason, mark a fee paid by
hand and send reminders from the Member register or the record. Approval
issues a numbered receipt (2026/042) that the President downloads as a
ZIP, signs with the CIE app and uploads back in the new People › Receipts
section; files are matched by the number in their name, corrected by
hand, and emailed to the member. The President's own receipt goes to the
Vice-president. Receipts are never deleted, only voided.

The contract gains FeeDetail, Receipt, fees on the record, fee
instructions in My area, people.fees.*, people.receipts.* and two
people.me.* procedures, with the provisional permissions
people:fees:write and people:receipts:sign. Agent mode seeds fee years
and receipts and renders the Italian receipt PDF and the ZIP to sign.
docs/people/fees.md describes the flow, screens and PDF template.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0153QstPiakqZmaaVgTaqdnj
@coderabbitai

coderabbitai Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants