@cyc-seattle/platform 1.35.0 → 1.37.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 +7 -7
- package/dist/outputs.d.ts +2 -0
- package/dist/outputs.js +4 -0
- package/dist/planning/activities.js +1 -1
- package/dist/planning/context.d.ts +6 -1
- package/dist/planning/context.js +21 -3
- package/dist/planning/engine.js +1 -1
- package/dist/planning/staffing.d.ts +27 -27
- package/dist/planning/staffing.js +353 -344
- package/dist/planning/types.d.ts +54 -39
- package/dist/schema/index.d.ts +70 -53
- package/package.json +1 -1
package/dist/planning/types.d.ts
CHANGED
|
@@ -96,27 +96,18 @@ export interface PlanOffering extends Versioned {
|
|
|
96
96
|
fill_rate: number | null;
|
|
97
97
|
/** Per kid. */
|
|
98
98
|
price_cents: number | null;
|
|
99
|
-
sailors_per_coach: number | null;
|
|
100
|
-
min_coaches: number | null;
|
|
101
|
-
/** A `plan_staff_levels` key. */
|
|
102
|
-
coach_level_key: Id | null;
|
|
103
|
-
required_qualification: Id | null;
|
|
104
|
-
ribs_per_coach: number | null;
|
|
105
|
-
byob_share: number | null;
|
|
106
|
-
fixed_coaches: number | null;
|
|
107
|
-
fixed_ribs: number | null;
|
|
108
|
-
fixed_boats: number | null;
|
|
109
99
|
cogs_rate: number | null;
|
|
110
100
|
note: string | null;
|
|
111
|
-
/** A `plan_salaried_positions` key: the salaried coach who takes one coach on each activity. */
|
|
112
|
-
coach_position_key?: Id | null;
|
|
113
|
-
/** How that coach is paid for it: out of the salary (the default), or by the hour at the offering's level. */
|
|
114
|
-
coach_position_pay?: "salary" | "hourly" | null;
|
|
115
101
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
102
|
+
/** A program's settings in a Program Plan: who coaches it, and how many sailors each coach takes. */
|
|
103
|
+
export interface PlanProgram extends Versioned {
|
|
104
|
+
/** The program's product. */
|
|
105
|
+
product_id: Id;
|
|
106
|
+
/** A `plan_staff_levels` key. */
|
|
107
|
+
staff_level_key: Id | null;
|
|
108
|
+
sailors_per_coach: number | null;
|
|
109
|
+
/** The planner's own words, which only their AI reads. */
|
|
110
|
+
rules: string | null;
|
|
120
111
|
}
|
|
121
112
|
export interface PlanTrip extends Versioned {
|
|
122
113
|
offering_id: Id;
|
|
@@ -139,17 +130,41 @@ export interface PlanActivity extends Versioned {
|
|
|
139
130
|
putaway_minutes: number | null;
|
|
140
131
|
kind: ActivityKind;
|
|
141
132
|
uses_boats: boolean;
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
fixed_boats: number | null;
|
|
133
|
+
/** The block it's staffed in, if any. */
|
|
134
|
+
block_id: Id | null;
|
|
145
135
|
}
|
|
146
|
-
|
|
147
|
-
|
|
136
|
+
/** Activities on one date that share their staff, RIBs and boats. */
|
|
137
|
+
export interface PlanActivityBlock extends Versioned {
|
|
138
|
+
date: DateString;
|
|
139
|
+
name: string;
|
|
140
|
+
}
|
|
141
|
+
/** Staff on a block: a number at one staff level, or a salaried position. */
|
|
142
|
+
export interface PlanBlockStaff extends Versioned {
|
|
143
|
+
block_id: Id;
|
|
144
|
+
/** A `plan_staff_levels` key, for hourly or volunteer staff. */
|
|
145
|
+
staff_level_key: Id | null;
|
|
146
|
+
/** A `plan_salaried_positions` key. */
|
|
147
|
+
position_key: Id | null;
|
|
148
|
+
count: number;
|
|
149
|
+
/** How a salaried position is paid for the block: out of its salary (the default), or by the hour at its own rate. */
|
|
150
|
+
pay: "salary" | "hourly" | null;
|
|
151
|
+
}
|
|
152
|
+
/** A resource on a block, such as RIBs. */
|
|
153
|
+
export interface PlanBlockResource extends Versioned {
|
|
154
|
+
block_id: Id;
|
|
148
155
|
/** A `plan_resources` key. */
|
|
149
156
|
resource_key: Id;
|
|
150
157
|
quantity: number;
|
|
158
|
+
/** Hours each is used; empty for the block's time on the water (RIBs) or its paid time (the rest). */
|
|
151
159
|
hours: number | null;
|
|
152
160
|
}
|
|
161
|
+
/** Boats of one class on a block: the organization's, and the ones sailors bring. */
|
|
162
|
+
export interface PlanBlockBoats extends Versioned {
|
|
163
|
+
block_id: Id;
|
|
164
|
+
boat_class_id: Id;
|
|
165
|
+
count: number;
|
|
166
|
+
sailor_owned: number | null;
|
|
167
|
+
}
|
|
153
168
|
export interface PlanLaborLine extends Versioned {
|
|
154
169
|
name: string;
|
|
155
170
|
cost_center_type: CostCenterType;
|
|
@@ -221,18 +236,8 @@ export interface PlanResource extends Versioned {
|
|
|
221
236
|
export interface PlanBoatRate extends Versioned {
|
|
222
237
|
boat_class_id: Id;
|
|
223
238
|
maintenance_per_boat_hour_cents: number;
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
name: string;
|
|
227
|
-
/** `plan_offerings` keys. */
|
|
228
|
-
offering_keys: Id[];
|
|
229
|
-
weekdays: number[] | null;
|
|
230
|
-
starts_on: DateString | null;
|
|
231
|
-
ends_on: DateString | null;
|
|
232
|
-
/** A `plan_staff_levels` id. */
|
|
233
|
-
coach_level_id: Id | null;
|
|
234
|
-
/** `plan_salaried_positions` keys. */
|
|
235
|
-
salaried_positions: Id[] | null;
|
|
239
|
+
/** How many boats of the class the organization has. */
|
|
240
|
+
quantity: number | null;
|
|
236
241
|
}
|
|
237
242
|
/** A group of shared costs, such as G&A, divided among all of the plan year's offerings by MTDC. */
|
|
238
243
|
export interface PlanPool extends Versioned {
|
|
@@ -286,11 +291,14 @@ export interface PlanData {
|
|
|
286
291
|
/** The plans and versions being calculated, so the engine can tell which plan each offering is in. */
|
|
287
292
|
plans: Plan[];
|
|
288
293
|
plan_versions: PlanVersion[];
|
|
294
|
+
plan_programs: PlanProgram[];
|
|
289
295
|
plan_offerings: PlanOffering[];
|
|
290
|
-
plan_offering_boat_classes: PlanOfferingBoatClass[];
|
|
291
296
|
plan_trips: PlanTrip[];
|
|
292
297
|
plan_activities: PlanActivity[];
|
|
293
|
-
|
|
298
|
+
plan_activity_blocks: PlanActivityBlock[];
|
|
299
|
+
plan_block_staff: PlanBlockStaff[];
|
|
300
|
+
plan_block_resources: PlanBlockResource[];
|
|
301
|
+
plan_block_boats: PlanBlockBoats[];
|
|
294
302
|
plan_labor_lines: PlanLaborLine[];
|
|
295
303
|
plan_budget_lines: PlanBudgetLine[];
|
|
296
304
|
plan_rates: PlanRates[];
|
|
@@ -300,7 +308,6 @@ export interface PlanData {
|
|
|
300
308
|
plan_salaried_bookings: PlanSalariedBooking[];
|
|
301
309
|
plan_resources: PlanResource[];
|
|
302
310
|
plan_boat_rates: PlanBoatRate[];
|
|
303
|
-
plan_activity_block_rules: PlanActivityBlockRule[];
|
|
304
311
|
plan_pools: PlanPool[];
|
|
305
312
|
plan_bonus_owners: PlanBonusOwner[];
|
|
306
313
|
plan_bonus_owner_products: PlanBonusOwnerProduct[];
|
|
@@ -354,16 +361,24 @@ export interface ComputedActivity {
|
|
|
354
361
|
paid_minutes: number;
|
|
355
362
|
on_water_minutes: number;
|
|
356
363
|
uses_boats: boolean;
|
|
364
|
+
/** Its share of its block's staff, RIBs and boats, by its sailors. */
|
|
357
365
|
coaches: number;
|
|
358
366
|
ribs: number;
|
|
359
367
|
boats: number;
|
|
360
|
-
|
|
368
|
+
block_id: Id | null;
|
|
361
369
|
}
|
|
370
|
+
/** `allocation` when the blocks break a limit or a closed day; `data` when a row is missing or wrong. */
|
|
371
|
+
export type WarningCategory = "allocation" | "data";
|
|
362
372
|
export interface EngineWarning {
|
|
363
373
|
code: string;
|
|
364
374
|
message: string;
|
|
375
|
+
category: WarningCategory;
|
|
365
376
|
/** The key of the row it's about, when there is one. */
|
|
366
377
|
key?: string;
|
|
378
|
+
/** The plan copy it's about, when there is one. */
|
|
379
|
+
version_id?: Id;
|
|
380
|
+
/** The date it's about, when there is one. */
|
|
381
|
+
date?: DateString;
|
|
367
382
|
}
|
|
368
383
|
/**
|
|
369
384
|
* The organization's year: operating revenue pays for operating costs, and fundraising for capital.
|
package/dist/schema/index.d.ts
CHANGED
|
@@ -30,17 +30,19 @@ export interface Schema {
|
|
|
30
30
|
organizations: Organizations[];
|
|
31
31
|
people: People[];
|
|
32
32
|
plan_activities: PlanActivities[];
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
plan_activity_blocks: PlanActivityBlocks[];
|
|
34
|
+
plan_block_boats: PlanBlockBoats[];
|
|
35
|
+
plan_block_resources: PlanBlockResources[];
|
|
36
|
+
plan_block_staff: PlanBlockStaff[];
|
|
35
37
|
plan_boat_rates: PlanBoatRates[];
|
|
36
38
|
plan_bonus_owner_products: PlanBonusOwnerProducts[];
|
|
37
39
|
plan_bonus_owners: PlanBonusOwners[];
|
|
38
40
|
plan_budget_lines: PlanBudgetLines[];
|
|
39
41
|
plan_closed_dates: PlanClosedDates[];
|
|
40
42
|
plan_labor_lines: PlanLaborLines[];
|
|
41
|
-
plan_offering_boat_classes: PlanOfferingBoatClasses[];
|
|
42
43
|
plan_offerings: PlanOfferings[];
|
|
43
44
|
plan_pools: PlanPools[];
|
|
45
|
+
plan_programs: PlanPrograms[];
|
|
44
46
|
plan_rates: PlanRates[];
|
|
45
47
|
plan_resources: PlanResources[];
|
|
46
48
|
plan_result_lines: PlanResultLines[];
|
|
@@ -478,44 +480,65 @@ export interface PlanActivities {
|
|
|
478
480
|
putaway_minutes: number | null;
|
|
479
481
|
kind: "practice" | "regatta" | "clinic" | "travel";
|
|
480
482
|
uses_boats: boolean;
|
|
481
|
-
/**
|
|
482
|
-
|
|
483
|
-
/** Overrides the coach boats the engine works out. */
|
|
484
|
-
fixed_ribs: number | null;
|
|
485
|
-
/** Overrides the boats the engine works out. */
|
|
486
|
-
fixed_boats: number | null;
|
|
483
|
+
/** The block it's staffed in, with the activities it shares staff and boats with. */
|
|
484
|
+
block_id: string | PlanActivityBlocks | null;
|
|
487
485
|
}
|
|
488
|
-
/**
|
|
489
|
-
export interface
|
|
486
|
+
/** Activities on one date that share their staff, RIBs and boats, such as Guppies and Minnows on the morning of July 13. */
|
|
487
|
+
export interface PlanActivityBlocks {
|
|
490
488
|
id: string;
|
|
491
489
|
/** The version this row belongs to. */
|
|
492
490
|
version_id: string | PlanVersions;
|
|
493
491
|
/** Stays the same across versions. Copy it where another row asks for this one's Key. */
|
|
494
492
|
key: string;
|
|
493
|
+
date: string;
|
|
494
|
+
/** Such as Guppies and Minnows, morning. */
|
|
495
495
|
name: string;
|
|
496
|
-
/** The offerings this rule fills: add the Key of each one. */
|
|
497
|
-
offering_keys: string[];
|
|
498
|
-
/** ISO weekdays, 1 for Monday to 7 for Sunday. */
|
|
499
|
-
weekdays: string[] | null;
|
|
500
|
-
starts_on: string | null;
|
|
501
|
-
ends_on: string | null;
|
|
502
|
-
coach_level_id: string | PlanStaffLevels | null;
|
|
503
|
-
/** The salaried positions it books: add the Key of each one. */
|
|
504
|
-
salaried_positions: string[] | null;
|
|
505
496
|
}
|
|
506
|
-
/**
|
|
507
|
-
export interface
|
|
497
|
+
/** Boats of one class a block sails: the organization's, and the ones sailors bring. */
|
|
498
|
+
export interface PlanBlockBoats {
|
|
499
|
+
id: string;
|
|
500
|
+
/** The version this row belongs to. */
|
|
501
|
+
version_id: string | PlanVersions;
|
|
502
|
+
/** Stays the same across versions. Copy it where another row asks for this one's Key. */
|
|
503
|
+
key: string;
|
|
504
|
+
block_id: string | PlanActivityBlocks;
|
|
505
|
+
boat_class_id: string | BoatClasses;
|
|
506
|
+
/** How many of the organization's boats. */
|
|
507
|
+
count: number;
|
|
508
|
+
/** How many boats sailors bring. They cost nothing and don't count against the organization's. */
|
|
509
|
+
sailor_owned: number | null;
|
|
510
|
+
}
|
|
511
|
+
/** RIBs and other equipment a block uses. */
|
|
512
|
+
export interface PlanBlockResources {
|
|
508
513
|
id: string;
|
|
509
514
|
/** The version this row belongs to. */
|
|
510
515
|
version_id: string | PlanVersions;
|
|
511
516
|
/** Stays the same across versions. Copy it where another row asks for this one's Key. */
|
|
512
517
|
key: string;
|
|
513
|
-
|
|
518
|
+
block_id: string | PlanActivityBlocks;
|
|
514
519
|
/** The resource it uses: copy the Key from a resource in the Operations Plan. */
|
|
515
520
|
resource_key: string;
|
|
516
521
|
quantity: string;
|
|
522
|
+
/** Hours each is used. Leave it empty for the block's time on the water (RIBs) or its paid time (other equipment). */
|
|
517
523
|
hours: string | null;
|
|
518
524
|
}
|
|
525
|
+
/** Who coaches a block: a number of staff at one staff level, or a salaried position. */
|
|
526
|
+
export interface PlanBlockStaff {
|
|
527
|
+
id: string;
|
|
528
|
+
/** The version this row belongs to. */
|
|
529
|
+
version_id: string | PlanVersions;
|
|
530
|
+
/** Stays the same across versions. Copy it where another row asks for this one's Key. */
|
|
531
|
+
key: string;
|
|
532
|
+
block_id: string | PlanActivityBlocks;
|
|
533
|
+
/** For staff at a staff level: copy the Key from a staff level in the Operations Plan. Leave it empty for a salaried position. */
|
|
534
|
+
staff_level_key: string | null;
|
|
535
|
+
/** For a salaried position: copy the Key from a salaried position in the Operations Plan. Leave it empty for staff at a staff level. */
|
|
536
|
+
position_key: string | null;
|
|
537
|
+
/** How many. A salaried position is 1. */
|
|
538
|
+
count: number;
|
|
539
|
+
/** For a salaried position: out of their salary, or by the hour at their own hourly rate, on top of it. */
|
|
540
|
+
pay: "salary" | "hourly" | null;
|
|
541
|
+
}
|
|
519
542
|
/** What an hour of sailing costs in maintenance, for each boat class. */
|
|
520
543
|
export interface PlanBoatRates {
|
|
521
544
|
id: string;
|
|
@@ -526,6 +549,8 @@ export interface PlanBoatRates {
|
|
|
526
549
|
boat_class_id: string | BoatClasses;
|
|
527
550
|
/** In cents: 12500 is $125.00. */
|
|
528
551
|
maintenance_per_boat_hour_cents: number;
|
|
552
|
+
/** How many boats of the class the organization has. */
|
|
553
|
+
quantity: number | null;
|
|
529
554
|
}
|
|
530
555
|
/** The products a bonus owner owns. */
|
|
531
556
|
export interface PlanBonusOwnerProducts {
|
|
@@ -602,18 +627,6 @@ export interface PlanLaborLines {
|
|
|
602
627
|
function: "program" | "management" | "fundraising" | null;
|
|
603
628
|
note: string | null;
|
|
604
629
|
}
|
|
605
|
-
/** The boat classes an offering sails, and each one's share of its sailors. */
|
|
606
|
-
export interface PlanOfferingBoatClasses {
|
|
607
|
-
id: string;
|
|
608
|
-
/** The version this row belongs to. */
|
|
609
|
-
version_id: string | PlanVersions;
|
|
610
|
-
/** Stays the same across versions. Copy it where another row asks for this one's Key. */
|
|
611
|
-
key: string;
|
|
612
|
-
offering_id: string | PlanOfferings;
|
|
613
|
-
boat_class_id: string | BoatClasses;
|
|
614
|
-
/** This boat class's share of the offering's sailors. 0.5 means 50%. */
|
|
615
|
-
share: string;
|
|
616
|
-
}
|
|
617
630
|
/** A product sold for a period, such as a season or a week. */
|
|
618
631
|
export interface PlanOfferings {
|
|
619
632
|
id: string;
|
|
@@ -635,27 +648,9 @@ export interface PlanOfferings {
|
|
|
635
648
|
fill_rate: string | null;
|
|
636
649
|
/** Per kid. In cents: 12500 is $125.00. */
|
|
637
650
|
price_cents: number | null;
|
|
638
|
-
sailors_per_coach: string | null;
|
|
639
|
-
min_coaches: number | null;
|
|
640
|
-
/** The coach level: copy the Key from a staff level in the Operations Plan. */
|
|
641
|
-
coach_level_key: string | null;
|
|
642
|
-
required_qualification: string | Qualifications | null;
|
|
643
|
-
ribs_per_coach: string | null;
|
|
644
|
-
/** The share of sailors who bring their own boat. 0.25 means 25%. */
|
|
645
|
-
byob_share: string | null;
|
|
646
|
-
/** Overrides the coaches the engine works out. */
|
|
647
|
-
fixed_coaches: number | null;
|
|
648
|
-
/** Overrides the coach boats the engine works out. */
|
|
649
|
-
fixed_ribs: number | null;
|
|
650
|
-
/** Overrides the boats the engine works out. */
|
|
651
|
-
fixed_boats: number | null;
|
|
652
651
|
/** Cost of goods sold, as a share of revenue. 0.1 means 10%. */
|
|
653
652
|
cogs_rate: string | null;
|
|
654
653
|
note: string | null;
|
|
655
|
-
/** A salaried coach who coaches every practice: copy the Key from a salaried position in the Operations Plan. */
|
|
656
|
-
coach_position_key: string | null;
|
|
657
|
-
/** Out of their salary, or by the hour at the offering's coach level, on top of their salary. */
|
|
658
|
-
coach_position_pay: "salary" | "hourly" | null;
|
|
659
654
|
}
|
|
660
655
|
/** Shared costs no single offering owns, such as G&A, divided among the year's offerings by MTDC. */
|
|
661
656
|
export interface PlanPools {
|
|
@@ -666,6 +661,22 @@ export interface PlanPools {
|
|
|
666
661
|
key: string;
|
|
667
662
|
name: string;
|
|
668
663
|
}
|
|
664
|
+
/** A program's settings in a Program Plan: the staff level that coaches it, how many sailors each coach can take, and its rules. */
|
|
665
|
+
export interface PlanPrograms {
|
|
666
|
+
id: string;
|
|
667
|
+
/** The version this row belongs to. */
|
|
668
|
+
version_id: string | PlanVersions;
|
|
669
|
+
/** Stays the same across versions. Copy it where another row asks for this one's Key. */
|
|
670
|
+
key: string;
|
|
671
|
+
/** The program. */
|
|
672
|
+
product_id: string | Products;
|
|
673
|
+
/** The staff level that coaches it: copy the Key from a staff level in the Operations Plan. */
|
|
674
|
+
staff_level_key: string | null;
|
|
675
|
+
/** How many sailors one coach at its staff level can safely take. */
|
|
676
|
+
sailors_per_coach: string | null;
|
|
677
|
+
/** What you want for this program that its numbers don't capture, for your AI to follow. For example: if there are more than 12 Guppies, add a Junior Instructor. */
|
|
678
|
+
rules: string | null;
|
|
679
|
+
}
|
|
669
680
|
/** The year's rates. One row at most in each copy. */
|
|
670
681
|
export interface PlanRates {
|
|
671
682
|
id: string;
|
|
@@ -783,6 +794,12 @@ export interface PlanResultWarnings {
|
|
|
783
794
|
subject_key: string | null;
|
|
784
795
|
/** The Financial Plan these results are for. */
|
|
785
796
|
version_set_id: string | VersionSets;
|
|
797
|
+
/** The plan in the Financial Plan it's about. */
|
|
798
|
+
version_set_member_id: string | VersionSetMembers | null;
|
|
799
|
+
/** The date it's about. */
|
|
800
|
+
date: string | null;
|
|
801
|
+
/** Allocation: the blocks break a limit, or run on a closed day. Data: a row is missing or wrong. */
|
|
802
|
+
category: "allocation" | "data" | null;
|
|
786
803
|
}
|
|
787
804
|
/** 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. */
|
|
788
805
|
export interface PlanResults {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyc-seattle/platform",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.37.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",
|