@camphoric/camphoric-event-lark 0.0.0-stage → 1.0.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.
Files changed (96) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/LICENSE +21 -0
  3. package/README.md +92 -2
  4. package/dist/camperAdminAttributes.d.ts +190 -0
  5. package/dist/camperAdminAttributes.js +204 -0
  6. package/dist/camperMeals.d.ts +41 -0
  7. package/dist/camperMeals.js +81 -0
  8. package/dist/camperSchema.d.ts +240 -0
  9. package/dist/camperSchema.js +273 -0
  10. package/dist/confirmationEmailTemplate.d.ts +2 -0
  11. package/dist/confirmationEmailTemplate.js +74 -0
  12. package/dist/confirmationPageTemplate.d.ts +2 -0
  13. package/dist/confirmationPageTemplate.js +34 -0
  14. package/dist/countries.d.ts +2 -0
  15. package/dist/countries.js +248 -0
  16. package/dist/dates.d.ts +9 -0
  17. package/dist/dates.js +33 -0
  18. package/dist/index.d.ts +77 -0
  19. package/dist/index.js +88 -0
  20. package/dist/lodgings.d.ts +2168 -0
  21. package/dist/lodgings.js +435 -0
  22. package/dist/organization.d.ts +13 -0
  23. package/dist/organization.js +12 -0
  24. package/dist/packagePath.d.ts +7 -0
  25. package/dist/packagePath.js +19 -0
  26. package/dist/preSubmitTemplate.d.ts +2 -0
  27. package/dist/preSubmitTemplate.js +4 -0
  28. package/dist/pricing/camperPricingLogic.d.ts +75 -0
  29. package/dist/pricing/camperPricingLogic.js +278 -0
  30. package/dist/pricing/pricing.d.ts +22 -0
  31. package/dist/pricing/pricing.js +22 -0
  32. package/dist/pricing/pricingLists.d.ts +6 -0
  33. package/dist/pricing/pricingLists.js +58 -0
  34. package/dist/pricing/registrationPricingLogic.d.ts +16 -0
  35. package/dist/pricing/registrationPricingLogic.js +14 -0
  36. package/dist/regAdminAttributes.d.ts +2 -0
  37. package/dist/regAdminAttributes.js +1 -0
  38. package/dist/regTemplateVars.d.ts +10 -0
  39. package/dist/regTemplateVars.js +16 -0
  40. package/dist/registrationDepositSchema.d.ts +23 -0
  41. package/dist/registrationDepositSchema.js +43 -0
  42. package/dist/registrationSchema.d.ts +94 -0
  43. package/dist/registrationSchema.js +114 -0
  44. package/dist/registrationTypes.d.ts +23 -0
  45. package/dist/registrationTypes.js +176 -0
  46. package/dist/registrationUISchema.d.ts +82 -0
  47. package/dist/registrationUISchema.js +133 -0
  48. package/dist/reports.d.ts +7 -0
  49. package/dist/reports.js +225 -0
  50. package/dist/testRegistrations.d.ts +2 -0
  51. package/dist/testRegistrations.js +113 -0
  52. package/package.json +60 -4
  53. package/reports/All-Campers.j2 +61 -0
  54. package/reports/Campers--All-Camp-3.j2 +48 -0
  55. package/reports/Campers--By-Reg-Date.j2 +22 -0
  56. package/reports/Campers--By-Zip-Code--For-Carpool-.j2 +32 -0
  57. package/reports/Campers--Confirmation-Email-Info.j2 +103 -0
  58. package/reports/Campers--Early-Arrivals.j2 +41 -0
  59. package/reports/Campers--Email-List-for-All-Campers.j2 +3 -0
  60. package/reports/Campers--Half-Campers.j2 +49 -0
  61. package/reports/Campers--Lodging-by-Alpha.j2 +4 -0
  62. package/reports/Campers--Lodging-by-Lodging.j2 +10 -0
  63. package/reports/Campers--Minors.j2 +24 -0
  64. package/reports/Campers--NOT-Checked-In.j2 +47 -0
  65. package/reports/Campers--Name-Badges.j2 +40 -0
  66. package/reports/Campers--Parking-Exceptions.j2 +15 -0
  67. package/reports/Campers--Parking-Passes.j2 +54 -0
  68. package/reports/Campers--Registration-Payments.j2 +11 -0
  69. package/reports/Campers--Registration-Volunteers.j2 +45 -0
  70. package/reports/Campers--Tent-Tags.j2 +19 -0
  71. package/reports/Community-Care--Campers.j2 +64 -0
  72. package/reports/Crew--Camper-Email-List-by-Crew.j2 +30 -0
  73. package/reports/Crew--Clean--C1.j2 +63 -0
  74. package/reports/Crew--Clean--C2-3.j2 +63 -0
  75. package/reports/Crew--Community-Care.j2 +52 -0
  76. package/reports/Crew--Kitchen--w--Lodging.j2 +33 -0
  77. package/reports/Crew--Managers-and-Others.j2 +52 -0
  78. package/reports/Crew--Office--Camp-1.j2 +52 -0
  79. package/reports/Crew--Office--Camp-2.j2 +53 -0
  80. package/reports/Crew--Office--Camp-3.j2 +53 -0
  81. package/reports/Crew--Setup-and-Teardown.j2 +54 -0
  82. package/reports/Crew--Special-Invites.j2 +24 -0
  83. package/reports/Donation-Report---Lark.j2 +7 -0
  84. package/reports/Kitchen--All-Meal-Tickets.j2 +38 -0
  85. package/reports/Kitchen--Meal-Location-Exceptions.j2 +38 -0
  86. package/reports/Kitchen--Meal-Totals.j2 +34 -0
  87. package/reports/Kitchen--No-Meal-Ticket.j2 +23 -0
  88. package/reports/MWCA-Final-Report.j2 +42 -0
  89. package/reports/Registration--All-reg-workers.j2 +67 -0
  90. package/reports/Registration--Early-Arrivals.j2 +65 -0
  91. package/reports/Registration--First-Half-Arrivals.j2 +64 -0
  92. package/reports/Registration--Late-Arrivals.j2 +46 -0
  93. package/reports/Registration--PayPal-Invoices.j2 +50 -0
  94. package/reports/Registration--Second-Half-Arrivals.j2 +49 -0
  95. package/reports/Registration--Values-for-July-Email.j2 +34 -0
  96. package/reports/Security--Campers.j2 +64 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,15 @@
