@cyc-seattle/platform 1.33.0 → 1.34.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.
@@ -47,7 +47,10 @@ export declare class Context {
47
47
  costAccount(type: CostType): Id | undefined;
48
48
  warn(code: string, message: string, key?: string): void;
49
49
  book(entry: EntryInput): void;
50
- /** An entry's function: the line's if set, otherwise its account's default, otherwise by cost center. */
50
+ /**
51
+ * An entry's function: the line's if set. Otherwise a cost charged to a program is `program`
52
+ * (cyc-seattle/platform#144), and anything else takes its account's default.
53
+ */
51
54
  functionFor(accountId: Id, explicit: AccountFunction | null | undefined, costCenter: CostCenterType): AccountFunction | null;
52
55
  accountType(accountId: Id): Account["type"] | undefined;
53
56
  /** Whether `accountId` is `ancestorId` or under it. */
@@ -57,18 +57,19 @@ export class Context {
57
57
  return;
58
58
  this.entries.push({ stage: "direct", mtdc_share: 1, wages: false, ...entry });
59
59
  }
60
- /** An entry's function: the line's if set, otherwise its account's default, otherwise by cost center. */
60
+ /**
61
+ * An entry's function: the line's if set. Otherwise a cost charged to a program is `program`
62
+ * (cyc-seattle/platform#144), and anything else takes its account's default.
63
+ */
61
64
  functionFor(accountId, explicit, costCenter) {
62
65
  if (explicit != null)
63
66
  return explicit;
64
67
  const account = this.accounts.get(accountId);
65
- if (account?.default_function != null)
66
- return account.default_function;
67
68
  if (account?.type === "revenue")
68
- return null;
69
- return costCenter === "offering" || costCenter === "product" || costCenter === "program_area"
70
- ? "program"
71
- : "management";
69
+ return account.default_function ?? null;
70
+ if (costCenter === "offering" || costCenter === "product" || costCenter === "program_area")
71
+ return "program";
72
+ return account?.default_function ?? "management";
72
73
  }
73
74
  accountType(accountId) {
74
75
  return this.accounts.get(accountId)?.type;
@@ -65,6 +65,7 @@ export interface Schema {
65
65
  qualifications: Qualifications[];
66
66
  registrations: Registrations[];
67
67
  resource_kinds: ResourceKinds[];
68
+ schools: Schools[];
68
69
  sync_runs: SyncRuns[];
69
70
  sync_tasks: SyncTasks[];
70
71
  version_set_members: VersionSetMembers[];
@@ -444,6 +445,7 @@ export interface People {
444
445
  contact_for: (string | Contacts)[];
445
446
  /** Every email and phone known for this person. */
446
447
  contact_point_links: (string | ContactPoints)[];
448
+ /** The school they sail for, in their own words, when it isn't on the list. Blank when a school is picked above. */
447
449
  school: string | null;
448
450
  /** What this adult last answered before households held the answer. Kept for reference only: the household's answer counts now. */
449
451
  share_contact: boolean | null;
@@ -453,6 +455,8 @@ export interface People {
453
455
  display_name: string | null;
454
456
  /** Set by the Clubspot sync from the person's parents and children, so change those instead. */
455
457
  household_id: string | Households | null;
458
+ /** The school they sail for, which may not be the one they attend. Blank, with a school in their own words below, means a school not on the list. */
459
+ school_id: string | Schools | null;
456
460
  /** The person's own Directus login, if they have one. Usually empty. */
457
461
  directus_user_id: string | null;
458
462
  }
@@ -699,7 +703,7 @@ export interface PlanResources {
699
703
  /** Set for a rental, whose cost is left out of modified total direct costs (MTDC). */
700
704
  excluded_from_mtdc: boolean;
701
705
  }
702
- /** Each cost and revenue line in a saved Financial Plan's P&L. Worked out when it was saved, and never changed. */
706
+ /** Each cost and revenue line in a Financial Plan's P&L. A draft's are worked out again a moment after each change to it, and a saved one's when it's saved, and then never change. */
703
707
  export interface PlanResultLines {
704
708
  id: string;
705
709
  cost_center_type: "offering" | "product" | "program_area" | "pool" | "org";
@@ -719,7 +723,7 @@ export interface PlanResultLines {
719
723
  /** What the line is, in plain words, such as G&A share: Payroll tax. */
720
724
  line_name: string | null;
721
725
  }
722
- /** A saved Financial Plan's P&L for each offering, product, and program area. Worked out when it was saved, and never changed. */
726
+ /** A Financial Plan's P&L for each offering, product, and program area. A draft's are worked out again a moment after each change to it, and a saved one's when it's saved, and then never change. */
723
727
  export interface PlanResultPnl {
724
728
  id: string;
725
729
  level: "offering" | "product" | "program_area";
@@ -741,7 +745,7 @@ export interface PlanResultPnl {
741
745
  /** The plan in the Financial Plan that holds what it's charged to. */
742
746
  version_set_member_id: string | VersionSetMembers | null;
743
747
  }
744
- /** Each salaried position's pay for the year, in a saved Financial Plan. Worked out when it was saved, and never changed. */
748
+ /** Each salaried position's pay for the year, in a Financial Plan. A draft's are worked out again a moment after each change to it, and a saved one's when it's saved, and then never change. */
745
749
  export interface PlanResultPositions {
746
750
  id: string;
747
751
  position_key: string;
@@ -770,7 +774,7 @@ export interface PlanResultPositions {
770
774
  /** Dates this position coaches two or more groups at once. */
771
775
  double_booked_dates: number | null;
772
776
  }
773
- /** What the P&L warned about when a Financial Plan was saved. Worked out when it was saved, and never changed. */
777
+ /** What a Financial Plan's P&L warns about. A draft's are worked out again a moment after each change to it, and a saved one's when it's saved, and then never change. */
774
778
  export interface PlanResultWarnings {
775
779
  id: string;
776
780
  /** The kind of warning. */
@@ -780,7 +784,7 @@ export interface PlanResultWarnings {
780
784
  /** The Financial Plan these results are for. */
781
785
  version_set_id: string | VersionSets;
782
786
  }
783
- /** A saved Financial Plan's totals for the organization. Worked out when it was saved, and never changed. */
787
+ /** A Financial Plan's totals for the organization. A draft's are worked out again a moment after each change to it, and a saved one's when it's saved, and then never change. */
784
788
  export interface PlanResults {
785
789
  id: string;
786
790
  calculated_at: string;
@@ -1010,6 +1014,14 @@ export interface ResourceKinds {
1010
1014
  id: string;
1011
1015
  name: string;
1012
1016
  }
1017
+ /** The schools a sailor can sail for, which families pick from. A school's other names match what families typed on their Clubspot forms. */
1018
+ export interface Schools {
1019
+ id: string;
1020
+ /** The school's name, as families see it in the list. */
1021
+ name: string;
1022
+ /** Other ways families write this school on their Clubspot forms. An answer matching the name or one of these, ignoring capitals and punctuation and counting a run of spaces as one, is this school. Anything else is kept as their own words. */
1023
+ aliases: string[] | null;
1024
+ }
1013
1025
  /** One row each time a sync runs. */
1014
1026
  export interface SyncRuns {
1015
1027
  id: string;
@@ -1052,18 +1064,18 @@ export interface VersionSetMembers {
1052
1064
  /** The plan's copy in this Financial Plan. It's in no other Financial Plan. */
1053
1065
  version_id: string | PlanVersions;
1054
1066
  }
1055
- /** The organization's plan for a year: one Operations Plan, and a Program Plan for any of the program areas, with the P&L they make together. Change its plans while it's a draft. Saving it saves them all, and then it never changes, apart from its note. Pick a parent when you add one, and its plans are copied in. */
1067
+ /** The organization's plan for a year: one Operations Plan, and a Program Plan for any of the program areas, with the P&L they make together. Change its plans while it's a draft. Its P&L is worked out again a moment after each change. Saving it saves them all, and then it never changes, apart from its name and note. Pick a parent when you add one, and its plans are copied in. */
1056
1068
  export interface VersionSets {
1057
1069
  id: string;
1058
1070
  /** The organization the Financial Plan is for. */
1059
1071
  organization_id: string | Organizations;
1060
1072
  /** The year the Financial Plan is for. */
1061
1073
  fiscal_year: number;
1062
- /** Such as 2027 budget as adopted. */
1074
+ /** Such as 2027 budget as adopted. You can change it after it's saved. */
1063
1075
  name: string;
1064
1076
  /** What it was for, such as "Reviewed with the board". You can change it after it's saved. */
1065
1077
  message: string | null;
1066
- /** Set it to saved to save the Financial Plan and all its plans. A saved Financial Plan never changes, apart from its note. Set a saved one to active to make it the one its organization runs for the year, which sets the one active before it back to saved. */
1078
+ /** Set it to saved to save the Financial Plan and all its plans. A saved Financial Plan never changes, apart from its name and note. Set a saved one to active to make it the one its organization runs for the year, which sets the one active before it back to saved. */
1067
1079
  status: "draft" | "saved" | "active";
1068
1080
  /** The Financial Plan this one started as a copy of. Pick it when you add this one, and its plans are copied in. */
1069
1081
  parent_id: string | VersionSets | null;
@@ -1075,6 +1087,6 @@ export interface VersionSets {
1075
1087
  platform_version: string | null;
1076
1088
  /** Each plan in the Financial Plan. Add or remove one only while it's a draft. */
1077
1089
  members: (string | VersionSetMembers)[];
1078
- /** What the organization's P&L showed when it was saved, worked out a moment after. A Financial Plan with none means working them out failed, and an admin can fill them in. */
1090
+ /** The organization's P&L. A draft's is worked out again a moment after each change to it. A saved one's is what it showed when it was saved, worked out a moment after. One with none means working it out failed, and the logs say why. An admin can fill in a saved one's. */
1079
1091
  results: (string | PlanResults)[];
1080
1092
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cyc-seattle/platform",
3
- "version": "1.33.0",
3
+ "version": "1.34.0",
4
4
  "description": "Pulumi components for CYC's shared Google Cloud platform: WebService, the platform outputs reader, and the stacks that build the platform",
5
5
  "author": "CYC Community Sailing Center",
6
6
  "license": "Apache-2.0",
@@ -88,6 +88,7 @@
88
88
  "google-spreadsheet": "^5.3.0",
89
89
  "googleapis": "^144.0.0",
90
90
  "js-yaml": "^5.4.3",
91
+ "libphonenumber-js": "^1.13.15",
91
92
  "luxon": "^3.7.2",
92
93
  "prettier": "^3.9.10",
93
94
  "typescript": "~5.9.3",