@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camphoric/camphoric-event-lark",
3
- "version": "1.0.1",
3
+ "version": "3.0.0",
4
4
  "description": "Lark Traditional Arts' Lark Camp Camphoric event: its import object, organization, reports and bulk registrations.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -38,16 +38,17 @@
38
38
  "luxon": "^3.7.2"
39
39
  },
40
40
  "peerDependencies": {
41
- "@camphoric/camphoric-event-import-spec": "^1.0.0"
41
+ "@camphoric/camphoric-event-import-spec": "^1.3.0"
42
42
  },
43
43
  "devDependencies": {
44
- "@camphoric/camphoric-event-import-spec": "^1.0.0",
45
- "@camphoric/camphoric-event-import-tools": "^1.2.0",
44
+ "@camphoric/camphoric-event-import-spec": "^1.3.0",
45
+ "@camphoric/camphoric-event-import-tools": "^3.0.0",
46
46
  "@eslint/js": "^9.39.5",
47
47
  "@jest/globals": "^30.5.2",
48
- "@playwright/test": "^1.63.0",
48
+ "@playwright/test": "^1.64.1",
49
49
  "@swc/core": "^1.16.13",
50
50
  "@swc/jest": "^0.2.39",
51
+ "@types/json-logic-js": "^2.0.8",
51
52
  "@types/lodash": "^4.17.25",
52
53
  "@types/luxon": "^3.7.6",
53
54
  "@types/node": "^22.20.5",
@@ -55,6 +56,7 @@
55
56
  "eslint-plugin-jest": "^29.16.6",
56
57
  "globals": "^17.13.0",
57
58
  "jest": "^30.5.2",
59
+ "json-logic-js": "^2.0.5",
58
60
  "tsx": "^4.23.15",
59
61
  "typescript": "^5.9.3",
60
62
  "typescript-eslint": "^8.71.0"
@@ -0,0 +1,40 @@
1
+ {#- Every payment and refund, one row each, to reconcile against the bank and
2
+ PayPal as they come in: by date paid, oldest first, then in the order they
3
+ were recorded; ones with no date paid come last. (Camphoric lists
4
+ `payments` registration by registration, so they're sorted here.) A
5
+ refund's amount is negative, and Refund Of is the ID of the payment it
6
+ gives money back from. PayPal ID is PayPal's transaction id: a payment's
7
+ capture (its `paypal_response` is the whole PayPal order), a refund's own
8
+ id. Payer is the billing name the registration gave. Deleted payments
9
+ aren't listed, nor are those of a deleted registration (deleting one
10
+ deletes its payments): money they record still moved, so a gap when
11
+ reconciling may be one of them. -#}
12
+ {%- set dated = payments | selectattr('paid_on') | sort(attribute='id') | sort(attribute='paid_on') | list -%}
13
+ {%- set undated = payments | rejectattr('paid_on') | sort(attribute='id') | list -%}
14
+ ID,Paid On,Recorded,Kind,Method,Amount,Registration,Payer,Registrant Email,Invoice,Refund Of,PayPal ID,Notes
15
+ {% for payment in dated + undated -%}
16
+ {%- set reg = payment.registration -%}
17
+ {%- set billing = (reg.attributes.payment or {}) if reg else {} -%}
18
+ {%- set invoice = payment.invoice -%}
19
+ {%- set paypal = payment.paypal_response or {} -%}
20
+ {%- if payment.is_refund -%}
21
+ {%- set paypal_id = paypal.id or '' -%}
22
+ {%- else -%}
23
+ {%- set unit = (paypal.purchase_units or []) | first or {} -%}
24
+ {%- set capture = ((unit.payments or {}).captures or []) | first or {} -%}
25
+ {%- set paypal_id = capture.id or '' -%}
26
+ {%- endif -%}
27
+ {{ payment.id }},
28
+ {{- payment.paid_on | date }},
29
+ {{- payment.created_at | datetime }},
30
+ {{- 'Refund' if payment.is_refund else 'Payment' }},
31
+ {{- (payment.payment_type or '') | csv }},
32
+ {{- payment.amount | money | csv }},
33
+ {{- reg.id if reg else '' }},
34
+ {{- ((billing.payer_first_name or '') ~ ' ' ~ (billing.payer_last_name or '')) | trim | csv }},
35
+ {{- ((reg.registrant_email if reg else '') or '') | csv }},
36
+ {{- (('#' ~ invoice.id ~ ((' ' ~ invoice.description) if invoice.description else '')) if invoice else '') | csv }},
37
+ {{- payment.refund_of.id if payment.refund_of else '' }},
38
+ {{- paypal_id | csv }},
39
+ {{- (payment.notes or '') | csv }}
40
+ {% endfor -%}
@@ -0,0 +1,64 @@
1
+ {#- Meal income: for each meal plan and price tier, how many campers and what
2
+ they were charged for meals (camper.pricing.meals, the camper's actual
3
+ Meals line). Campers whose meals cost nothing (free-meal registration
4
+ types, instructor meal rate, food trade) are left out, so they don't count
5
+ in the Grand Total either. The first-time camper referrer promo code's meal discount is its own
6
+ row, then the grand total. A registrar's override shows in Total as the
7
+ amount charged, so Total can differ from Qty x Unit Price; an override that
8
+ charges a camper with no meal plan lands on Other meal charges. Prices and
9
+ tiers follow camperPricingLogic.ts: 12 and up pay the adult price, 0-11 the
10
+ youth (Child) price. -#}
11
+ {%- set plans = [
12
+ ('All Meals', 'full'),
13
+ ('All Meals - 1st half', 'half'),
14
+ ('All Meals - 2nd half', 'half'),
15
+ ('Just Dinners', 'dinners'),
16
+ ] -%}
17
+ {%- set child_ages = ['0-4 years old', '5-11 years old'] -%}
18
+ {%- set rows = [] -%}
19
+ {%- for camper in campers -%}
20
+ {%- set charged = camper.pricing.meals or 0 -%}
21
+ {%- do rows.append({
22
+ 'plan': (camper.attributes.meals or {}).meal_plan,
23
+ 'tier': 'Child' if camper.attributes.age in child_ages else 'Adult',
24
+ 'charged': charged,
25
+ }) -%}
26
+ {%- endfor -%}
27
+
28
+ {#- The referrer code is this event's only registration-scoped promo code, and
29
+ it comes off meals only. A camper-scoped code (first-time camper, off
30
+ tuition) puts a promo line on each camper, so a registration whose campers
31
+ have none used the referrer code. Templates can't see which code was used,
32
+ so a registration-scoped code an admin adds in Camphoric would land on
33
+ this row too, and come off the Grand Total. -#}
34
+ {%- set discount = namespace(count=0, total=0) -%}
35
+ {%- for registration in registrations -%}
36
+ {%- set promo = registration.pricing.promo or 0 -%}
37
+ {%- set camper_scoped = namespace(found=false) -%}
38
+ {%- for camper in registration.campers if 'promo' in camper.pricing -%}
39
+ {%- set camper_scoped.found = true -%}
40
+ {%- endfor -%}
41
+ {%- if promo and not camper_scoped.found -%}
42
+ {%- set discount.count = discount.count + 1 -%}
43
+ {%- set discount.total = discount.total + promo -%}
44
+ {%- endif -%}
45
+ {%- endfor -%}
46
+
47
+ {%- set plan_names = plans | map('first') | list -%}
48
+ {%- set paid = rows | selectattr('plan', 'in', plan_names) | selectattr('charged') | list -%}
49
+ {#- A registrar's override can charge a camper with no meal plan for meals -#}
50
+ {%- set other = rows | rejectattr('plan', 'in', plan_names) | selectattr('charged') | list -%}
51
+ {%- set counted = paid + other -%}
52
+ Meal Plan,Tier,Qty,Unit Price,Total
53
+ {%- for plan, size in plans -%}
54
+ {%- for tier, price in [
55
+ ('Adult', event.pricing['meals_adult_' ~ size]),
56
+ ('Child', event.pricing['meals_youth_' ~ size]),
57
+ ] -%}
58
+ {%- set matched = paid | selectattr('plan', '==', plan) | selectattr('tier', '==', tier) | list %}
59
+ {{ plan }},{{ tier }},{{ matched | length }},{{ price | money | csv }},{{ matched | sum(attribute='charged') | money | csv }}
60
+ {%- endfor -%}
61
+ {%- endfor %}
62
+ Other meal charges,,{{ other | length }},,{{ other | sum(attribute='charged') | money | csv }}
63
+ Referrer promo meal discount (registration-scoped codes),,{{ discount.count }},,{{ discount.total | money | csv }}
64
+ Grand Total,,{{ counted | length }},,{{ ((counted | sum(attribute='charged')) + discount.total) | money | csv }}
@@ -0,0 +1,89 @@
1
+ {#- Non-meal income: what campers and registrations were charged for
2
+ everything except meals, by category, then the grand total. Totals add up
3
+ each camper's and registration's actual pricing lines, so free campers,
4
+ discounts and registrar overrides count as charged. Qty counts the campers
5
+ (or registrations, invoices, passes) with a non-zero amount in that
6
+ category. Meals and the referrer's registration-scoped meal discount are
7
+ on Admin, meal income. A camper's total never goes below $0, so a credit
8
+ bigger than their charges (a campership for a free camper, say) is only
9
+ partly used: the adjustment row adds back what wasn't, as does a
10
+ registrar's override of a camper's total. -#}
11
+ {%- set c = namespace(
12
+ tuition=0, tuition_n=0,
13
+ enrollment=0, enrollment_n=0,
14
+ parking=0, parking_n=0,
15
+ badge=0, badge_n=0,
16
+ custom=0, custom_n=0,
17
+ promo=0, promo_n=0,
18
+ adjust=0, adjust_n=0,
19
+ ) -%}
20
+ {%- for camper in campers -%}
21
+ {%- set p = camper.pricing or {} -%}
22
+ {%- if p.tuition -%}
23
+ {%- set c.tuition = c.tuition + p.tuition -%}
24
+ {%- set c.tuition_n = c.tuition_n + 1 -%}
25
+ {%- endif -%}
26
+ {%- if p.enrollment_fee -%}
27
+ {%- set c.enrollment = c.enrollment + p.enrollment_fee -%}
28
+ {%- set c.enrollment_n = c.enrollment_n + 1 -%}
29
+ {%- endif -%}
30
+ {%- if p.parking -%}
31
+ {%- set c.parking = c.parking + p.parking -%}
32
+ {%- set c.parking_n = c.parking_n + (p.parking_pass_count or 0) -%}
33
+ {%- endif -%}
34
+ {%- if p.name_badge -%}
35
+ {%- set c.badge = c.badge + p.name_badge -%}
36
+ {%- set c.badge_n = c.badge_n + 1 -%}
37
+ {%- endif -%}
38
+ {%- if p.custom_charges -%}
39
+ {%- set c.custom = c.custom + p.custom_charges -%}
40
+ {%- set c.custom_n = c.custom_n + 1 -%}
41
+ {%- endif -%}
42
+ {#- A camper-scoped promo code (first-time camper) comes off tuition -#}
43
+ {%- if p.promo -%}
44
+ {%- set c.promo = c.promo + p.promo -%}
45
+ {%- set c.promo_n = c.promo_n + 1 -%}
46
+ {%- endif -%}
47
+ {#- What the camper's total differs from their lines by (meals included,
48
+ as Admin, meal income counts them as charged) -#}
49
+ {%- if p.total is not none and p.total is defined -%}
50
+ {%- set adjust = p.total - ((p.tuition or 0) + (p.enrollment_fee or 0)
51
+ + (p.meals or 0) + (p.parking or 0) + (p.name_badge or 0)
52
+ + (p.custom_charges or 0) + (p.promo or 0)) -%}
53
+ {%- if adjust -%}
54
+ {%- set c.adjust = c.adjust + adjust -%}
55
+ {%- set c.adjust_n = c.adjust_n + 1 -%}
56
+ {%- endif -%}
57
+ {%- endif -%}
58
+ {%- endfor -%}
59
+
60
+ {%- set r = namespace(donation=0, donation_n=0, handling=0, handling_n=0) -%}
61
+ {%- for registration in registrations -%}
62
+ {%- set donation = (registration.pricing or {}).donation -%}
63
+ {%- if donation -%}
64
+ {%- set r.donation = r.donation + donation -%}
65
+ {%- set r.donation_n = r.donation_n + 1 -%}
66
+ {%- endif -%}
67
+ {#- The e-payment handling fee is charged on each invoice paid online -#}
68
+ {%- for invoice in registration.invoices if invoice.handling and not invoice.cancelled_at -%}
69
+ {%- set r.handling = r.handling + invoice.handling -%}
70
+ {%- set r.handling_n = r.handling_n + 1 -%}
71
+ {%- endfor -%}
72
+ {%- endfor -%}
73
+
74
+ {%- set lines = [
75
+ ('Tuition', 'campers', c.tuition_n, c.tuition),
76
+ ('Camper promo code discounts', 'campers', c.promo_n, c.promo),
77
+ ('Crew enrollment fees', 'campers', c.enrollment_n, c.enrollment),
78
+ ('Parking passes', 'passes', c.parking_n, c.parking),
79
+ ('Name badges', 'campers', c.badge_n, c.badge),
80
+ ('Custom charges', 'campers', c.custom_n, c.custom),
81
+ ('Camper total adjustments (totals stop at $0)', 'campers', c.adjust_n, c.adjust),
82
+ ('Donations', 'registrations', r.donation_n, r.donation),
83
+ ('E-payment handling fees', 'invoices', r.handling_n, r.handling),
84
+ ] -%}
85
+ Category,Qty,Counted,Total
86
+ {%- for label, unit, qty, total in lines %}
87
+ {{ label }},{{ qty }},{{ unit }},{{ total | money | csv }}
88
+ {%- endfor %}
89
+ Grand Total,,,{{ lines | map(attribute=3) | sum | money | csv }}
@@ -43,7 +43,7 @@ last,first,age,crew,camp,lodging,email,phone,parking,tenttag,session,arrived,id
43
43
  {{- crew or 'Camper' }},
44
44
  {{- camp }},
45
45
  {{- lodging_short}},
46
- {{- camper.attributes.email or camper.registration.registrant_email or '-'}},\
46
+ {{- camper.attributes.email or camper.registration.registrant_email or '-'}},
47
47
  {{- (camper.registration.attributes.payment or {}).payer_number or '-'}},
48
48
  {{- '"' ~ parking.text -}}",
49
49
  {%- if not lodging_set -%}
@@ -51,7 +51,7 @@ last,first,age,crew,camp,lodging,email,phone,parking,tenttag,session,arrived,id
51
51
  {%- elif 'Tent' in full_path and tent_tag_holder.id == camper.id -%}
52
52
  {{ full_path[full_path.find('→Spot '):] | replace('→Spot ', '') }}
53
53
  {%- elif 'Tent' in full_path and tent_tag_holder.attributes.first_name -%}
54
- under {{ tent_tag_holder.attributes.first_name }} {{ tent_tag_holder.attributes.last_name }}
54
+ {{ ('under ' ~ (tent_tag_holder.attributes.first_name or '') ~ ' ' ~ (tent_tag_holder.attributes.last_name or '')) | csv }}
55
55
  {%- else -%}
56
56
  NONE
57
57
  {%- endif -%},
@@ -38,8 +38,8 @@
38
38
  {%- endfor -%}
39
39
  first, last, crew, lodging, arrival_date, park, email
40
40
  {% for row in rows | sort(attribute="camp") | sort(attribute="camper.attributes.last_name") if row.camp in camps -%}
41
- {{ row.camper.attributes.first_name }},
42
- {{- row.camper.attributes.last_name }},
41
+ {{ row.camper.attributes.first_name | csv }},
42
+ {{- row.camper.attributes.last_name | csv }},
43
43
  {{- row.crew or 'none' }},
44
44
  {{- row.lodging_short}},
45
45
  {{- row.camper.stay[0] }},
@@ -12,8 +12,8 @@ last, first, age, crew, lodging, balance, created
12
12
  | replace('RV→', '')
13
13
  | replace('Cooks Cabin', 'Cook')
14
14
  | replace('Cabin ', 'Cbn') -%}
15
- {{ camper.attributes.first_name }},
16
- {{- camper.attributes.last_name }},
15
+ {{ camper.attributes.first_name | csv }},
16
+ {{- camper.attributes.last_name | csv }},
17
17
  {{- camper.attributes.age }},
18
18
  {{- crew or 'camper' }},
19
19
  {{- lodging_short}},
@@ -14,19 +14,19 @@ last, first, crew, diff, zip, state, city, address, country, camp, session, arri
14
14
  {% for row in rows | sort(attribute="zip_code") -%}
15
15
  {%- set camper = row.camper -%}
16
16
  {%- set crew = camper.registration.registration_type.name if camper.registration.registration_type -%}
17
- {{ '"' ~ (camper.attributes.first_name or '') }}",
18
- {{- '"' ~ (camper.attributes.last_name or '') }}",
19
- {{- '"' ~ (crew or 'camper') }}",
20
- {{- '"' ~ (camper.attributes.address_different_than_payer | string) }}",
21
- {{- '"' ~ (row.address.zip_code or '') }}",
22
- {{- '"' ~ (row.address.state_or_province or '') }}",
23
- {{- '"' ~ (row.address.city or '') }}",
24
- {{- '"' ~ (row.address.street_address or '') }}",
25
- {{- '"' ~ (row.address.country or '') }}",
26
- {{- '"' ~ row.camp }}",
27
- {{- '"' ~ (camper.attributes.session or '') }}",
28
- {{- '"' ~ ( camper.stay[0] if camper.stay else '??' ) }}",
29
- {{- '"' ~ (camper.attributes.email or camper.registration.registrant_email or '-')}}",
17
+ {{ (camper.attributes.first_name or '') | csv }},
18
+ {{- (camper.attributes.last_name or '') | csv }},
19
+ {{- (crew or 'camper') | csv }},
20
+ {{- (camper.attributes.address_different_than_payer | string) | csv }},
21
+ {{- (row.address.zip_code or '') | csv }},
22
+ {{- (row.address.state_or_province or '') | csv }},
23
+ {{- (row.address.city or '') | csv }},
24
+ {{- (row.address.street_address or '') | csv }},
25
+ {{- (row.address.country or '') | csv }},
26
+ {{- row.camp | csv }},
27
+ {{- (camper.attributes.session or '') | csv }},
28
+ {{- ( camper.stay[0] if camper.stay else '??' ) | csv }},
29
+ {{- (camper.attributes.email or camper.registration.registrant_email or '-') | csv }},
30
30
  {#- TODO: `attributes.phone` isn't a Lark camper field, so this always falls back to the payer's number. #}
31
- {{- '"' ~ (camper.attributes.phone or (camper.registration.attributes.payment or {}).payer_number or '-')}}"
31
+ {{- (camper.attributes.phone or (camper.registration.attributes.payment or {}).payer_number or '-') | csv }}
32
32
  {% endfor -%}
@@ -84,8 +84,8 @@ last,first,lodging,registration_type,parking_type,stay,balance_due,meal_plan,mea
84
84
  {% for row in rows | sort(attribute="full_path") if row.crew_key in crewLeadLookup.keys() -%}
85
85
  {%- set camper = row.camper -%}
86
86
  {%- set lead = crewLeadLookup[row.crew_key][row.camp] if row.crew and row.camp -%}
87
- {{- camper.attributes.last_name }},
88
- {{- camper.attributes.first_name }},
87
+ {{- camper.attributes.last_name | csv }},
88
+ {{- camper.attributes.first_name | csv }},
89
89
  {{- row.full_path}},
90
90
  {{- row.crew or 'none' }},
91
91
  {{- parking_short[row.parking] or '-'}},
@@ -37,5 +37,5 @@ first, last, crew, lodging, park, email
37
37
  {%- endfor -%}
38
38
  {%- set parking.text = parking.text ~ ')' if camper.id != last_camper.id else parking.text -%}
39
39
  {%- endif -%}
40
- {{ camper.attributes.first_name }}, {{ camper.attributes.last_name }}, {{ crew or 'camper' }}, {{lodging_short}},"{{parking.text}}", {{ camper.registration.registrant_email }}
40
+ {{ camper.attributes.first_name | csv }},{{ camper.attributes.last_name | csv }},{{ crew or 'camper' }},{{lodging_short}},"{{parking.text}}",{{ camper.registration.registrant_email }}
41
41
  {% endfor -%}
@@ -31,8 +31,8 @@ first, last, crew, lodging, park, email, session, days, parking passes, parking
31
31
  {%- set parking = 'Vehicle Camp 2' if 'Camp 2' in full_path and 'RV' in full_path else parking -%}
32
32
  {%- set parking = 'Vehicle Camp 3' if 'Camp 3' in full_path and 'RV' in full_path else parking -%}
33
33
  {%- endif -%}
34
- {{ camper.attributes.first_name }},
35
- {{- camper.attributes.last_name }},
34
+ {{ camper.attributes.first_name | csv }},
35
+ {{- camper.attributes.last_name | csv }},
36
36
  {{- crew or 'camper' }},
37
37
  {{- lodging_short}},
38
38
  {{- parking_short[parking] or '-'}},
@@ -45,5 +45,5 @@ first, last, crew, lodging, park, email, session, days, parking passes, parking
45
45
  {%- set pass_holder = camper if passes else (camper.registration.campers | selectattr('attributes.parking_passes') | first) -%}
46
46
  {%- set pass_holder = pass_holder or camper.registration.campers[0] -%}
47
47
  {{- passes | length }},
48
- {{- '"' ~ (pass_holder.attributes.last_name or '') }}, {{- pass_holder.attributes.first_name }}"
48
+ {{- ((pass_holder.attributes.last_name or '') ~ ',' ~ (pass_holder.attributes.first_name or '')) | csv }}
49
49
  {% endfor -%}
@@ -1,4 +1,4 @@
1
1
  Last Name, First Name, Age, Lodging, Sharing, Sharing with, Attendance
2
2
  {% for camper in campers | sort(attribute="attributes.last_name") -%}
3
- {{camper.attributes.first_name}}, {{camper.attributes.last_name}}, {{camper.attributes.age}}, {{- camper.lodging.path_names | join('→') if camper.lodging else 'Not assigned' }}, {{camper.lodging_shared}}, {{camper.lodging_shared_with | replace (',', ' and ') }}, {{camper.attributes.session}}
3
+ {{ camper.attributes.first_name | csv }},{{ camper.attributes.last_name | csv }},{{camper.attributes.age}}, {{- camper.lodging.path_names | join('→') if camper.lodging else 'Not assigned' }},{{camper.lodging_shared}},{{ camper.lodging_shared_with | replace(',', ' and ') | csv }},{{camper.attributes.session}}
4
4
  {% endfor %}
@@ -6,5 +6,5 @@
6
6
  Last Name, First Name, Age, Lodging, Sharing, Sharing with, Attendance
7
7
  {% for row in rows | sort(attribute="path_names") -%}
8
8
  {%- set camper = row.camper -%}
9
- {{camper.attributes.first_name}}, {{camper.attributes.last_name}}, {{camper.attributes.age}}, {{- camper.lodging.path_names | join('→') if camper.lodging else 'Not assigned' }}, {{camper.lodging_shared}}, {{camper.lodging_shared_with | replace(',', " and ")}}, {{ camper.attributes.session }}
9
+ {{ camper.attributes.first_name | csv }},{{ camper.attributes.last_name | csv }},{{camper.attributes.age}}, {{- camper.lodging.path_names | join('→') if camper.lodging else 'Not assigned' }},{{camper.lodging_shared}},{{ camper.lodging_shared_with | replace(',', ' and ') | csv }},{{ camper.attributes.session }}
10
10
  {% endfor %}
@@ -12,13 +12,16 @@ first, last, crew, age, need_forms, got_forms, lodging, registered_with, email
12
12
  | replace('RV→', '')
13
13
  | replace('Cooks Cabin', 'Cook')
14
14
  | replace('Cabin ', 'Cbn') -%}
15
- {{ camper.attributes.first_name }},
16
- {{- camper.attributes.last_name }},
15
+ {{ camper.attributes.first_name | csv }},
16
+ {{- camper.attributes.last_name | csv }},
17
17
  {{- crew or 'none' }},
18
18
  {{- camper.attributes.age }},
19
19
  {{- 'Yes' if camper.admin_attributes.guardian_forms_required else 'No' }},
20
20
  {{- 'Yes' if camper.admin_attributes.guardian_forms_received else 'No' }},
21
- {{- lodging_short }}, "{%- for c in camper.registration.campers -%}
22
- {{- c.attributes.first_name }} {{ (c.attributes.last_name or '') ~ ';' -}}{%- endfor -%}",
21
+ {%- set registered_with = [] -%}
22
+ {%- for c in camper.registration.campers -%}
23
+ {%- do registered_with.append((c.attributes.first_name or '') ~ ' ' ~ (c.attributes.last_name or '') ~ ';') -%}
24
+ {%- endfor -%}
25
+ {{- lodging_short }},{{ registered_with | join('') | csv }},
23
26
  {{- camper.registration.registrant_email }}
24
27
  {% endfor -%}
@@ -29,8 +29,8 @@ last, first, crew, lodging, park, email, tent tag, session, row
29
29
  {%- set parking = 'Vehicle Camp 3' if 'Camp 3' in full_path and 'RV' in full_path else parking -%}
30
30
  {%- endif -%}
31
31
  {%- set tent_tag_holder = (camper.lodging.campers | selectattr('attributes.session', '==', camper.attributes.session) | sort(attribute="index,attributes.last_name,attributes.first_name") | first) if 'Tent' in full_path -%}
32
- {{ camper.attributes.last_name }},
33
- {{- camper.attributes.first_name }},
32
+ {{ camper.attributes.last_name | csv }},
33
+ {{- camper.attributes.first_name | csv }},
34
34
  {{- crew or 'Camper' }},
35
35
  {{- lodging_short}},
36
36
  {{- parking_short[parking] or '-'}},
@@ -38,7 +38,7 @@ last, first, crew, lodging, park, email, tent tag, session, row
38
38
  {%- if 'Tent' in full_path and tent_tag_holder.id == camper.id -%}
39
39
  tent tag {{ full_path[full_path.find('→Spot '):] | replace('→Spot ', '') }}
40
40
  {%- elif 'Tent' in full_path -%}
41
- under {{ tent_tag_holder.attributes.first_name }} {{ tent_tag_holder.attributes.last_name }}
41
+ {{ ('under ' ~ (tent_tag_holder.attributes.first_name or '') ~ ' ' ~ (tent_tag_holder.attributes.last_name or '')) | csv }}
42
42
  {%- else -%}
43
43
  NONE
44
44
  {%- endif -%},
@@ -29,10 +29,10 @@ camper,badge_title,badge_name,badge_gender,camp,arrive_thurs,amt,reg_date
29
29
  {%- set camp = camper.lodging.path_names[0] if camper.lodging -%}
30
30
  {%- set badge_title = 'Reg Volunteer' if camper.admin_attributes.registration_volunteer else '' -%}
31
31
  {%- set badge_title = (camper.admin_attributes.badge_role or type_display[crew] or badge_title) -%}
32
- {{- '"' ~ (camper.attributes.first_name or '') }} {{ camper.attributes.last_name }}",
33
- {{- '"' ~ badge_title ~ '"'}},
34
- {{- '"' ~ (camper.attributes.name_badge.name or '') }}",
35
- {{- '"' ~ (camper.attributes.name_badge.pronouns if camper.attributes.name_badge.pronouns else '') ~ '"' }},
32
+ {{- ((camper.attributes.first_name or '') ~ ' ' ~ (camper.attributes.last_name or '')) | csv }},
33
+ {{- badge_title | csv }},
34
+ {{- (camper.attributes.name_badge.name or '') | csv }},
35
+ {{- (camper.attributes.name_badge.pronouns or '') | csv }},
36
36
  {{- camp }},
37
37
  {{- "yes" if camper.stay and camper.stay[0] == early_day else "" }},
38
38
  {{- camper.pricing.name_badge or 0 }},
@@ -6,10 +6,10 @@ first, last, crew, lodging, park, email
6
6
  {%- if not registration.admin_attributes.parking_exception -%}
7
7
  {%- continue -%}
8
8
  {%- endif -%}
9
- {{- camper.attributes.first_name }},
10
- {{- camper.attributes.last_name }},
9
+ {{- camper.attributes.first_name | csv }},
10
+ {{- camper.attributes.last_name | csv }},
11
11
  {{- registration.registration_type.name if registration.registration_type else 'camper' }},
12
12
  {{- camper.lodging.full_name if camper.lodging }},
13
- {{- registration.admin_attributes.parking_exception or '-'}},
14
- {{- registration.registrant_email or '-'}},
13
+ {{- (registration.admin_attributes.parking_exception or '-') | csv }},
14
+ {{- registration.registrant_email or '-'}}
15
15
  {% endfor -%}
@@ -1,8 +1,8 @@
1
1
  first, last, email, total, payments, balance, type
2
2
  {% for camper in campers | sort(False, attribute='attributes.last_name') | sort(True, attribute='registration.balance') -%}
3
3
  {%- set registration_type = camper.registration.registration_type -%}
4
- {{ camper.attributes.first_name }},
5
- {{- camper.attributes.last_name }},
4
+ {{ camper.attributes.first_name | csv }},
5
+ {{- camper.attributes.last_name | csv }},
6
6
  {{- camper.attributes.email or camper.registration.registrant_email or '-'}},
7
7
  {{- camper.registration.total_owed}},
8
8
  {{- camper.registration.total_paid}},
@@ -41,5 +41,5 @@ first, last, crew, arrives, lodging, park, pre-meals?, email
41
41
  {%- if crew == 'kitchen-partial' -%}{%- set comp_reason = 'kitchen' -%}{%- endif -%}
42
42
  {%- if camper.admin_attributes.food_trade_only -%}{%- set comp_reason = 'trade' -%}{%- endif -%}
43
43
  {%- endif -%}
44
- {{ camper.attributes.first_name }}, {{ camper.attributes.last_name }}, {{ crew or 'camper' }}, {{ camper.stay[0] }}, {{lodging_short}}, {{parking_short[parking] or '-'}}, {{ comp_reason or 'NO COMP' }}, {{ camper.registration.registrant_email }}
44
+ {{ camper.attributes.first_name | csv }},{{ camper.attributes.last_name | csv }},{{ crew or 'camper' }},{{ camper.stay[0] }},{{lodging_short}},{{parking_short[parking] or '-'}},{{ comp_reason or 'NO COMP' }},{{ camper.registration.registrant_email }}
45
45
  {% endfor -%}
@@ -9,9 +9,11 @@ campers,session,camp,tag
9
9
  {%- if (spot.campers | selectattr('attributes.session', '==', session) | list | length) < 1 -%}
10
10
  {%- continue -%}
11
11
  {%- endif -%}
12
- "{%- for camper in spot.campers | sort(attribute="index,attributes.last_name,attributes.first_name") if camper.attributes.session == session -%}
13
- {{- camper.attributes.first_name }} {{ camper.attributes.last_name }}{{- ',' if not loop.last else '' -}}
14
- {%- endfor -%}",
12
+ {%- set names = [] -%}
13
+ {%- for camper in spot.campers | sort(attribute="index,attributes.last_name,attributes.first_name") if camper.attributes.session == session -%}
14
+ {%- do names.append((camper.attributes.first_name or '') ~ ' ' ~ (camper.attributes.last_name or '')) -%}
15
+ {%- endfor -%}
16
+ {{ names | join(',') | csv }},
15
17
  {{- session_short[session] }},
16
18
  {{- spot.path_names[0] -}},
17
19
  {{- spot.path_names[-1].removeprefix('Spot ') }}{%- if '1st' in session -%}A{%- elif '2nd' in session -%}B{%- else -%}{%- endif %}
@@ -40,23 +40,25 @@ Last, First, Age, Guardian, GForms, Crew, Title, Lodging, Stay, Park, VLicense,
40
40
  {%- if 'Camp 3' in full_lodging_path and 'RV' in full_lodging_path -%}{%- set parking = 'Vehicle Camp 3' -%}{%- endif -%}
41
41
  {%- endif -%}
42
42
  {%- set lodging_short = lodging_short | replace('Camp ', 'C') -%}
43
- {{ '"' + camper.attributes.last_name }}",
44
- {{- '"' + camper.attributes.first_name }}",
45
- {{- camper.attributes.age[:camper.attributes.age.find(' ')] | replace('65', '65+') }},
46
- {{- '"' + (camper.admin_attributes.guardian_name if 'guardian_name' in camper.admin_attributes else '') }}",
43
+ {{ camper.attributes.last_name | csv }},
44
+ {{- camper.attributes.first_name | csv }},
45
+ {{- (camper.attributes.age or '').split(' ')[0] | replace('65', '65+') }},
46
+ {{- (camper.admin_attributes.guardian_name if 'guardian_name' in camper.admin_attributes else '') | csv }},
47
47
  {{- 'Yes' if camper.admin_attributes.guardian_forms_required else '' }},
48
48
  {{- (crew | replace('crew-', '') | replace('-partial', '') | replace('-full', '')) or '-' }},
49
- {{- '"' + (camper.admin_attributes.crew_exception if 'crew_exception' in camper.admin_attributes else '' )}}",
49
+ {{- (camper.admin_attributes.crew_exception if 'crew_exception' in camper.admin_attributes else '') | csv }},
50
50
  {{- lodging_short }},
51
51
  {{- session_short[camper.attributes.session] }},
52
52
  {{- ((parking_passes | length | string) + 'x' + parking_short[parking]) if parking_passes else '-' }},
53
53
  {%- if camper.admin_attributes.vehicles -%}
54
- {{- '"' + (camper.admin_attributes.vehicles | map(attribute="license", default="-") | join('\n')) -}}",
55
- {{- '"' + (camper.admin_attributes.vehicles | map(attribute="state", default="-") | join('\n')) -}}",
56
- {{- '"' -}}{%- for v in camper.admin_attributes.vehicles -%}
57
- {{- v.year }} {{ v.color }} {{ v.make }} {{ v.model }}{{ '' if loop.last else '\n' }}
58
- {%- endfor -%}",
59
- {{- '"' + (camper.admin_attributes.vehicles | map(attribute="passengers") | map('join', ',') | join('\n')) -}}"
54
+ {{- (camper.admin_attributes.vehicles | map(attribute="license", default="-") | join('\n')) | csv -}},
55
+ {{- (camper.admin_attributes.vehicles | map(attribute="state", default="-") | join('\n')) | csv -}},
56
+ {%- set descriptions = [] -%}
57
+ {%- for v in camper.admin_attributes.vehicles -%}
58
+ {%- do descriptions.append(v.year ~ ' ' ~ v.color ~ ' ' ~ v.make ~ ' ' ~ v.model) -%}
59
+ {%- endfor -%}
60
+ {{- descriptions | join('\n') | csv -}},
61
+ {{- (camper.admin_attributes.vehicles | map(attribute="passengers") | map('join', ',') | join('\n')) | csv -}}
60
62
  {%- else -%}
61
63
  -, -, -, -
62
64
  {%- endif -%},
@@ -42,8 +42,8 @@
42
42
  first, last, crew, lodging, arrival_date, park, badge, email
43
43
  {% for camper in campers | sort(attribute="attributes.last_name") if camper.admin_attributes.crew_exception == manager -%}
44
44
  {%- set crew_type = camper.registration.registration_type or {} -%}
45
- {{ camper.attributes.first_name }},
46
- {{- camper.attributes.last_name }},
45
+ {{ camper.attributes.first_name | csv }},
46
+ {{- camper.attributes.last_name | csv }},
47
47
  {{- crew_type.label or 'none' }},
48
48
  {{- lodging_short(camper.lodging) }},
49
49
  {{- camper.stay[0] if camper.stay }},
@@ -52,8 +52,8 @@ first, last, crew, lodging, arrival_date, park, badge, email
52
52
  {% endfor -%}
53
53
  {% for camper in campers | sort(attribute="attributes.last_name") if (((camper.registration.registration_type or {}).name in crew) and camper.admin_attributes.crew_exception != manager) -%}
54
54
  {%- set crew_type = camper.registration.registration_type or {} -%}
55
- {{ camper.attributes.first_name }},
56
- {{- camper.attributes.last_name }},
55
+ {{ camper.attributes.first_name | csv }},
56
+ {{- camper.attributes.last_name | csv }},
57
57
  {{- crew_type.label or 'none' }},
58
58
  {{- lodging_short(camper.lodging) }},
59
59
  {{- camper.stay[0] if camper.stay }},
@@ -42,8 +42,8 @@
42
42
  first, last, crew, lodging, arrival_date, park, badge, email
43
43
  {% for camper in campers | sort(attribute="attributes.last_name") if camper.admin_attributes.crew_exception == manager -%}
44
44
  {%- set crew_type = camper.registration.registration_type or {} -%}
45
- {{ camper.attributes.first_name }},
46
- {{- camper.attributes.last_name }},
45
+ {{ camper.attributes.first_name | csv }},
46
+ {{- camper.attributes.last_name | csv }},
47
47
  {{- crew_type.label or 'none' }},
48
48
  {{- lodging_short(camper.lodging) }},
49
49
  {{- camper.stay[0] if camper.stay }},
@@ -52,8 +52,8 @@ first, last, crew, lodging, arrival_date, park, badge, email
52
52
  {% endfor -%}
53
53
  {% for camper in campers | sort(attribute="attributes.last_name") if (((camper.registration.registration_type or {}).name in crew) and camper.admin_attributes.crew_exception != manager) -%}
54
54
  {%- set crew_type = camper.registration.registration_type or {} -%}
55
- {{ camper.attributes.first_name }},
56
- {{- camper.attributes.last_name }},
55
+ {{ camper.attributes.first_name | csv }},
56
+ {{- camper.attributes.last_name | csv }},
57
57
  {{- crew_type.label or 'none' }},
58
58
  {{- lodging_short(camper.lodging) }},
59
59
  {{- camper.stay[0] if camper.stay }},
@@ -41,8 +41,8 @@
41
41
  first, last, crew, lodging, arrival_date, park, badge, email
42
42
  {% for camper in campers | sort(attribute="attributes.last_name") if (camper.registration.registration_type or {}).name == crew -%}
43
43
  {%- set crew_type = camper.registration.registration_type or {} -%}
44
- {{ camper.attributes.first_name }},
45
- {{- camper.attributes.last_name }},
44
+ {{ camper.attributes.first_name | csv }},
45
+ {{- camper.attributes.last_name | csv }},
46
46
  {{- crew_type.label or 'none' }},
47
47
  {{- lodging_short(camper.lodging) }},
48
48
  {{- camper.stay[0] if camper.stay }},
@@ -25,7 +25,7 @@ First, Last, Type, Session, Lodging, Meals, Arrived
25
25
  {%- set lodging_short = lodging_short[:lodging_short.find('→Spot')] if '→Spot' in lodging_short else lodging_short -%}
26
26
  {%- endif -%}
27
27
  {%- set meals = camper.attributes.meals or {} -%}
28
- {{camper.attributes.first_name}}, {{camper.attributes.last_name}}, {{ crew | replace('crew-kitchen-', '') }},
28
+ {{ camper.attributes.first_name | csv }},{{ camper.attributes.last_name | csv }},{{ crew | replace('crew-kitchen-', '') }},
29
29
  {{- session_short[camper.attributes.session] }},
30
30
  {{- lodging_short if ldg else 'Not assigned' }},
31
31
  {{- meals.meal_plan }}: {{- meals.meal_type }},
@@ -41,8 +41,8 @@
41
41
  first, last, crew, lodging, arrival_date, park, badge, email
42
42
  {% for camper in campers | sort(attribute="attributes.last_name") if (camper.registration.registration_type or {}).name == crew -%}
43
43
  {%- set crew_type = camper.registration.registration_type or {} -%}
44
- {{ camper.attributes.first_name }},
45
- {{- camper.attributes.last_name }},
44
+ {{ camper.attributes.first_name | csv }},
45
+ {{- camper.attributes.last_name | csv }},
46
46
  {{- crew_type.label or 'none' }},
47
47
  {{- lodging_short(camper.lodging) }},
48
48
  {{- camper.stay[0] if camper.stay }},
@@ -41,8 +41,8 @@
41
41
  first, last, crew, lodging, arrival_date, park, badge, email
42
42
  {% for camper in campers | sort(attribute="attributes.last_name") if (camper.registration.registration_type or {}).name == crew -%}
43
43
  {%- set crew_type = camper.registration.registration_type or {} -%}
44
- {{ camper.attributes.first_name }},
45
- {{- camper.attributes.last_name }},
44
+ {{ camper.attributes.first_name | csv }},
45
+ {{- camper.attributes.last_name | csv }},
46
46
  {{- crew_type.label or 'none' }},
47
47
  {{- lodging_short(camper.lodging) }},
48
48
  {{- camper.stay[0] if camper.stay }},
@@ -42,8 +42,8 @@
42
42
  first, last, crew, lodging, arrival_date, park, badge, email
43
43
  {% for camper in campers | sort(attribute="attributes.last_name") if (camper.registration.registration_type or {}).name == crew -%}
44
44
  {%- set crew_type = camper.registration.registration_type or {} -%}
45
- {{ camper.attributes.first_name }},
46
- {{- camper.attributes.last_name }},
45
+ {{ camper.attributes.first_name | csv }},
46
+ {{- camper.attributes.last_name | csv }},
47
47
  {{- crew_type.label or 'none' }},
48
48
  {{- lodging_short(camper.lodging) }},
49
49
  {{- camper.stay[0] if camper.stay }},