1
+ # Changelog
2
+
3
+ ## [1.0.1](https://github.com/camphoric/camphoric-event-lark/compare/v1.0.0...v1.0.1) (2026-10-20)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **build:** publish to and install from npm ([125149a](https://github.com/camphoric/camphoric-event-lark/commit/125149a798c48e225129da636133673c776e0ce5))
9
+
10
+ ## 1.0.0 (2026-10-17)
11
+
12
+
13
+ ### Features
14
+
15
+ * **event:** publish Lark Camp as its own package ([f33558c](https://github.com/camphoric/camphoric-event-lark/commit/f33558cc366c893057658e2a992bfc59ae70089b))
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019 Will Wheeler
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,93 @@
1
- # Temporary Holding Version
1
+ # @camphoric/camphoric-event-lark
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Lark Traditional Arts' **Lark Camp**, as a [Camphoric](https://github.com/camphoric/camphoric)
4
+ event: its import object (the registration form, pricing, lodging, emails and reports), its
5
+ organization, its sample registrations, and a script that adds generated registrations to an
6
+ imported event.
7
+
8
+ It satisfies the contract in
9
+ [`@camphoric/camphoric-event-import-spec`](https://github.com/camphoric/camphoric/tree/main/data/packages/event-import-spec),
10
+ and Camphoric's importer (`data/` in the Camphoric repository) installs it from npm and
11
+ imports it.
12
+
13
+ ## Developing
14
+
15
+ ```bash
16
+ npm ci # install
17
+ npm test # unit tests, including the spec's conformance checks
18
+ npm run typecheck
19
+ npm run lint # type-check, then ESLint
20
+ npm run build # compile index.ts to dist/ (what's published)
21
+ scripts/smoke-test-package.sh # pack it, install it, and load it from its build with plain Node
22
+ ```
23
+
24
+ The event's source is TypeScript; the published package is its build (`dist/`) and its report
25
+ templates (`reports/`). The spec is a **peer dependency** (`^1.0.0`), so Camphoric's importer loads
26
+ one copy of it for every event; a spec major this event doesn't follow fails to install rather than
27
+ nesting a second copy. Camphoric's `RELEASE.md` ("What a spec version means") describes how a new
28
+ spec major is rolled out.
29
+
30
+ To add generated registrations to an event imported into a running Camphoric:
31
+
32
+ ```bash
33
+ CAMPHORIC_URL=http://localhost:8000 DJANGO_SUPERUSER_USERNAME=admin DJANGO_SUPERUSER_PASSWORD=admin COUNT=10 npm run bulk
34
+ ```
35
+
36
+ (`addRegistrations.ts` describes its other settings. Each completed registration queues a
37
+ confirmation email, so run it where mail goes to the console, as in local development.)
38
+
39
+ ## End-to-end tests
40
+
41
+ `e2e/` holds Playwright tests of the registration form, using the harness in
42
+ `@camphoric/camphoric-event-import-tools/e2e`. Before they run, a throwaway Camphoric starts
43
+ (the release image and Postgres, in Docker, on a free port), this event is imported into it with
44
+ its registration window open, and afterwards the server is removed.
45
+
46
+ ```bash
47
+ npx playwright install chromium # once
48
+ npm run e2e # needs Docker
49
+ ```
50
+
51
+ Locally the results are listed in the terminal; `npm run e2e -- --reporter=html`, then `npx
52
+ playwright show-report`, gives the HTML report (with traces) that CI uploads.
53
+
54
+ - `CAMPHORIC_IMAGE_TAG` picks the release image's tag (default `latest`, pulled fresh);
55
+ `CAMPHORIC_E2E_IMAGE` names a locally built image instead.
56
+ - `CAMPHORIC_E2E_SERVER_URL`, with `CAMPHORIC_E2E_SERVER_USERNAME` / `_PASSWORD`, imports into
57
+ a running server instead of starting one.
58
+ - Every test, on desktop and mobile Chrome, shares the one imported event, so a registration one
59
+ test completes stays.
60
+ - The `registration` fixture is a page object for the form (fields by label, campers, lodging, the
61
+ price ticker, submitting and paying). The client's markup lives only there, so a change to the
62
+ Camphoric client changes the harness, not these tests.
63
+
64
+ `.github/workflows/e2e.yml` runs them on pull requests, weekly (so a Camphoric release that
65
+ changes the form shows up here), and on demand, where it can pick an image tag.
66
+
67
+ ## Releases
68
+
69
+ Commits follow [Conventional Commits](https://www.conventionalcommits.org/) (`feat:` and `fix:`
70
+ release; `feat!:` is a major). On each push to `main`,
71
+ [release-please](https://github.com/googleapis/release-please) keeps a release PR up to date
72
+ with the version bump and `CHANGELOG.md`. Merging it tags `vX.Y.Z`, creates the GitHub Release,
73
+ and publishes the package to npm. To publish a released tag again, if that failed:
74
+
75
+ ```bash
76
+ gh workflow run release-please.yml -f tag=v1.0.0
77
+ ```
78
+
79
+ The package's settings on npmjs.com list this repository and `release-please.yml` as its GitHub
80
+ Actions trusted publisher, allowed to `npm publish`. npm drops a trusted publisher that hasn't
81
+ published within 2 days of being added; without a matching one, the publish fails with npm's 404
82
+ or `ENEEDAUTH`.
83
+
84
+ ## History
85
+
86
+ This event was developed in the Camphoric repository, under `data/`, until it moved here with its
87
+ history (including its old snapshot tests, removed before the move). Issue and pull request
88
+ numbers in commit messages before the move refer to
89
+ [camphoric/camphoric](https://github.com/camphoric/camphoric).
90
+
91
+ ## License
92
+
93
+ MIT
@@ -0,0 +1,190 @@
1
+ declare const _default: {
2
+ badge_role: {
3
+ data: {
4
+ type: string;
5
+ title: string;
6
+ maxLength: number;
7
+ };
8
+ };
9
+ vehicles: {
10
+ ui: {
11
+ items: {
12
+ "ui:order": string[];
13
+ };
14
+ };
15
+ data: {
16
+ type: string;
17
+ items: {
18
+ type: string;
19
+ properties: {
20
+ make: {
21
+ type: string;
22
+ title: string;
23
+ };
24
+ year: {
25
+ type: string;
26
+ title: string;
27
+ maxLength: number;
28
+ minLength: number;
29
+ };
30
+ color: {
31
+ type: string;
32
+ title: string;
33
+ };
34
+ model: {
35
+ type: string;
36
+ title: string;
37
+ };
38
+ state: {
39
+ type: string;
40
+ title: string;
41
+ default: string;
42
+ maxLength: number;
43
+ minLength: number;
44
+ };
45
+ license: {
46
+ type: string;
47
+ title: string;
48
+ };
49
+ passengers: {
50
+ type: string;
51
+ items: {
52
+ type: string;
53
+ };
54
+ title: string;
55
+ };
56
+ };
57
+ };
58
+ title: string;
59
+ };
60
+ };
61
+ checked_in: {
62
+ ui: {
63
+ "ui:enumNames": {
64
+ false: string;
65
+ true: string;
66
+ };
67
+ };
68
+ data: {
69
+ type: string;
70
+ title: string;
71
+ default: boolean;
72
+ };
73
+ };
74
+ guardian_name: {
75
+ ui: {};
76
+ data: {
77
+ type: string;
78
+ title: string;
79
+ };
80
+ };
81
+ crew_exception: {
82
+ ui: {};
83
+ data: {
84
+ type: string;
85
+ title: string;
86
+ description: string;
87
+ };
88
+ };
89
+ food_trade_only: {
90
+ ui: {
91
+ "ui:enumNames": {
92
+ false: string;
93
+ true: string;
94
+ };
95
+ };
96
+ data: {
97
+ type: string;
98
+ title: string;
99
+ default: boolean;
100
+ };
101
+ };
102
+ precamp_meals_comp: {
103
+ ui: {
104
+ "ui:enumNames": {
105
+ false: string;
106
+ true: string;
107
+ };
108
+ };
109
+ data: {
110
+ type: string;
111
+ title: string;
112
+ default: boolean;
113
+ };
114
+ };
115
+ instructor_meal_rate: {
116
+ ui: {
117
+ "ui:enumNames": {
118
+ false: string;
119
+ true: string;
120
+ };
121
+ };
122
+ data: {
123
+ type: string;
124
+ title: string;
125
+ default: boolean;
126
+ };
127
+ };
128
+ meal_assignment_dinner: {
129
+ ui: {
130
+ "ui:placeholder": string;
131
+ };
132
+ data: {
133
+ enum: string[];
134
+ type: string;
135
+ title: string;
136
+ description: string;
137
+ };
138
+ };
139
+ registration_volunteer: {
140
+ ui: {
141
+ "ui:enumNames": {
142
+ false: string;
143
+ true: string;
144
+ };
145
+ };
146
+ data: {
147
+ type: string;
148
+ title: string;
149
+ default: boolean;
150
+ };
151
+ };
152
+ guardian_forms_received: {
153
+ ui: {
154
+ "ui:enumNames": {
155
+ false: string;
156
+ true: string;
157
+ };
158
+ };
159
+ data: {
160
+ type: string;
161
+ title: string;
162
+ default: boolean;
163
+ };
164
+ };
165
+ guardian_forms_required: {
166
+ ui: {
167
+ "ui:enumNames": {
168
+ false: string;
169
+ true: string;
170
+ };
171
+ };
172
+ data: {
173
+ type: string;
174
+ title: string;
175
+ default: boolean;
176
+ };
177
+ };
178
+ meal_assignment_breakfast: {
179
+ ui: {
180
+ "ui:placeholder": string;
181
+ };
182
+ data: {
183
+ enum: string[];
184
+ type: string;
185
+ title: string;
186
+ description: string;
187
+ };
188
+ };
189
+ };
190
+ export default _default;
@@ -0,0 +1,204 @@
1
+ /* eslint-disable quotes */
2
+ export default {
3
+ "badge_role": {
4
+ "data": {
5
+ "type": "string",
6
+ "title": "Role for name badge",
7
+ "maxLength": 10
8
+ }
9
+ },
10
+ "vehicles": {
11
+ "ui": {
12
+ "items": {
13
+ "ui:order": [
14
+ "year",
15
+ "make",
16
+ "model",
17
+ "color",
18
+ "state",
19
+ "license",
20
+ "*"
21
+ ]
22
+ }
23
+ },
24
+ "data": {
25
+ "type": "array",
26
+ "items": {
27
+ "type": "object",
28
+ "properties": {
29
+ "make": {
30
+ "type": "string",
31
+ "title": "Make"
32
+ },
33
+ "year": {
34
+ "type": "string",
35
+ "title": "Year",
36
+ "maxLength": 4,
37
+ "minLength": 4
38
+ },
39
+ "color": {
40
+ "type": "string",
41
+ "title": "Color"
42
+ },
43
+ "model": {
44
+ "type": "string",
45
+ "title": "Model"
46
+ },
47
+ "state": {
48
+ "type": "string",
49
+ "title": "License Plate State",
50
+ "default": "CA",
51
+ "maxLength": 2,
52
+ "minLength": 2
53
+ },
54
+ "license": {
55
+ "type": "string",
56
+ "title": "License Plate Number"
57
+ },
58
+ "passengers": {
59
+ "type": "array",
60
+ "items": {
61
+ "type": "string"
62
+ },
63
+ "title": "Passengers"
64
+ }
65
+ }
66
+ },
67
+ "title": "Registration: Vehicles"
68
+ }
69
+ },
70
+ "checked_in": {
71
+ "ui": {
72
+ "ui:enumNames": {
73
+ "false": "No",
74
+ "true": "Yes"
75
+ }
76
+ },
77
+ "data": {
78
+ "type": "boolean",
79
+ "title": "Registration: Checked-In",
80
+ "default": false
81
+ }
82
+ },
83
+ "guardian_name": {
84
+ "ui": {},
85
+ "data": {
86
+ "type": "string",
87
+ "title": "Guardian name"
88
+ }
89
+ },
90
+ "crew_exception": {
91
+ "ui": {},
92
+ "data": {
93
+ "type": "string",
94
+ "title": "Crew Exception/Title",
95
+ "description": "Enter 'Guest' if not actually on crew, and 'Manager of <Crewname>' if manager of a crew"
96
+ }
97
+ },
98
+ "food_trade_only": {
99
+ "ui": {
100
+ "ui:enumNames": {
101
+ "false": "No",
102
+ "true": "Yes"
103
+ }
104
+ },
105
+ "data": {
106
+ "type": "boolean",
107
+ "title": "Food trade only",
108
+ "default": false
109
+ }
110
+ },
111
+ "precamp_meals_comp": {
112
+ "ui": {
113
+ "ui:enumNames": {
114
+ "false": "No",
115
+ "true": "Yes"
116
+ }
117
+ },
118
+ "data": {
119
+ "type": "boolean",
120
+ "title": "Comped pre-camp meals",
121
+ "default": false
122
+ }
123
+ },
124
+ "instructor_meal_rate": {
125
+ "ui": {
126
+ "ui:enumNames": {
127
+ "false": "No",
128
+ "true": "Yes"
129
+ }
130
+ },
131
+ "data": {
132
+ "type": "boolean",
133
+ "title": "Instructor meal rate",
134
+ "default": false
135
+ }
136
+ },
137
+ "meal_assignment_dinner": {
138
+ "ui": {
139
+ "ui:placeholder": "Choose an option"
140
+ },
141
+ "data": {
142
+ "enum": [
143
+ "Camp 1",
144
+ "Camp 2"
145
+ ],
146
+ "type": "string",
147
+ "title": "Meals: Dinner in",
148
+ "description": "If camper is not eating meals in the camp where they're staying"
149
+ }
150
+ },
151
+ "registration_volunteer": {
152
+ "ui": {
153
+ "ui:enumNames": {
154
+ "false": "No",
155
+ "true": "Yes"
156
+ }
157
+ },
158
+ "data": {
159
+ "type": "boolean",
160
+ "title": "Registration volunteer",
161
+ "default": false
162
+ }
163
+ },
164
+ "guardian_forms_received": {
165
+ "ui": {
166
+ "ui:enumNames": {
167
+ "false": "No",
168
+ "true": "Yes"
169
+ }
170
+ },
171
+ "data": {
172
+ "type": "boolean",
173
+ "title": "Guardian forms received",
174
+ "default": false
175
+ }
176
+ },
177
+ "guardian_forms_required": {
178
+ "ui": {
179
+ "ui:enumNames": {
180
+ "false": "No",
181
+ "true": "Yes"
182
+ }
183
+ },
184
+ "data": {
185
+ "type": "boolean",
186
+ "title": "Guardian forms required",
187
+ "default": false
188
+ }
189
+ },
190
+ "meal_assignment_breakfast": {
191
+ "ui": {
192
+ "ui:placeholder": "Choose an option"
193
+ },
194
+ "data": {
195
+ "enum": [
196
+ "Camp 1",
197
+ "Camp 2"
198
+ ],
199
+ "type": "string",
200
+ "title": "Meals: Breakfast in",
201
+ "description": "If camper is not eating meals in the camp where they're staying"
202
+ }
203
+ }
204
+ };
@@ -0,0 +1,41 @@
1
+ import { mealsLookup } from './pricing/camperPricingLogic.ts';
2
+ export declare const mealTypes: string[];
3
+ declare const createMeals: (...options: (keyof typeof mealsLookup)[]) => {
4
+ type: string;
5
+ title: string;
6
+ description: string;
7
+ required: string[];
8
+ properties: {
9
+ meal_plan: {
10
+ type: string;
11
+ title: string;
12
+ enum: string[];
13
+ };
14
+ };
15
+ dependencies: {
16
+ meal_plan: {
17
+ oneOf: ({
18
+ properties: {
19
+ meal_plan: {
20
+ enum: string[];
21
+ };
22
+ meal_type?: undefined;
23
+ };
24
+ required?: undefined;
25
+ } | {
26
+ required: string[];
27
+ properties: {
28
+ meal_plan: {
29
+ enum: string[];
30
+ };
31
+ meal_type: {
32
+ type: string;
33
+ title: string;
34
+ enum: string[];
35
+ };
36
+ };
37
+ })[];
38
+ };
39
+ };
40
+ };
41
+ export default createMeals;
@@ -0,0 +1,81 @@
1
+ import { mealsLookup } from "./pricing/camperPricingLogic.js";
2
+ import pricing from "./pricing/pricing.js";
3
+ import regTemplateVars from "./regTemplateVars.js";
4
+ export const mealTypes = [
5
+ 'Non-Vegetarian',
6
+ 'Vegetarian',
7
+ 'Vegan',
8
+ ];
9
+ const dependencies = {
10
+ 'meal_plan': {
11
+ 'oneOf': [
12
+ {
13
+ 'properties': {
14
+ 'meal_plan': {
15
+ 'enum': ['No meals', '']
16
+ }
17
+ }
18
+ },
19
+ {
20
+ 'required': ['meal_type'],
21
+ 'properties': {
22
+ 'meal_plan': {
23
+ 'enum': Object.values(mealsLookup),
24
+ },
25
+ 'meal_type': {
26
+ 'type': 'string',
27
+ 'title': 'What types of meals do you want?',
28
+ 'enum': mealTypes,
29
+ }
30
+ }
31
+ }
32
+ ]
33
+ }
34
+ };
35
+ // Switched off (see the commented-out allOf below), kept for when it returns
36
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
37
+ const allOf = [
38
+ {
39
+ if: { properties: { meal_plan: { enum: Object.values(mealsLookup) } } },
40
+ then: {
41
+ required: ['meal_type'],
42
+ properties: {
43
+ meal_type: {
44
+ type: 'string',
45
+ title: 'What types of meals do you want?',
46
+ enum: mealTypes,
47
+ }
48
+ }
49
+ },
50
+ else: {},
51
+ }
52
+ ];
53
+ const createMeals = (...options) => ({
54
+ 'type': 'object',
55
+ 'title': 'Meal Plans',
56
+ 'description': `Meal plans must be fully paid by ${regTemplateVars.meals_due_date}. We cannot accept partial payments. Food prices include sales tax.
57
+
58
+ NOTE: You may only cook if you’re camping in a vehicle with a built-in kitchen. No portable white gas or propane stoves are allowed in the park.
59
+
60
+ | Meal Plan Pricing | adult age 12+ | child ages 0-11 |
61
+ | --- | --- | --- |
62
+ | Full camp, full meals | $${pricing.meals_adult_full} adults | $${pricing.meals_youth_full} kids |
63
+ | Full camp, just dinners | $${pricing.meals_adult_dinners} adults | $${pricing.meals_youth_dinners} kids |
64
+ | Half camp, full meals | $${pricing.meals_adult_half} adults | $${pricing.meals_youth_half} kids |
65
+
66
+ Meal plans offer significant savings. You may buy individual meals at camp instead of buying a meal plan. (But it costs more!)`,
67
+ 'required': ['meal_plan'],
68
+ 'properties': {
69
+ 'meal_plan': {
70
+ 'type': 'string',
71
+ 'title': 'What meals will you purchase?',
72
+ 'enum': [
73
+ 'No meals',
74
+ ...options.map(o => mealsLookup[o])
75
+ ],
76
+ }
77
+ },
78
+ dependencies,
79
+ // allOf,
80
+ });
81
+ export default createMeals;