@htilabs/platform-common-models 0.85.0 → 0.86.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -16,6 +16,18 @@ Package exports are organized into a public root API and a small number of
16
16
  dedicated subpaths (`/validation`, `/cvcs`) — consult `package.json` for the
17
17
  authoritative `exports` map.
18
18
 
19
+ ## 0.86.0 — a program can record which team or teams work for it (`teamId`, `teamIds` on `organizations.programs[]`; additive)
20
+
21
+ **What a person gets.** Nothing on screen yet: this lets a program carry its link to the team (or teams) that work for it, so the Admin Hub can build the prototype's "Set up as a team", the Add-team "Which program does this team work for?" and the team profile's "Link" (platform-prototype `src/agencyhub.jsx` `roElevateProgramToTeam`, `linkTeamToProgramH`). Until now the program fragment did not declare the link, so the Platform's program writer (which keeps only the fragment's keys) erased a link at the next program edit.
22
+
23
+ **What is stored.** Two optional keys on a program row, the UDD Program object's `team_id` · `team_ids`, stored camelCase like the rest of the row:
24
+ - `teamId`: the first team linked (a `teams._id` as a string);
25
+ - `teamIds`: every team linked, in the order they were linked (one program may have several teams, Crysta 2026-10-18).
26
+
27
+ Both absent means no team is linked, which is every row stored today. The Mongoose fragment declares `teamIds` with `default: undefined`, so a row with no link stores nothing (never an empty list). `OrganizationProgramRowSchema` reads both; a value of the wrong kind reads as not on record and never fails the row; `ORGANIZATION_PROGRAM_ROW_KEYS` lists both, last. A snake_case `team_ids` is still dropped.
28
+
29
+ **For a consumer that bumps to this version.** No change is needed: nothing reads the link yet. Thread and PAVE keep the stored rows as they are; the Platform's program writer starts keeping the link once it bumps.
30
+
19
31
  ## 0.84.0 — the organization merge is judged against the one registry and moves the duplicate's programs; the caller says who is merging (`./org-merge`; one new required argument)
20
32
 
21
33
  **What a person gets.** An HTI Labs steward can now merge the pairs that matter: an organization added in the Admin Hub (as the copy or as the one kept), and a copy in one agency's list into another agency's or a member's own organization. Until now the shared rules refused all of these, because they asked whether the agency whose list the copy is in could see the kept row. "Organizations should never sit inside one agency's own list" (Crysta, 2026-11-11): the registry is one platform-wide list, and an agency's list never blocks a registry action.
package/dist/index.cjs CHANGED
@@ -21216,7 +21216,18 @@ var organizationProgramSchemaDefinition = {
21216
21216
  */
21217
21217
  locationId: { type: String, required: false },
21218
21218
  /** The editor's notes. */
21219
- notes: { type: String, required: false }
21219
+ notes: { type: String, required: false },
21220
+ /**
21221
+ * The first team that works for the program (`teams._id` as a string;
21222
+ * canon `team_id`). Equal to `teamIds[0]` when both are written.
21223
+ */
21224
+ teamId: { type: String, required: false },
21225
+ /**
21226
+ * Every team that works for the program (canon `team_ids`; one program may
21227
+ * have several teams). `default: undefined`, so a row with no link stores
21228
+ * nothing and reads as absent, never as an empty list.
21229
+ */
21230
+ teamIds: { type: [String], required: false, default: void 0 }
21220
21231
  };
21221
21232
  function buildOrganizationProgramSchema() {
21222
21233
  return new import_mongoose13.Schema(organizationProgramSchemaDefinition, { _id: false });