import { text, int, bool, date, affiliationRole, linksChild, blocksChild } from "./columns.js"; /* ── People ──────────────────────────────────────────────────── */ export const people = { key: "people", table: "people", idColumn: "id", idKind: "slug", concurrency: "updated_at", list: { columns: [ "id", "display_name", "sort_name", "tagline", "locality", "is_published", "is_listed", "updated_at", ], filters: ["is_published", "is_listed"], search: ["display_name", "sort_name", "id"], order: "sort_name, display_name", }, columns: [ text("display_name", { required: true }), text("sort_name"), text("pronouns"), text("tagline"), text("photo"), text("bio"), text("primary_org_id"), text("public_email"), text("public_phone"), text("locality"), text("state_code"), text("country"), text("location_label"), bool("is_published"), bool("is_listed"), ], extensions: [ { key: "private", table: "person_private", idColumn: "person_id", readRole: "editor", // viewers don't see birth dates, addresses, phones touch: true, // has its own updated_at with no trigger behind it columns: [ date("birth_date"), text("private_email"), text("private_phone"), text("address"), text("notes"), ], }, ], children: [ linksChild("person"), blocksChild("person"), { key: "affiliations", table: "affiliations", owner: { column: "person_id" }, // sort_order is where this person sits on that team, so it // belongs to the team's editor. reindex: false stops this // form renumbering by row position; declaring the column // keeps the team's value intact across a save here. reindex: false, order: "org_id, team_id, sort_order", columns: [ text("org_id", { required: true }), text("team_id"), ...affiliationRole, int("sort_order"), ], }, { key: "person_awards", table: "person_awards", owner: { column: "person_id" }, order: "awarded_on", columns: [ text("award_id", { required: true }), text("event_id"), date("awarded_on"), text("citation"), bool("is_public"), ], }, ], };