@camphoric/camphoric-event-lark 1.0.1 → 3.0.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.
Files changed (60) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/README.md +113 -13
  3. package/dist/camperSchema.js +1 -1
  4. package/dist/confirmationEmailTemplate.js +2 -2
  5. package/dist/index.d.ts +53 -0
  6. package/dist/index.js +12 -1
  7. package/dist/pricing/pricing.d.ts +2 -0
  8. package/dist/pricing/pricing.js +3 -0
  9. package/dist/promoCodes.d.ts +31 -0
  10. package/dist/promoCodes.js +32 -0
  11. package/dist/registrationErrorMessages.d.ts +33 -0
  12. package/dist/registrationErrorMessages.js +42 -0
  13. package/dist/registrationSchema.js +1 -1
  14. package/dist/registrationTypes.d.ts +4 -0
  15. package/dist/registrationTypes.js +3 -2
  16. package/dist/reports.d.ts +3 -0
  17. package/dist/reports.js +106 -42
  18. package/dist/testRegistrations.js +613 -84
  19. package/package.json +7 -5
  20. package/reports/Admin--All-Payments.j2 +40 -0
  21. package/reports/Admin--Meal-Income.j2 +64 -0
  22. package/reports/Admin--Non-Meal-Income.j2 +89 -0
  23. package/reports/All-Campers.j2 +2 -2
  24. package/reports/Campers--All-Camp-3.j2 +2 -2
  25. package/reports/Campers--By-Reg-Date.j2 +2 -2
  26. package/reports/Campers--By-Zip-Code--For-Carpool-.j2 +14 -14
  27. package/reports/Campers--Confirmation-Email-Info.j2 +2 -2
  28. package/reports/Campers--Early-Arrivals.j2 +1 -1
  29. package/reports/Campers--Half-Campers.j2 +3 -3
  30. package/reports/Campers--Lodging-by-Alpha.j2 +1 -1
  31. package/reports/Campers--Lodging-by-Lodging.j2 +1 -1
  32. package/reports/Campers--Minors.j2 +7 -4
  33. package/reports/Campers--NOT-Checked-In.j2 +3 -3
  34. package/reports/Campers--Name-Badges.j2 +4 -4
  35. package/reports/Campers--Parking-Exceptions.j2 +4 -4
  36. package/reports/Campers--Registration-Payments.j2 +2 -2
  37. package/reports/Campers--Registration-Volunteers.j2 +1 -1
  38. package/reports/Campers--Tent-Tags.j2 +5 -3
  39. package/reports/Community-Care--Campers.j2 +13 -11
  40. package/reports/Crew--Clean--C1.j2 +4 -4
  41. package/reports/Crew--Clean--C2-3.j2 +4 -4
  42. package/reports/Crew--Community-Care.j2 +2 -2
  43. package/reports/Crew--Kitchen--w--Lodging.j2 +1 -1
  44. package/reports/Crew--Managers-and-Others.j2 +2 -2
  45. package/reports/Crew--Office--Camp-1.j2 +2 -2
  46. package/reports/Crew--Office--Camp-2.j2 +2 -2
  47. package/reports/Crew--Office--Camp-3.j2 +2 -2
  48. package/reports/Crew--Setup-and-Teardown.j2 +2 -2
  49. package/reports/Crew--Special-Invites.j2 +1 -1
  50. package/reports/Donation-Report---Lark.j2 +2 -2
  51. package/reports/Kitchen--All-Meal-Tickets.j2 +2 -2
  52. package/reports/Kitchen--Meal-Location-Exceptions.j2 +2 -2
  53. package/reports/Kitchen--No-Meal-Ticket.j2 +2 -2
  54. package/reports/Registration--All-reg-workers.j2 +4 -4
  55. package/reports/Registration--Early-Arrivals.j2 +4 -4
  56. package/reports/Registration--First-Half-Arrivals.j2 +4 -4
  57. package/reports/Registration--PayPal-Invoices.j2 +4 -4
  58. package/reports/Registration--Second-Half-Arrivals.j2 +4 -4
  59. package/reports/Registration--Values-for-July-Email.j2 +2 -2
  60. package/reports/Security--Campers.j2 +13 -11
