@cyc-seattle/platform 1.54.0 → 1.55.1

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.
@@ -4,11 +4,11 @@ export type Id = string;
4
4
  export type DateString = string;
5
5
  /** A `time`, as `HH:MM` or `HH:MM:SS`. */
6
6
  export type TimeString = string;
7
- /** The columns every version-scoped row carries. */
8
- export interface Versioned {
7
+ /** The columns every row of a plan carries. */
8
+ export interface PlanRow {
9
9
  id: Id;
10
- version_id: Id;
11
- /** Stable across versions; references from other plans use it. */
10
+ plan_id: Id;
11
+ /** Stays the same when a Financial Plan is copied; references from other plans use it. */
12
12
  key: Id;
13
13
  }
14
14
  export type CostCenterType = "offering" | "product" | "program_area" | "pool" | "org";
@@ -94,13 +94,8 @@ export interface Plan {
94
94
  kind: "program_area" | "operations";
95
95
  program_area_id: Id | null;
96
96
  }
97
- /** A plan version. The engine reads only which plan it belongs to. */
98
- export interface PlanVersion {
99
- id: Id;
100
- plan_id: Id;
101
- }
102
97
  export type ActivityKind = "practice" | "regatta" | "clinic" | "travel";
103
- export interface PlanOffering extends Versioned {
98
+ export interface PlanOffering extends PlanRow {
104
99
  product_id: Id;
105
100
  name: string;
106
101
  /** A `plan_terms` key in the Operations Plan, or none. */
@@ -109,23 +104,22 @@ export interface PlanOffering extends Versioned {
109
104
  ends_on: DateString;
110
105
  capacity: number | null;
111
106
  target_enrollment: number | null;
112
- fill_rate: number | null;
113
107
  /** Per kid. */
114
108
  price_cents: number | null;
115
109
  cogs_rate: number | null;
116
110
  note: string | null;
117
111
  }
118
112
  /** A program's settings in a Program Plan: who coaches it, and how many sailors each coach takes. */
119
- export interface PlanProgram extends Versioned {
113
+ export interface PlanProgram extends PlanRow {
120
114
  /** The program's product. */
121
115
  product_id: Id;
122
116
  /** A `plan_staff_levels` key. */
123
117
  staff_level_key: Id | null;
124
118
  sailors_per_coach: number | null;
125
- /** The planner's own words, which only their AI reads. */
126
- rules: string | null;
119
+ /** The planner's short notes, which only their AI reads. */
120
+ notes: string[] | null;
127
121
  }
128
- export interface PlanTrip extends Versioned {
122
+ export interface PlanTrip extends PlanRow {
129
123
  offering_id: Id;
130
124
  name: string;
131
125
  nights: number | null;
@@ -134,7 +128,7 @@ export interface PlanTrip extends Versioned {
134
128
  miles: number | null;
135
129
  }
136
130
  /** One dated activity, or a travel day, as the planner or a scheduling tool entered it. */
137
- export interface PlanActivity extends Versioned {
131
+ export interface PlanActivity extends PlanRow {
138
132
  offering_id: Id;
139
133
  /** The trip a travel day belongs to. */
140
134
  trip_id: Id | null;
@@ -150,12 +144,12 @@ export interface PlanActivity extends Versioned {
150
144
  block_id: Id | null;
151
145
  }
152
146
  /** Activities on one date that share their staff and boats. */
153
- export interface PlanActivityBlock extends Versioned {
147
+ export interface PlanActivityBlock extends PlanRow {
154
148
  date: DateString;
155
149
  name: string;
156
150
  }
157
151
  /** Staff on a block: a number at one staff level, or a salaried position. */
158
- export interface PlanBlockStaff extends Versioned {
152
+ export interface PlanBlockStaff extends PlanRow {
159
153
  block_id: Id;
160
154
  /** A `plan_staff_levels` key, for hourly or volunteer staff. */
161
155
  staff_level_key: Id | null;
@@ -166,14 +160,14 @@ export interface PlanBlockStaff extends Versioned {
166
160
  pay: "salary" | "hourly" | null;
167
161
  }
168
162
  /** Boats of one class on a block: the organization's, the ones it charters, and the ones sailors bring. */
169
- export interface PlanBlockBoats extends Versioned {
163
+ export interface PlanBlockBoats extends PlanRow {
170
164
  block_id: Id;
171
165
  boat_class_id: Id;
172
166
  count: number;
173
167
  sailor_owned: number | null;
174
168
  chartered?: number | null;
175
169
  }
176
- export interface PlanLaborLine extends Versioned {
170
+ export interface PlanLaborLine extends PlanRow {
177
171
  name: string;
178
172
  cost_center_type: CostCenterType;
179
173
  cost_center_key: Id | null;
@@ -184,7 +178,7 @@ export interface PlanLaborLine extends Versioned {
184
178
  function: AccountFunction | null;
185
179
  note: string | null;
186
180
  }
187
- export interface PlanBudgetLine extends Versioned {
181
+ export interface PlanBudgetLine extends PlanRow {
188
182
  name: string;
189
183
  account_id: Id;
190
184
  function: AccountFunction | null;
@@ -200,7 +194,7 @@ export interface PlanBudgetLine extends Versioned {
200
194
  * Something lasting the Operations Plan means to buy, ranked by `sort` with the most needed first.
201
195
  * Its account is an asset account.
202
196
  */
203
- export interface PlanCapitalItem extends Versioned {
197
+ export interface PlanCapitalItem extends PlanRow {
204
198
  name: string;
205
199
  amount_cents: number;
206
200
  account_id: Id;
@@ -208,19 +202,19 @@ export interface PlanCapitalItem extends Versioned {
208
202
  note?: string | null;
209
203
  link?: string | null;
210
204
  }
211
- /** The year's rates. An Operations plan version has at most one row. */
212
- export interface PlanRates extends Versioned {
205
+ /** The year's rates. An Operations Plan has at most one row. */
206
+ export interface PlanRates extends PlanRow {
213
207
  /** Employer payroll costs, as a share of wages. */
214
208
  payroll_tax_rate: number | null;
215
209
  lodging_per_night_cents: number | null;
216
210
  mileage_rate_cents: number | null;
217
211
  }
218
- export interface PlanStaffLevel extends Versioned {
212
+ export interface PlanStaffLevel extends PlanRow {
219
213
  name: string;
220
214
  pay_type: "hourly" | "volunteer";
221
215
  hourly_rate_cents: number | null;
222
216
  }
223
- export interface PlanSalariedPosition extends Versioned {
217
+ export interface PlanSalariedPosition extends PlanRow {
224
218
  name: string;
225
219
  annual_salary_cents: number;
226
220
  paid_hours_per_year: number | null;
@@ -231,15 +225,14 @@ export interface PlanSalariedPosition extends Versioned {
231
225
  hourly_coaching_rate_cents?: number | null;
232
226
  }
233
227
  /** Hours charged to a product, or to a program area and shared among its offerings: one of the two. */
234
- export interface PlanSalariedBooking extends Versioned {
228
+ export interface PlanSalariedBooking extends PlanRow {
235
229
  position_id: Id;
236
230
  product_id: Id | null;
237
231
  program_area_id: Id | null;
238
- kind: "management";
239
232
  hours: number;
240
233
  }
241
234
  /** A boat class's rates for the year. */
242
- export interface PlanBoatRate extends Versioned {
235
+ export interface PlanBoatRate extends PlanRow {
243
236
  boat_class_id: Id;
244
237
  /** Upkeep for each hour one of the organization's boats of the class is on the water. */
245
238
  maintenance_per_boat_hour_cents: number;
@@ -249,10 +242,10 @@ export interface PlanBoatRate extends Versioned {
249
242
  charter_per_day_cents?: number | null;
250
243
  }
251
244
  /** A group of shared costs, such as G&A, divided among all of the plan's offerings by MTDC. */
252
- export interface PlanPool extends Versioned {
245
+ export interface PlanPool extends PlanRow {
253
246
  name: string;
254
247
  }
255
- export interface PlanBonusOwner extends Versioned {
248
+ export interface PlanBonusOwner extends PlanRow {
256
249
  role_name: string;
257
250
  bonus_rate: number;
258
251
  account_id: Id;
@@ -261,12 +254,12 @@ export interface PlanBonusOwner extends Versioned {
261
254
  /** A `plan_salaried_positions` key: the position the bonus pays. */
262
255
  position_key?: Id | null;
263
256
  }
264
- export interface PlanBonusOwnerProduct extends Versioned {
257
+ export interface PlanBonusOwnerProduct extends PlanRow {
265
258
  bonus_owner_id: Id;
266
259
  product_id: Id;
267
260
  }
268
261
  /** A charge set as a share of each offering's revenue, such as scholarships or card fees. */
269
- export interface PlanRevenueCharge extends Versioned {
262
+ export interface PlanRevenueCharge extends PlanRow {
270
263
  name: string;
271
264
  /** A share, such as 0.02 for 2%. */
272
265
  rate: number;
@@ -279,17 +272,17 @@ export interface PlanRevenueCharge extends Versioned {
279
272
  note: string | null;
280
273
  }
281
274
  /** A day the organization is closed, such as Labor Day. */
282
- export interface PlanClosedDate extends Versioned {
275
+ export interface PlanClosedDate extends PlanRow {
283
276
  date: DateString;
284
277
  name: string;
285
278
  }
286
279
  /** A planning period in the Operations Plan, such as Summer 2027, which an offering can be in. */
287
- export interface PlanTerm extends Versioned {
280
+ export interface PlanTerm extends PlanRow {
288
281
  name: string;
289
282
  starts_on: DateString;
290
283
  ends_on: DateString;
291
284
  }
292
- /** The catalog plus every row of the plan versions being calculated. */
285
+ /** The catalog plus every row of the plans being calculated. */
293
286
  export interface PlanData {
294
287
  /** The plan year. Fiscal year N ends in calendar year N. */
295
288
  fiscal_year: number;
@@ -304,9 +297,8 @@ export interface PlanData {
304
297
  /** The asset list, with its boats, which the engine counts by class on each day. */
305
298
  assets: Asset[];
306
299
  boats: Boat[];
307
- /** The plans and versions being calculated, so the engine can tell which plan each offering is in. */
300
+ /** The plans being calculated, so the engine can tell which plan each row is in. */
308
301
  plans: Plan[];
309
- plan_versions: PlanVersion[];
310
302
  plan_programs: PlanProgram[];
311
303
  plan_offerings: PlanOffering[];
312
304
  plan_trips: PlanTrip[];
@@ -406,8 +398,8 @@ export interface EngineWarning {
406
398
  category: WarningCategory;
407
399
  /** The key of the row it's about, when there is one. */
408
400
  key?: string;
409
- /** The plan copy it's about, when there is one. */
410
- version_id?: Id;
401
+ /** The plan it's about, when there is one. */
402
+ plan_id?: Id;
411
403
  /** The date it's about, when there is one. */
412
404
  date?: DateString;
413
405
  }