Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,17 @@ What the app is and how to run it: [`README.md`](README.md). UI rules: [`docs/de
permissions yet can accept one (`peopleInviteMiddleware`: signed in, the token is the proof); the old
`/dashboard/account/me?peopleInvite=` links redirect there. `/dashboard` admits `people:self` without
`admin:access`; Capo Admin and Team Lead come from the person's own record (`peopleRoles` in the route context) and
only open their sections. Receipts, Census and My area's fee card are unconnected mockups (#138): static sample data
from `mockup-data.ts`, no server functions, disabled actions and a `MockupBanner`, gated by `people:read`, to be rebuilt
in Phase 2 (#144) and Phase 3 (#145). Handoff notes, decisions and the plan: `docs/people/`.
only open their sections. Census is an unconnected mockup (#138): static sample data from `mockup-data.ts`, no server
functions, disabled actions and a `MockupBanner`, gated by `people:read`, to be rebuilt in Phase 3 (#145). Handoff
notes, decisions and the plan: `docs/people/`.
- **Soci** (`src/features/soci/`, People's Soci group): the Libro Soci, through `sociApi(context)`, which parses the
backend's `soci.*` responses with `soci.contract.ts` (a copy of the backend's) and serves `soci.fake.server.ts` in agent
mode. `soci:read` opens Register and the socio pages, `soci:write` admits (a new Microsoft 365 account in Soci, then the
record), registers an account already in Soci, edits and changes member numbers, which moved here from Microsoft 365 ›
Members. Design: `docs/people/soci.md`.
Members. Soci › Fees reviews uploaded transfer receipts (Confirm, Reject) and marks fees as paid, also from the socio
page. My area's Socio card (`soci.me.*`, `people:self`, `soci-self.functions.ts`) shows the signed-in socio's fee, bank
details, Upload transfer receipt and Complete your details; a socio without a People record sees only that card.
`AGENT_SOCIO` picks the socio My area shows in agent mode. Design: `docs/people/soci.md`.
- **Regolamenti** (`src/features/regulations/`): the governance documents (v1: the RRI), through
`regulationsApi(context)`, which parses the backend's `regulations.*` responses with `regulations.contract.ts` (a copy
of the backend's) and, in agent mode, serves `regulations.fake.server.ts` with a local Hocuspocus and `xelatex`
Expand Down
56 changes: 26 additions & 30 deletions README.md

Large diffs are not rendered by default.

34 changes: 19 additions & 15 deletions docs/design.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ the Account page.
**Panel** (240px, 200px below 1100px). Rendered only for services with two or more sections (Telegram, Microsoft 365,
Web, Reports); WhatsApp, Overview and Account have none. A service may group its sections (`group` on `Section`): the
panel draws each group's title, 11px uppercase and subtle, above its first visible section, and the mobile pills only
keep the order. People groups Volunteers (Overview, Admins, Teams, Census, Linking) and Soci (Register, and the Receipts
mockup until Fees replaces it; Deletion pending). A 64px header with the service icon and title, then 38px items:
keep the order. People groups Volunteers (Overview, Admins, Teams, Census, Linking) and Soci (Register, Fees; Deletion
pending). A 64px header with the service icon and title, then 38px items:
the current one has a muted fill, an accent icon and a 3px accent bar; on deep pages the parent section keeps the fill
and accent icon without the bar (`data-ancestor`). The only counts are the open reports next to Reports › Open and the documents to sign next to Signatures › To sign, each as a
small accent pill.
and accent icon without the bar (`data-ancestor`). The only counts are the open reports next to Reports › Open, the documents to sign next to Signatures › To sign and
the receipts to review next to Soci › Fees, each as a small accent pill.

From 1440px, the panel has a reserved 240px slot even on pages without a panel, so opening a service keeps the
content in place. Between 760px and 1439px, the content follows the panel as it opens or closes.
Expand Down Expand Up @@ -601,15 +601,20 @@ Rules that the templates above don't imply.
use `FormDialog` with `tone="danger"`; plain confirmations stay `ConfirmDialog`.
- **Soci › Register** (`docs/people/soci.md`): the Libro Soci, one record per admission. Status segments (Active /
Ended / All) scope the table; Number leads on desktop, the name on mobile. Alerts above the table list the Soci
group's accounts without a record (with Register) and each kind of mismatch. Rows open the socio page
(`/dashboard/people/soci/$number`), a deep page with Edit and Change number.
- **Fees and receipts** (`docs/people/fees.md`): the register's first row action follows the fee (Review receipt,
Send reminder, or an empty slot); its header keeps one outline action (Send reminders), with Export register as a boxed
icon. People › Receipts is a queue with the pipeline as segments and the officer's to-sign count in the panel.
Sign with CIE uses the shared eSign flow; Download to sign and Upload signed stay in its signing-options menu.
Review receipt is an `lg` `FormDialog` whose Reject switches it to a required reason (`tone="danger"`, Back on
the left). The fee status shows once per page: the record and My area say it in their fee card, not in Member or My
roles. Amounts are `formatCents` ("€10.00") with tabular numbers.
group's accounts without a record (with Register) and each kind of mismatch, and a Fee filter menu narrows by this
year's fee. Rows open the socio page (`/dashboard/people/soci/$number`), a deep page with Edit, Change number and a
Fees card (one row per fee year, View receipt or Review, Mark as paid; the card's Mark as paid also opens a year
that has no fee yet).
- **Soci › Fees** (`docs/people/soci.md`): a queue for one fee year (the Year menu, `?year=`), receipts to review first:
segments To review / Due / Paid / Exempt with totals, and the To review count in the panel. The row's first action is
Review for a receipt to review, an empty slot otherwise, then Mark as paid. Review is an `lg` `FormDialog` with the
receipt (eSign's `PdfViewer` in its compact mode, or the image), the declared transfer and the last rejection;
Reject switches it to a required reason with three one-click starts (`tone="danger"`, Back on the left), and after
31 December warns that the socio lapses. Amounts are `formatEuro` ("€5.00") with tabular numbers.
- **Socio card** (My area): the membership, this year's fee (bank details with a copy button per value and Upload
transfer receipt while Due, the review state and Replace receipt once uploaded, the last rejection in a danger
alert), past fees, and My details with Complete your details while fields are missing. A socio without a People
record sees only the Socio card.
- **Admins**: Groups, Capo Admin of reference, Member and Census never hide; the rest follow the table width. The four
quick filters scroll sideways on phones.
- **Teams**: index cards then all members; a Team Lead without `people:read` sees only their team, as the section
Expand All @@ -621,12 +626,11 @@ Rules that the templates above don't imply.
The invite landing page (`/people/invite`) is a centred card outside the shell, like Unauthorized.
- **Capo Admin** (Telegram) and **My area** (Account): self-service pages that open with `people:self` and a role on
the person's own record; no personal emails of others, only phone, Telegram and PoliNetwork addresses.

- **Regolamenti**: Documenti is a card per document; a document page lists its versions (the newest carries "In vigore",
each has its PDF, release, differences and "Nuova bozza da qui") and its drafts. Bozze adds "Il tuo accesso" for people
admitted only by an assignment, who see no other section. The editor is a workspace (`PageContent fill`); the
procedure page is a record with the states as a stepper, disabled transitions showing why, and the emanation's steps
live; the differences page is read-only (category summary, then old and new side by side for changed articles only).
Deleghe is a list with a segmented Attive/Tutte filter.

Receipt previews use eSign’s `PdfViewer` in its compact mode. Receipt requests in Signatures show their receipt reference; their signature boxes are fixed.
Transfer receipt previews use eSign’s `PdfViewer` in its compact mode.
4 changes: 4 additions & 0 deletions docs/people/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ Everything an agent needs to build, or continue building, the People area of the
> this you?", Ask to be added) and Telegram group tracking (group columns, join requests) are removed. The permissions
> `people:members:read`, `people:members:write`, `people:fees:write` and `people:receipts:sign` are gone; the mockups
> open with `people:read`. Sections below that describe these features describe the mockup or the removed design.
>
> **Phase 2 (#144)** rebuilt Soci on the `soci.*` procedures ([`soci.md`](soci.md)): Soci › Register and Admit socio
> (#155), then Soci › Fees and My area's Socio card (#156), which replaced the Receipts and fee-card mockups. Only the
> census remains a mockup.

| File | What it is |
| ------------------------------ | ---------------------------------------------------------------------------------------- |
Expand Down
7 changes: 3 additions & 4 deletions docs/people/fees.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# People area: fees and receipts

> [!IMPORTANT]
> **This describes an unconnected mockup.** Since #138, People › Receipts and My area's fee card render static
> sample data (the Member register mockup was replaced by Soci › Register in #155), make no backend call and disable every action. The procedures, permissions
> (`people:fees:write`, `people:receipts:sign`) and the eSign receipt bridge below are removed. Soci, fees and receipts
> will be rebuilt from scratch on Microsoft 365 members in Phase 2 (#144); this file stays as the design reference.
> **This describes a removed design.** Since #138 People › Receipts and My area's fee card were unconnected mockups;
> #156 replaced them with Soci › Fees and the Socio card. The procedures, permissions (`people:fees:write`,
> `people:receipts:sign`) and the eSign receipt bridge below are removed; this file stays only as a reference.
>
> **Superseded by [`soci.md`](soci.md)** (9 November 2026): Phase 2 issues no receipts, uses the Regolamento's rules
> (€5, renewals until 31 December) and the `soci:*` permissions.
Expand Down
7 changes: 4 additions & 3 deletions docs/people/permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ count only once PoliNetwork Auth holds them (the record is linked and the role a
| Capo Admin: `people:self`, P-0003 | My area + Telegram › Capo Admin | Read-only list of the admins who have them as Capo Admin of reference |
| `people:read` | People overview, person records, Admins, Teams, Linking | Read contacts and notes; no editing, linking or appointments |
| `people:link` | Link account and Unlink on records and Overview | Search the IdP's accounts, link one by hand, unlink (Auth revokes the roles first) |
| `soci:read` | Soci › Register, socio pages | Read the Libro Soci, its activity and the Soci group's accounts without a record |
| `soci:write` | Same | Admit socio, Register existing socio, Edit, Change number |
| `people:read` (mockups) | Receipts, Census; the fee card in My area | None: unconnected mockups with sample data (#138), to be rebuilt in Phase 2 (#144) and Phase 3 (#145) |
| `soci:read` | Soci › Register, Fees, socio pages | Read the Libro Soci, its activity, fees and uploaded receipts, and the Soci group's accounts without a record |
| `soci:write` | Same | Admit socio, Register existing socio, Edit, Change number, Confirm or Reject a receipt, Mark as paid |
| Socio: `people:self`, a Soci account | My area's Socio card | Upload transfer receipt, Complete your details (empty fields only) |
| `people:read` (mockup) | Census | None: an unconnected mockup with sample data (#138), to be rebuilt in Phase 3 (#145) |
| Master Admin: all explicit permissions, P-0007 | All permitted sections | All People mutations |

`people:write` enables record, admin-role, team and invite mutations on readable pages;
Expand Down
28 changes: 16 additions & 12 deletions src/components/shell/nav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export type PageMatch =
| { kind: "people-person"; personId: string }
| { kind: "people-soci" }
| { kind: "people-socio"; number: number }
| { kind: "people-receipts" }
| { kind: "people-fees" }
| { kind: "people-admins" }
| { kind: "people-teams" }
| { kind: "people-team"; teamId: string }
Expand Down Expand Up @@ -254,15 +254,14 @@ const people: Service = {
group: "Soci",
searchPlaceholder: "Search by name, number, mailbox or CF…",
},
// Receipts is an unconnected mockup, to be replaced by Fees (Phase 2, #144).
{
id: "receipts",
title: "Receipts",
id: "fees",
title: "Fees",
icon: Receipt,
path: "/dashboard/people/receipts",
permission: "people:read",
path: "/dashboard/people/fees",
permission: "soci:read",
group: "Soci",
searchPlaceholder: "Search by name or receipt number…",
searchPlaceholder: "Search by name, number or mailbox…",
},
],
}
Expand Down Expand Up @@ -574,7 +573,7 @@ export function matchPath(pathname: string): PageMatch {
if (second === undefined) return { kind: "people-overview" }
if (third === undefined) {
if (second === "soci") return { kind: "people-soci" }
if (second === "receipts") return { kind: "people-receipts" }
if (second === "fees") return { kind: "people-fees" }
if (second === "admins") return { kind: "people-admins" }
if (second === "teams") return { kind: "people-teams" }
if (second === "census") return { kind: "people-census" }
Expand Down Expand Up @@ -658,7 +657,7 @@ export function serviceFor(match: PageMatch): Service {
case "people-person":
case "people-soci":
case "people-socio":
case "people-receipts":
case "people-fees":
case "people-admins":
case "people-teams":
case "people-team":
Expand Down Expand Up @@ -725,8 +724,8 @@ export function sectionFor(match: PageMatch): Section | null {
case "people-soci":
case "people-socio":
return section(people, "soci")
case "people-receipts":
return section(people, "receipts")
case "people-fees":
return section(people, "fees")
case "people-admins":
return section(people, "admins")
case "people-teams":
Expand Down Expand Up @@ -824,10 +823,14 @@ export function documentTitle(match: PageMatch): string {
return current ? `${current.title} - ${service.title} - PoliNetwork Admin` : `${service.title} - PoliNetwork Admin`
}

/** Counts that mark a service and one of its sections: open reports, documents waiting for the user's signature. */
/**
* Counts that mark a service or one of its sections: open reports, documents waiting for the user's signature, and
* transfer receipts waiting for review in this fee year.
*/
export type PendingCounts = {
reports: Promise<number | null>
signatures: Promise<number | null>
fees: Promise<number | null>
}

const NO_COUNT: Promise<number | null> = Promise.resolve(null)
Expand All @@ -850,5 +853,6 @@ export function sectionPending(
): Promise<number | null> {
if (serviceId === "reports" && sectionId === "open") return pending.reports
if (serviceId === "esign" && sectionId === "inbox") return pending.signatures
if (serviceId === "people" && sectionId === "fees") return pending.fees
return NO_COUNT
}
6 changes: 6 additions & 0 deletions src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ export const env = createEnv({
AGENT_PERMISSIONS: z.string().optional(),
/** Development only: the agent-mode user's person record in the People sample data. */
AGENT_PERSON: z.string().default("P-0007"),
/**
* Development only: the member number of the socio the agent-mode user is in My area, or `none`. In the sample
* register 7 has a rejected receipt to upload again, 4 one waiting for review, 1 has paid, 34 is exempt and 41's
* fee isn't open yet.
*/
AGENT_SOCIO: z.string().default("7"),
/**
* Development only: a bearer token agent mode sends to the backend instead of none, so pages read a real local
* backend (e.g. one minted by the backend's dev IdP shim). Permissions then come from the backend's `me.access`.
Expand Down
Loading
Loading