package/CHANGELOG.md CHANGED
@@ -1,5 +1,51 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.0.0](https://github.com/camphoric/camphoric-event-lark/compare/v2.0.0...v3.0.0) (2026-11-18)
4
+
5
+
6
+ ### ⚠ BREAKING CHANGES
7
+
8
+ * **event:** the import-spec peer range is now ^1.3.0, the first spec with an event's cancellation fee, so the event needs Camphoric v0.19.0 or later.
9
+
10
+ ### Features
11
+
12
+ * **event:** offer a $150 cancellation fee plus PayPal's fees (Camphoric v0.19) ([611fb9a](https://github.com/camphoric/camphoric-event-lark/commit/611fb9af873ae91a5ea1ccf3c9ea5326112930d7)), closes [#29](https://github.com/camphoric/camphoric-event-lark/issues/29)
13
+
14
+ ## [2.0.0](https://github.com/camphoric/camphoric-event-lark/compare/v1.0.1...v2.0.0) (2026-11-12)
15
+
16
+
17
+ ### ⚠ BREAKING CHANGES
18
+
19
+ * **deps:** the import-spec peer range is now ^1.2.0, the first spec with report categories.
20
+ * **reports:** needs a Camphoric release with report categories. An older server drops the category, leaving titles with no group. Importing again into an event that has the old titles adds the new reports beside
21
+ * **deps:** the e2e tests and npm run bulk need Camphoric v0.18.0 or later, and bulk needs an API token rather than a password.
22
+
23
+ ### Features
24
+
25
+ * **deps:** need import-spec 1.2.0 for report categories ([1fdbda0](https://github.com/camphoric/camphoric-event-lark/commit/1fdbda0fe9897900a202ff27662de41cd21652a6))
26
+ * **promo-codes:** add a promo code for campers who refer a first-time camper ([04c8539](https://github.com/camphoric/camphoric-event-lark/commit/04c8539d260ab4178754b2c7b0dd62461d70f7d9)), closes [#12](https://github.com/camphoric/camphoric-event-lark/issues/12)
27
+ * **promo-codes:** add a promo code for first-time campers ([04c8539](https://github.com/camphoric/camphoric-event-lark/commit/04c8539d260ab4178754b2c7b0dd62461d70f7d9)), closes [#11](https://github.com/camphoric/camphoric-event-lark/issues/11)
28
+ * **registration-form:** give the form plain-language error messages ([ab8da93](https://github.com/camphoric/camphoric-event-lark/commit/ab8da937bc7f4697c4f9ba5f48cd1532d24575f1))
29
+ * **reports:** add a Kitchen, Meal Income CSV report ([9abff12](https://github.com/camphoric/camphoric-event-lark/commit/9abff126e71c6ed901d0e2080295204e0c5ecdcd))
30
+ * **reports:** add an "Admin, non-meal income" CSV report ([ae67c9e](https://github.com/camphoric/camphoric-event-lark/commit/ae67c9eda37b630984d643e6dcdb2c4c5c68cada))
31
+ * **reports:** add an "All payments" CSV report to Admin ([3fe3c57](https://github.com/camphoric/camphoric-event-lark/commit/3fe3c572f34d136f5fcb22ae52e92dbf8b8f996b))
32
+ * **reports:** give each report a category and drop it from the title ([05d2327](https://github.com/camphoric/camphoric-event-lark/commit/05d23270c15c06dbd5bf480a02de4e67a2ab411e))
33
+
34
+
35
+ ### Bug Fixes
36
+
37
+ * **deps:** import with Camphoric v0.18's API tokens (import-tools 3.0.0) ([8e1316f](https://github.com/camphoric/camphoric-event-lark/commit/8e1316fe1a64845de550ee4afeaed00bed5c20cb))
38
+ * **emails:** don't list an empty meal type in the confirmation ([b189cc1](https://github.com/camphoric/camphoric-event-lark/commit/b189cc1422566a804876eb1ea25c1c2d905d648d))
39
+ * **emails:** name the camp year in kitchen invitations and drop a doubled period ([ab8da93](https://github.com/camphoric/camphoric-event-lark/commit/ab8da937bc7f4697c4f9ba5f48cd1532d24575f1))
40
+ * **promo-codes:** take the first-time camper discount off tuition only ([6188132](https://github.com/camphoric/camphoric-event-lark/commit/61881326bf6f438fac5bc296d0dfdcc124574b4f))
41
+ * **registration-form:** remove the doubled "basis" from the intro ([dba85dd](https://github.com/camphoric/camphoric-event-lark/commit/dba85dd37e520d16c96b26cdf1adb9e5ac8f6b5e))
42
+ * **registration-form:** spell "Relevant credentials" correctly ([ab8da93](https://github.com/camphoric/camphoric-event-lark/commit/ab8da937bc7f4697c4f9ba5f48cd1532d24575f1))
43
+ * **reports:** don't fail on a camper who didn't give an age ([26dc12f](https://github.com/camphoric/camphoric-event-lark/commit/26dc12f55f4742ab1c6feb93d34de2fde03e3f39))
44
+ * **reports:** drop a stray backslash from All Campers' phone column and a trailing comma from Parking Exceptions ([e720aae](https://github.com/camphoric/camphoric-event-lark/commit/e720aae0d5d79b2e6da73a6a49ed0992782f42c4))
45
+ * **reports:** format meal income as money and drop the free rows ([51c3fe8](https://github.com/camphoric/camphoric-event-lark/commit/51c3fe80b279d3e9a8201d8a75c45e5b64d30c8d))
46
+ * **reports:** name the meal income discount row after the codes it counts ([5d7f736](https://github.com/camphoric/camphoric-event-lark/commit/5d7f736032ad8b56392500e5baf470a1fb2d4648))
47
+ * **reports:** quote names and other free text in the CSV reports ([e720aae](https://github.com/camphoric/camphoric-event-lark/commit/e720aae0d5d79b2e6da73a6a49ed0992782f42c4))
48
+
3
49
  ## [1.0.1](https://github.com/camphoric/camphoric-event-lark/compare/v1.0.0...v1.0.1) (2026-10-20)
4
50
 
5
51
 
package/README.md CHANGED
@@ -22,15 +22,21 @@ scripts/smoke-test-package.sh # pack it, install it, and load it from its buil
22
22
  ```
23
23
 
24
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
25
+ templates (`reports/`). The spec is a **peer dependency** (`^1.3.0`, the first with an event's cancellation fee), so Camphoric's importer loads
26
26
  one copy of it for every event; a spec major this event doesn't follow fails to install rather than
27
27
  nesting a second copy. Camphoric's `RELEASE.md` ("What a spec version means") describes how a new
28
28
  spec major is rolled out.
29
29
 
30
- To add generated registrations to an event imported into a running Camphoric:
30
+ To add generated registrations to an event imported into a running Camphoric, with an Admin's
31
+ personal access token (here minted in Camphoric's development stack, beside this checkout; it
32
+ lasts an hour):
31
33
 
32
34
  ```bash
33
- CAMPHORIC_URL=http://localhost:8000 DJANGO_SUPERUSER_USERNAME=admin DJANGO_SUPERUSER_PASSWORD=admin COUNT=10 npm run bulk
35
+ export CAMPHORIC_API_TOKEN=$(docker compose -f ../camphoric/docker-compose.yml exec -T django ./manage.py camphoric_api_token create admin)
36
+ ```
37
+
38
+ ```bash
39
+ CAMPHORIC_URL=http://localhost:8000 COUNT=10 npm run bulk
34
40
  ```
35
41
 
36
42
  (`addRegistrations.ts` describes its other settings. Each completed registration queues a
@@ -38,10 +44,13 @@ confirmation email, so run it where mail goes to the console, as in local develo
38
44
 
39
45
  ## End-to-end tests
40
46
 
41
- `e2e/` holds Playwright tests of the registration form, using the harness in
47
+ `e2e/` holds Playwright tests of the registration form and the reports, using the harness in
42
48
  `@camphoric/camphoric-event-import-tools/e2e`. Before they run, a throwaway Camphoric starts
43
49
  (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.
50
+ its registration window open, its sample registrations (`testRegistrations.ts`) and online
51
+ payment enabled, and afterwards the server is removed. Online payments go to the harness's fake
52
+ PayPal, so nothing is paid, and the throwaway server keeps the email it sends for the tests to
53
+ read.
45
54
 
46
55
  ```bash
47
56
  npx playwright install chromium # once
@@ -52,17 +61,108 @@ Locally the results are listed in the terminal; `npm run e2e -- --reporter=html`
52
61
  playwright show-report`, gives the HTML report (with traces) that CI uploads.
53
62
 
54
63
  - `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.
64
+ `CAMPHORIC_E2E_IMAGE` names a locally built image instead. The harness (import-tools 3) imports
65
+ with a personal access token it mints in the server (Camphoric v0.18.0 or later), and
66
+ `e2e/cancellation.spec.ts` checks the event's cancellation fee (v0.19.0 or later), so the image
67
+ must be Camphoric v0.19.0 or later.
68
+ - The tests need that throwaway server: its fake PayPal is what lets them pay online, so
69
+ `CAMPHORIC_E2E_SERVER_URL` (importing into a running server) can't be used for them.
58
70
  - Every test, on desktop and mobile Chrome, shares the one imported event, so a registration one
59
71
  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.
72
+ - `e2e/reports.spec.ts` signs in to the admin (as the throwaway server's admin, from the
73
+ harness's `adminCredentials()`, with `e2e/admin.ts`'s `signIn`) and opens each report in `reports.ts`. It fails on any render
74
+ error, and on any server warning (a field the event or a Camphoric object doesn't have) but the
75
+ known ones its `knownWarnings` lists, each tracked by an issue. It also fails a CSV report whose
76
+ quoting is broken or whose rows don't have the header's number of fields (an unquoted comma). It
77
+ doesn't check what a report says, and runs on desktop Chrome only, since reports render on the
78
+ server. A warning comes only from a line some registration reaches, and every test shares the
79
+ one event, so which show depends on what the tests have registered:
80
+ `__tests__/reportVariables.test.ts` checks every name a template reads against the event instead.
81
+ - `e2e/cancellation.spec.ts` signs in the same way and checks the imported event's cancellation
82
+ fee, and that the server offers a sample camper $150 when they're cancelled (no sample
83
+ registration has PayPal fees). `__tests__/cancellationFee.test.ts` checks the PayPal fees and
84
+ later cancellations.
85
+ - The fixtures: `registration`, a page object for the form (fields by label, campers and their
86
+ lists, lodging, the price ticker, the payment step); `admin`, for invitations and the email the
87
+ server sent; and `payPal`, the orders sent to the fake PayPal. The client's markup lives only
88
+ in the harness, so a change to the Camphoric client changes the harness, not these tests.
89
+ - `e2e/forms.ts` holds this event's own helpers: the required answers, opening the form through
90
+ an invitation, and the amounts due by check and online.
91
+
92
+ `.github/workflows/e2e.yml` runs them on pull requests, from `upstream.yml` (below), and on
93
+ demand.
94
+
95
+ ## Testing against new Camphoric releases
96
+
97
+ `.github/workflows/upstream.yml` ("Camphoric releases") tests this event against the newest
98
+ Camphoric release and import packages, rather than the lockfile's. Every 6 hours it finds the
99
+ newest stable Camphoric release (by version) whose image `ghcr.io/camphoric/camphoric:vX.Y.Z` is
100
+ published, and the newest `@camphoric/camphoric-event-import-spec` and `-tools` versions within
101
+ this event's ranges in `package.json`. A release is created before its image is pushed, so until
102
+ the newest release's image is published it tests the newest release before it that has one, and
103
+ says so in the run's summary and notes. Once the release is a day old, the note says instead that
104
+ its image was never published and that the release's `build-image` job needs re-running. It looks
105
+ each image up in GHCR's registry API, with retries: an answer other than found or not found (an
106
+ outage, say) fails the run, rather than counting as a missing image. When it hasn't tested that
107
+ combination yet, it runs `ci.yml` and `e2e.yml` against exactly those versions; the run's summary
108
+ lists them.
109
+
110
+ A combination is tested once, pass or fail: a marker in the Actions cache records it, keyed by
111
+ the Camphoric release and package versions tested, by each package's newest version, in this
112
+ event's range or not, and by a newer release whose image is still missing a day after its release.
113
+ So the first check after a newer release's image is published tests it, and a new major outside a
114
+ range is tested, and reported, within 6 hours. A newer release's missing image is reported within
115
+ 6 hours of the release turning a day old; before that, usually only by a Monday or forced run.
116
+ When none of the five newest releases has a published image, the 6-hourly check waits.
117
+
118
+ On Mondays at 14:00 UTC it tests regardless. That catches drift no release causes, such as a new
119
+ Node 22 or runner image, or a new in-range version of a dependency that the smoke test installs
120
+ from npm. Chromium comes with `@playwright/test`: the lockfile's, unless the import-tools version
121
+ tested needs a newer one, when npm installs the newest its peer range allows, so a new Playwright
122
+ release changes it too. The CI and E2E summaries list this event's top-level packages as
123
+ installed, and name each whose version isn't the one `package-lock.json` pins: the requested
124
+ packages, and any they moved, such as `@playwright/test`. With no image found, it tests the newest
125
+ release anyway, so the missing image is reported, and it doesn't record the combination.
126
+
127
+ A failure opens a **`camphoric-compat`** issue here, or comments on the open one, naming the
128
+ versions tested; so does a note that a package has a version newer than this event's range
129
+ allows (a new major, which this event needs migrating to), or that the newest release's image
130
+ isn't published. A report the issue already has isn't repeated, and a clean run closes it. A
131
+ note's wording is fixed (a missing image's changes once, when its release is a day old), so the
132
+ same note isn't reported again on each run.
133
+
134
+ A fix pushed here runs CI against the lockfile, not the new versions, and the marker keeps the
135
+ 6-hourly check from retrying the failed combination. To test it again (and close the issue)
136
+ before Monday, run it with `force`:
137
+
138
+ ```bash
139
+ gh workflow run upstream.yml -f force=true
140
+ ```
141
+
142
+ To run CI or E2E by hand against a given image tag (a pre-release, say) or exact package
143
+ versions (an image of v0.19.0 or later, for the cancellation fee test, and import-tools 3.x: the
144
+ harness mints an API token in the server, and earlier versions sign in with a password v0.18.0
145
+ refuses):
146
+
147
+ ```bash
148
+ gh workflow run e2e.yml -f image_tag=v0.20.0-rc.1
149
+ gh workflow run e2e.yml -f spec_version=1.3.0 -f tools_version=3.0.0
150
+ gh workflow run ci.yml -f spec_version=1.3.0 -f tools_version=3.0.0
151
+ ```
152
+
153
+ A version outside this event's range works too, such as a new major or a pre-release
154
+ (`-f tools_version=4.0.0-rc.1`): the run installs it over the range (with `--force` if a peer
155
+ range makes npm refuse it), checks the installed package's own version, and marks it `invalid` in
156
+ the summary's `npm ls`. It must be an exact version, not a range or a tag. CI's smoke test
157
+ installs the packed package with the `spec_version` given (`tools_version` doesn't apply, since
158
+ the package doesn't depend on the tools). To do the same locally:
159
+
160
+ ```bash
161
+ SPEC_VERSION=1.3.0 scripts/smoke-test-package.sh
162
+ ```
63
163
 
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.
164
+ GitHub disables scheduled workflows in a public repository after 60 days without activity; if
165
+ the Actions tab shows "Camphoric releases" disabled, enable it there.
66
166
 
67
167
  ## Releases
68
168
 
@@ -187,7 +187,7 @@ help.
187
187
  'credentials': {
188
188
  'type': 'string',
189
189
  'maxLength': 100,
190
- 'title': 'Relevent credentials and certifications',
190
+ 'title': 'Relevant credentials and certifications',
191
191
  },
192
192
  },
193
193
  'required': ['skills', 'credentials'],
@@ -21,7 +21,7 @@ accommodate your choice.
21
21
  - If you paid 50% of your tuition, your final payment will be due NO LATER THAN
22
22
  JUNE 20.
23
23
  - If you have not yet ordered meals then they also need to be ordered before
24
- June 20th by emailing registration@larkcamp.org..
24
+ June 20th by emailing registration@larkcamp.org.
25
25
 
26
26
  **YOU HAVE REGISTERED FOR:**
27
27
 
@@ -30,7 +30,7 @@ accommodate your choice.
30
30
  {%- set badge = camper.attributes.name_badge or {} -%}
31
31
  {{ camper.attributes.first_name }} {{ camper.attributes.last_name }} - {{ camper.attributes.session }}
32
32
  {{ camper.lodging.path_names | join(', ') if camper.lodging else 'none' }}
33
- {{ meals.meal_plan }}, {{ meals.meal_type }}: {{ camper.pricing.meals | money }}
33
+ {{ meals.meal_plan }}{% if meals.meal_type %}, {{ meals.meal_type }}{% endif %}: {{ camper.pricing.meals | money }}
34
34
  {% if badge.purchase -%}
35
35
  Name badge ({{ camper.pricing.name_badge | money }}): {{ badge.name }} - {{ badge.pronouns }}
36
36
  {% endif -%}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { type SampleRegGenerator } from '@camphoric/camphoric-event-import-spec';
2
2
  export declare const eventName: string;
3
+ export declare const epaymentHandling = "2.5";
3
4
  declare const _default: {
4
5
  data: {
5
6
  lodgings?: import("@camphoric/camphoric-event-import-spec").Lodgings | undefined;
@@ -7,6 +8,41 @@ declare const _default: {
7
8
  name: string;
8
9
  label: string;
9
10
  }[] | undefined;
11
+ email_templates?: {
12
+ filter?: {
13
+ combinator?: "and" | "or" | undefined;
14
+ rules: ({
15
+ value?: unknown;
16
+ field: string;
17
+ op: "is_set" | "is_not_set" | "is_true" | "is_false";
18
+ } | {
19
+ field: string;
20
+ op: "is_set" | "is_not_set" | "is_true" | "is_false" | "contains" | "not_contains" | "is" | "is_not" | "eq" | "ne" | "gt" | "lt" | "gte" | "lte" | "any_of" | "before" | "after" | "on";
21
+ value: unknown;
22
+ })[];
23
+ } | undefined;
24
+ from_email?: string | undefined;
25
+ reply_to?: string | undefined;
26
+ recipient_source?: "campers" | "registrations" | "manual" | undefined;
27
+ filter_expression?: string | undefined;
28
+ address_expression?: string | undefined;
29
+ name_expression?: string | undefined;
30
+ recipient_list?: string | undefined;
31
+ include_incomplete?: boolean | undefined;
32
+ name: string;
33
+ subject: string;
34
+ body: string;
35
+ }[] | undefined;
36
+ promo_codes?: {
37
+ scope?: "registration" | "camper" | undefined;
38
+ enabled?: boolean | undefined;
39
+ expiration_date?: string | undefined;
40
+ excluded_registration_types?: string[] | undefined;
41
+ excludes_uninvited?: boolean | undefined;
42
+ label: string;
43
+ code: string;
44
+ pricing_logic: unknown;
45
+ }[] | undefined;
10
46
  organization: string | number;
11
47
  event: {
12
48
  registration_start?: string | undefined;
@@ -37,23 +73,40 @@ declare const _default: {
37
73
  exp: unknown;
38
74
  }[] | undefined;
39
75
  paypal_enabled?: boolean | undefined;
76
+ payment_types?: {
77
+ label: string;
78
+ value: string;
79
+ }[] | undefined;
40
80
  paypal_client_id?: string | undefined;
41
81
  epayment_handling?: string | undefined;
82
+ cancellation_fee?: number | object | null | undefined;
42
83
  pre_submit_template?: string | undefined;
43
84
  confirmation_page_template?: string | undefined;
44
85
  confirmation_email_subject?: string | undefined;
45
86
  confirmation_email_template?: string | undefined;
46
87
  confirmation_email_from?: string | undefined;
88
+ confirmation_email_reply_to?: string | undefined;
89
+ invoice_email_subject?: string | undefined;
90
+ invoice_email_template?: string | undefined;
91
+ invoice_email_from?: string | undefined;
92
+ invoice_email_reply_to?: string | undefined;
47
93
  name: string;
48
94
  };
49
95
  reports: {
96
+ category?: string | undefined;
97
+ description?: string | undefined;
50
98
  output?: "csv" | "md" | "txt" | "html" | "hbs" | undefined;
51
99
  variables_source?: "client" | "server" | undefined;
100
+ variables_schema?: Record<string, unknown> | undefined;
52
101
  title: string;
53
102
  template: string;
54
103
  }[];
55
104
  registration_types: {
105
+ invitation_email_from?: string | undefined;
106
+ invitation_email_reply_to?: string | undefined;
107
+ camper_schema_overrides?: Record<string, unknown> | undefined;
56
108
  registration_schema_overrides?: Record<string, unknown> | undefined;
109
+ ui_schema_overrides?: Record<string, unknown> | undefined;
57
110
  name: string;
58
111
  label: string;
59
112
  invitation_email_subject: string;
package/dist/index.js CHANGED
@@ -10,7 +10,9 @@ import camper_admin_schema from "./camperAdminAttributes.js";
10
10
  import registration_schema from "./registrationSchema.js";
11
11
  import registration_types from "./registrationTypes.js";
12
12
  import registration_ui_schema from "./registrationUISchema.js";
13
+ import registration_error_messages from "./registrationErrorMessages.js";
13
14
  import lodgings from "./lodgings.js";
15
+ import promo_codes from "./promoCodes.js";
14
16
  import reports from "./reports.js";
15
17
  import makeRegistrations from "./testRegistrations.js";
16
18
  import registration_template_vars from "./regTemplateVars.js";
@@ -19,6 +21,8 @@ import registration_admin_schema from "./regAdminAttributes.js";
19
21
  import { dates, lengthInDays, year } from "./dates.js";
20
22
  import { confirmation_email_template, confirmation_email_subject, } from "./confirmationEmailTemplate.js";
21
23
  export const eventName = `Lark Camp ${year}`;
24
+ // The handling (percent) added to a payment made online, with PayPal
25
+ export const epaymentHandling = '2.5';
22
26
  const data = {
23
27
  organization: 'Lark Traditional Arts',
24
28
  event: {
@@ -38,12 +42,18 @@ const data = {
38
42
  registration_template_vars,
39
43
  registration_schema,
40
44
  registration_ui_schema,
45
+ registration_error_messages,
41
46
  registration_admin_schema,
42
47
  // deposit_schema,
43
48
  // deposit_schema,
44
49
  pricing,
45
50
  registration_pricing_logic,
46
51
  camper_pricing_logic,
52
+ // offered when a camper is cancelled: $150 a camper, plus PayPal's fees on
53
+ // the registration's payments, those once (on the first camper cancelled)
54
+ cancellation_fee: {
55
+ '+': [150, { if: [{ var: 'first_cancellation' }, { var: 'paypal_fees' }, 0] }],
56
+ },
47
57
  pre_submit_template,
48
58
  confirmation_page_template,
49
59
  confirmation_email_template,
@@ -53,6 +63,7 @@ const data = {
53
63
  lodgings,
54
64
  reports,
55
65
  registration_types,
66
+ promo_codes,
56
67
  custom_charge_types: [
57
68
  {
58
69
  label: 'New Camper Discount',
@@ -75,7 +86,7 @@ const data = {
75
86
  if (process.env.PAYPAL_CLIENT_ID) {
76
87
  data.event.paypal_enabled = true;
77
88
  data.event.paypal_client_id = process.env.PAYPAL_CLIENT_ID;
78
- data.event.epayment_handling = '2.5';
89
+ data.event.epayment_handling = epaymentHandling;
79
90
  }
80
91
  const sampleRegGenerator = async (_fetch, results) => {
81
92
  const regs = makeRegistrations(savedLodging(results));
@@ -18,5 +18,7 @@ declare const pricing: {
18
18
  meals_adult_half: number;
19
19
  meals_youth_half: number;
20
20
  name_badge: number;
21
+ first_time_camper_discount: number;
22
+ first_time_referrer_meals_discount: number;
21
23
  };
22
24
  export default pricing;
@@ -18,5 +18,8 @@ const pricing = {
18
18
  meals_adult_half: 268,
19
19
  meals_youth_half: 192,
20
20
  name_badge: 5,
21
+ // promo codes (promoCodes.ts)
22
+ first_time_camper_discount: 100,
23
+ first_time_referrer_meals_discount: 75,
21
24
  };
22
25
  export default pricing;
@@ -0,0 +1,31 @@
1
+ export declare const yearSuffix: (campYear: number) => string;
2
+ export declare const firstTimeCode: (campYear: number) => string;
3
+ export declare const firstTimeReferrerCode: (campYear: number) => string;
4
+ declare const _default: ({
5
+ label: string;
6
+ code: string;
7
+ pricing_logic: {
8
+ max: (number | {
9
+ min: ({
10
+ var: string;
11
+ } | {
12
+ var: (string | number)[];
13
+ })[];
14
+ })[];
15
+ };
16
+ scope: "camper";
17
+ } | {
18
+ label: string;
19
+ code: string;
20
+ pricing_logic: {
21
+ max: (number | {
22
+ min: ({
23
+ var: string;
24
+ } | {
25
+ var: (string | number)[];
26
+ })[];
27
+ })[];
28
+ };
29
+ scope: "registration";
30
+ })[];
31
+ export default _default;
@@ -0,0 +1,32 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { year } from "./dates.js";
3
+ // Each year's codes end with the first 4 characters of the year's MD5 sum, so
4
+ // they're new every year. They aren't secret: anyone with this package (it's
5
+ // public) can work them out for any year.
6
+ export const yearSuffix = (campYear) => createHash('md5').update(String(campYear)).digest('hex').slice(0, 4);
7
+ export const firstTimeCode = (campYear) => `lc${campYear}FirstTime${yearSuffix(campYear)}`;
8
+ export const firstTimeReferrerCode = (campYear) => `lc${campYear}FTReferrer${yearSuffix(campYear)}`;
9
+ // Up to `amount` off one price line: never more than the line, and never
10
+ // below nothing
11
+ const upTo = (amount, line) => ({
12
+ max: [0, { min: [{ var: amount }, { var: [line, 0] }] }],
13
+ });
14
+ // Promo codes: Camphoric works out each one's discount after every other price
15
+ // line (and never takes more than the total it comes off)
16
+ export default [
17
+ {
18
+ label: 'First-time camper',
19
+ code: firstTimeCode(year),
20
+ // $100 off each camper's tuition, or the whole tuition when it's less
21
+ pricing_logic: upTo('pricing.first_time_camper_discount', 'tuition'),
22
+ scope: 'camper',
23
+ },
24
+ {
25
+ label: 'First-time camper referrer',
26
+ code: firstTimeReferrerCode(year),
27
+ // $75 off the registration's meals (all its campers' together), or the
28
+ // meals' whole cost when they come to less
29
+ pricing_logic: upTo('pricing.first_time_referrer_meals_discount', 'meals'),
30
+ scope: 'registration',
31
+ },
32
+ ];
@@ -0,0 +1,33 @@
1
+ declare const _default: {
2
+ lta_donation: {
3
+ type: string;
4
+ minimum: string;
5
+ };
6
+ 'campers.*.name_badge.pronouns': {
7
+ maxLength: string;
8
+ };
9
+ 'campers.*.good_samaritan.credentials': {
10
+ required: string;
11
+ };
12
+ 'campers.*.good_samaritan.skills': {
13
+ required: string;
14
+ minItems: string;
15
+ };
16
+ 'payment.payer_number': {
17
+ pattern: string;
18
+ };
19
+ registrant_email: {
20
+ format: string;
21
+ pattern: string;
22
+ };
23
+ 'campers.*.email': {
24
+ format: string;
25
+ };
26
+ campers: {
27
+ minItems: string;
28
+ };
29
+ '*': {
30
+ required: string;
31
+ };
32
+ };
33
+ export default _default;
@@ -0,0 +1,42 @@
1
+ // The form's own validation messages, in place of the raw JSON-schema ones
2
+ // ("must be integer", "must match pattern …") that testers couldn't make sense
3
+ // of: { field path: { validation keyword: message } }, with "*" for an array
4
+ // index and the path "*" for the event-wide default of a keyword. A required
5
+ // field's path is the missing field's own.
6
+ export default {
7
+ // Jed: a donation of 3.50 was "demanding an integer value"
8
+ 'lta_donation': {
9
+ type: 'Please enter a whole number of dollars, e.g. 25.',
10
+ minimum: 'Please enter a whole number of dollars, e.g. 25.',
11
+ },
12
+ // Mahati: pronouns over the limit gave "errors in the name badge field"
13
+ 'campers.*.name_badge.pronouns': {
14
+ maxLength: 'Pronouns can be at most 15 characters.',
15
+ },
16
+ // Madelyn: volunteering without credentials gave a page of errors
17
+ 'campers.*.good_samaritan.credentials': {
18
+ required: 'Please list your credentials.',
19
+ },
20
+ 'campers.*.good_samaritan.skills': {
21
+ required: 'Please check at least one skill.',
22
+ minItems: 'Please check at least one skill.',
23
+ },
24
+ 'payment.payer_number': {
25
+ pattern: 'Enter your phone number with country code, digits only, e.g. +17075551234.',
26
+ },
27
+ // (Camphoric checks the registrant's email with a pattern, too)
28
+ 'registrant_email': {
29
+ format: 'Please enter a valid email address.',
30
+ pattern: 'Please enter a valid email address.',
31
+ },
32
+ 'campers.*.email': {
33
+ format: 'Please enter a valid email address.',
34
+ },
35
+ // Removing the only camper gave "Camper Information: Please choose at least 1"
36
+ 'campers': {
37
+ minItems: 'Please add at least one camper.',
38
+ },
39
+ '*': {
40
+ required: 'This field is required.',
41
+ },
42
+ };
@@ -6,7 +6,7 @@ export default {
6
6
  Read the [Terms of Registration](http://www.larkcamp.org/campterms.html) before you fill out this form.
7
7
 
8
8
  Please note that registrations are accepted in the order they are received and
9
- your camping preferences are processed on a "first-come, first-served basis" basis.
9
+ your camping preferences are processed on a first-come, first-served basis.
10
10
 
11
11
  ### PROOF OF NEGATIVE COVID TEST JUST BEFORE CAMP WILL BE REQUIRED FOR ALL ATTENDEES
12
12
 
@@ -14,7 +14,11 @@ export declare const regTypes: ({
14
14
  };
15
15
  })[];
16
16
  declare const _default: {
17
+ invitation_email_from?: string | undefined;
18
+ invitation_email_reply_to?: string | undefined;
19
+ camper_schema_overrides?: Record<string, unknown> | undefined;
17
20
  registration_schema_overrides?: Record<string, unknown> | undefined;
21
+ ui_schema_overrides?: Record<string, unknown> | undefined;
18
22
  name: string;
19
23
  label: string;
20
24
  invitation_email_subject: string;
@@ -1,5 +1,6 @@
1
1
  import * as priceLists from "./pricing/pricingLists.js";
2
2
  import pricing from "./pricing/pricing.js";
3
+ import { year } from "./dates.js";
3
4
  // Invitation emails are Jinja (SPEC §8.4): `invitation` (recipient_name,
4
5
  // recipient_email, code, register_url), `registration_type` and `event`.
5
6
  const createCrewEmailTemplate = (regType) => `
@@ -54,7 +55,7 @@ const crewEmailTemplateOverrides = {
54
55
  'kitchen-full': () => `
55
56
  Dear {{ invitation.recipient_name or invitation.recipient_email }},
56
57
 
57
- Below is your personalized link to register for Lark Camp 2024 as Full Trade Kitchen Crew (includes kitchens, coffeehouses, & bakery).
58
+ Below is your personalized link to register for Lark Camp ${year} as Full Trade Kitchen Crew (includes kitchens, coffeehouses, & bakery).
58
59
 
59
60
  [Please click here to register!]({{ invitation.register_url }})
60
61
 
@@ -90,7 +91,7 @@ https://www.larktraditionalarts.org`,
90
91
  'kitchen-partial': () => `
91
92
  Dear {{ invitation.recipient_name or invitation.recipient_email }},
92
93
 
93
- Below is your personalized link to register for Lark Camp 2024 as Partial Pay Kitchen Crew (includes kitchens, coffeehouses, & bakery).
94
+ Below is your personalized link to register for Lark Camp ${year} as Partial Pay Kitchen Crew (includes kitchens, coffeehouses, & bakery).
94
95
 
95
96
  [Please click here to register!]({{ invitation.register_url }})
96
97
 
package/dist/reports.d.ts CHANGED
@@ -1,6 +1,9 @@
1
1
  declare const _default: {
2
+ category?: string | undefined;
3
+ description?: string | undefined;
2
4
  output?: "csv" | "md" | "txt" | "html" | "hbs" | undefined;
3
5
  variables_source?: "client" | "server" | undefined;
6
+ variables_schema?: Record<string, unknown> | undefined;
4
7
  title: string;
5
8
  template: string;
6
9
  }[];