Repository navigation
Labels
peoplePeople: Group Admins, Capo Admins, Teams, Soci and census (see the People roadmap)People: Group Admins, Capo Admins, Teams, Soci and census (see the People roadmap)
Description
Goal
The Libro Soci in the backend: one record per admission, keyed on the Microsoft 365 account and the member number, with the data the association must keep. Admission moves here from azure.members.create. Phase 2: PoliNetworkOrg/admin#144, roadmap PoliNetworkOrg/admin#146. Design: docs/people/soci.md (PoliNetworkOrg/admin#154). Read it first; this issue only lists the backend's part.
Data (soci_ prefix, new src/soci/)
soci_members: never deleted. Fields:
number: unique, never reused.entra_object_id: unique.- Snapshots of the mailbox and display name, kept after the account is deleted.
- Legal first and last name; optional
alias. codice_fiscale: format, check digit and omocodia validated; at most one active record per code.birth_date,birth_place.- Residence: street, postal code, city, province (Italy only), country.
admitted_on;ended_on,end_reason,end_note(set by the lapse issue).- Account state:
active|pending_deletion|deleted. - Created / updated by and at.
soci_activity: append-only history.
Member numbers:
- A number is free only if no record has ever held it and no Microsoft 365 user has it as
employeeId. - Keep
serializeMemberWriteand the pending-number cache for the Entra side.
The register starts empty: nothing is imported.
Procedures (soci.*)
| Procedure | Policy |
|---|---|
members.list, members.get (record + activity), members.unregistered (Soci group members without a record, with their employeeId and createdDateTime) |
admin:access + soci:read |
members.admit |
admin:access + soci:write |
members.register (an account already in Soci; personal fields optional) |
admin:access + soci:write |
members.update |
admin:access + soci:write |
members.setNumber (Entra employeeId + record, optional email as today) |
admin:access + soci:write |
members.admitruns today's create workflow: user withemployeeId, licences, Soci group, cleanup on failure, welcome email to the typed address (not stored). Then it writes the record with every field required except the alias. If the record can't be written, it deletes the account.members.listreports mismatches: an active record whose account isn't in Soci, or an ended one whose account still is.- Directory (Graph + mock):
- Read
createdDateTime. - Remove a user from Soci, add an existing user back, and delete a user, for the lapse issue.
- Read
- Retire: once the dashboard has switched ([People · Phase 2] Soci › Register and Admit socio admin#155), remove
azure.members.createandazure.members.setAssocNumber. - Export types: the npm package exports
soci.*'s types.
Done when
- Tables, migration, procedures and policies exist, and the contract types are exported.
- Tests cover:
- number reuse refused, including numbers from ended records and Entra-only numbers;
- codice fiscale validation, and two active records with one code refused;
- a failed record write deleting the new account;
registerfor an existing Soci account;- mismatches.
Reacted by coderabbitai
Metadata
Metadata
Assignees
Labels
peoplePeople: Group Admins, Capo Admins, Teams, Soci and census (see the People roadmap)People: Group Admins, Capo Admins, Teams, Soci and census (see the People roadmap)
Activity
coderabbitai commentedon Nov 9, 2026
🔗 Related PRs
#95 - feat(people): mirror PoliNetwork Auth roles and Microsoft 365 members [open]
#104 - refactor(people)!: remove Soci, fees, receipts, census and record matching [closed]
📝 Issue Planner
Check the box below or use the
@coderabbitai plancommand to generate an implementation plan and prompts that you can use with your favorite coding assistant.🧪 Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:💬 Have feedback or questions? Drop into our discord!
feat(soci): add the Libro Soci register and admission
feat(soci): add the Libro Soci register and admission (#126)
feat(people)!: add Soci › Register, the socio page and Admit socio (#158