recess-cli 3.16.0 → 3.17.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.
@@ -74,10 +74,11 @@ function renderPlan(plan, webUrl, pdfPath) {
74
74
  p.scheduleLine,
75
75
  ])),
76
76
  // Award unknown: each payment is billed as is, or a ceiling for now.
77
- ...(esa
77
+ // Award confirmed: each payment is the family's share of the period.
78
+ ...(esa || plan.esaAward
78
79
  ? o.paymentPlans
79
80
  .filter((p) => p.kind !== "PAY_IN_FULL" && p.kind !== "STAFF_CUSTOM")
80
- .flatMap((p) => p.installments.map((inst) => ` ${p.kind === "MONTHLY" ? `invoiced ${inst.invoiceDate}, due ${inst.dueDate}` : `${inst.serviceStart} → ${inst.serviceEnd}`} tuition ${dollars(inst.fullTuitionCents ?? inst.amountCents)} you pay ${inst.award === "NONE" ? dollars(inst.amountCents) : `up to ${dollars(inst.amountCents)}`}${inst.illustrativeNote ? ` (${inst.illustrativeNote})` : ""} ${inst.note ?? ""}`))
81
+ .flatMap((p) => p.installments.map((inst) => ` ${p.kind === "MONTHLY" ? `invoiced ${inst.invoiceDate}, due ${inst.dueDate}` : `${inst.serviceStart} → ${inst.serviceEnd}`} tuition ${dollars(inst.fullTuitionCents ?? inst.amountCents)} you pay ${inst.award === "PENDING" ? `up to ${dollars(inst.amountCents)}` : dollars(inst.amountCents)}${inst.illustrativeNote ? ` (${inst.illustrativeNote})` : ""} ${inst.note ?? ""}`))
81
82
  : []),
82
83
  // A staff-written option: every row as the family will see it.
83
84
  ...o.paymentPlans
@@ -164,6 +165,16 @@ export function parseTuitionPlanSpecFlags(parsed) {
164
165
  }
165
166
  return `${key}=${date}`;
166
167
  });
168
+ const dueDates = flagList(parsed, "due-date").map((raw) => {
169
+ const [key, date] = raw.split("=").map((v) => v.trim().toLowerCase());
170
+ if (!key ||
171
+ !date ||
172
+ !/^(upfront|[1-9]\d*)$/.test(key) ||
173
+ !ISO_DATE.test(date)) {
174
+ throw new CliError("invalid_arguments", `--due-date takes upfront=YYYY-MM-DD or N=YYYY-MM-DD (installment N), got "${raw}".`);
175
+ }
176
+ return `${key}=${date}`;
177
+ });
167
178
  const amounts = flagList(parsed, "amount").map((raw) => {
168
179
  const [key, dollars] = raw.split("=").map((v) => v.trim());
169
180
  if (!key ||
@@ -190,6 +201,17 @@ export function parseTuitionPlanSpecFlags(parsed) {
190
201
  }
191
202
  // A staff-written option, as JSON inline or `@path/to/plan.json`; the
192
203
  // server validates it (CustomPlanSpecSchema).
204
+ // Award confirmed: --annual stays the no-award price; the sheet bills the
205
+ // family's share after the award and Recess aid.
206
+ const esaAward = flagString(parsed, "esa-award")?.trim().replace(/[$,]/g, "");
207
+ if (esaAward !== undefined) {
208
+ if (esaUnknown) {
209
+ throw new CliError("invalid_arguments", "Use --esa-award or --esa-award-unknown, not both.");
210
+ }
211
+ if (!/^\d+(\.\d{1,2})?$/.test(esaAward) || Number(esaAward) <= 0) {
212
+ throw new CliError("invalid_arguments", "--esa-award must be a positive dollar amount (the family's annual award).");
213
+ }
214
+ }
193
215
  const customRaw = flagString(parsed, "custom-plan")?.trim();
194
216
  let customPlan;
195
217
  if (customRaw) {
@@ -207,7 +229,7 @@ export function parseTuitionPlanSpecFlags(parsed) {
207
229
  customPlan = JSON.stringify(JSON.parse(text));
208
230
  }
209
231
  catch {
210
- throw new CliError("invalid_arguments", "--custom-plan takes JSON (or @file.json): {label, summary?, clause?, continueFrom?, rows: [{label, note?, amount?, amountText?, date?, when?}]}.");
232
+ throw new CliError("invalid_arguments", "--custom-plan takes JSON (or @file.json): {label, summary?, clause?, continueFrom?, rows: [{label, note?, amount?, amountText?, date?, due?, when?}]}.");
211
233
  }
212
234
  }
213
235
  const customOnly = hasFlag(parsed, "custom-only");
@@ -221,8 +243,10 @@ export function parseTuitionPlanSpecFlags(parsed) {
221
243
  : {}),
222
244
  ...(esaUnknown ? { esaAwardUnknown: "true" } : {}),
223
245
  ...(esaScenarios ? { esaScenarios } : {}),
246
+ ...(esaAward ? { esaAward: Number(esaAward) } : {}),
224
247
  ...(even ? { evenInstallments: "true" } : {}),
225
248
  ...(billDates.length ? { billDates: billDates.join(",") } : {}),
249
+ ...(dueDates.length ? { dueDates: dueDates.join(",") } : {}),
226
250
  ...(amounts.length ? { amounts: amounts.join(",") } : {}),
227
251
  ...(endDate ? { endDate } : {}),
228
252
  ...(terms ? { terms: terms.join(",") } : {}),
package/dist/help.js CHANGED
@@ -201,8 +201,8 @@ Usage:
201
201
  [--partner-school <slug|id>] [--force-direct] [--state-funding] [--elective-price DOLLARS]
202
202
  [--one-on-one-price DOLLARS] [--one-on-one-sessions N] [--end YYYY-MM-DD]
203
203
  [--terms full-year,school-year,custom] [--payments upfront,installments]
204
- [--note TEXT]... [--bill-date upfront|N=YYYY-MM-DD]... [--amount N=DOLLARS]... [--even-installments]
205
- [--esa-award-unknown [--esa-scenarios DOLLARS,...]] [--custom-plan JSON|@file] [--custom-only]
204
+ [--note TEXT]... [--bill-date upfront|N=YYYY-MM-DD]... [--due-date upfront|N=YYYY-MM-DD]... [--amount N=DOLLARS]... [--even-installments]
205
+ [--esa-award DOLLARS | --esa-award-unknown [--esa-scenarios DOLLARS,...]] [--custom-plan JSON|@file] [--custom-only]
206
206
  [--pdf <path>] [--open]
207
207
  recess [--json] tuition-plans states
208
208
  recess [--json] admissions create --school <institution-slug> --enrollment direct|partner-school|program
@@ -213,8 +213,8 @@ Usage:
213
213
  [--tier complete] [--paywall DOLLARS|--paywall-offline] [--staff-note TEXT]... [--no-email]
214
214
  (--no-agreement | --start YYYY-MM-DD --annual DOLLARS) [--state-funding] [--end YYYY-MM-DD]
215
215
  [--terms full-year,school-year,custom] [--payments upfront,installments] [--note TEXT]...
216
- [--bill-date upfront|N=YYYY-MM-DD]... [--amount N=DOLLARS]... [--even-installments] [--force-direct]
217
- [--esa-award-unknown [--esa-scenarios DOLLARS,...]] [--custom-plan JSON|@file] [--custom-only]
216
+ [--bill-date upfront|N=YYYY-MM-DD]... [--due-date upfront|N=YYYY-MM-DD]... [--amount N=DOLLARS]... [--even-installments] [--force-direct]
217
+ [--esa-award DOLLARS | --esa-award-unknown [--esa-scenarios DOLLARS,...]] [--custom-plan JSON|@file] [--custom-only]
218
218
  [--elective-price DOLLARS]
219
219
  [--one-on-one-price DOLLARS] [--one-on-one-sessions N] [--confirm]
220
220
  recess [--json] admissions get <packet-id>
@@ -750,8 +750,9 @@ Custom plans (--custom-plan, generate/create/requote): for an arrangement the
750
750
  computed options cannot express, e.g. a bridge payment until ESA funding
751
751
  starts. JSON inline or @file: {"label", "summary"?, "clause"?, "continueFrom"?,
752
752
  "rows": [{"label", "note"?, "amount"? (dollars), "amountText"?, "date"?
753
- (invoice date), "when"?}]}. Each row needs an amount or amountText and a date or
754
- when; the first row needs a date and an amount (the first invoice). Rows show
753
+ (invoice date), "due"? (due date; default 15 days after "date"), "when"?}]}.
754
+ Each row needs an amount or amountText and a date or when; the first row needs
755
+ a date and an amount (the first invoice). Rows show
755
756
  exactly as written; dated rows with amounts are real invoices. "continueFrom": N
756
757
  then carries on with the computed installment plan from installment N (e.g. a
757
758
  September bridge, then the regular quarters from 2). "continueOverrides": {"N":
@@ -788,6 +789,8 @@ still add up to the plan total, and it cannot combine with --even-installments o
788
789
  --esa-award-unknown. --note TEXT (repeatable) prints a note on the sheet. --bill-date (repeatable)
789
790
  moves an invoice date: upfront=YYYY-MM-DD for pay in full, N=YYYY-MM-DD for
790
791
  installment N in every term; due dates follow and dates must stay in order.
792
+ --due-date (repeatable, same keys) keeps the invoice date and sets when it is
793
+ due; once any due date is moved, the sheet prints every due date.
791
794
  --even-installments splits each installment plan evenly in whole dollars (any
792
795
  remainder on the first payment) instead of pricing each by its school days.
793
796
  --esa-award-unknown is for a family with no ESA award yet: --annual is their
@@ -803,6 +806,10 @@ tuition page lists installments on the ESA funding quarters (no pay in full): a
803
806
  start too late for approval (~30 days) to land in its quarter bills that quarter
804
807
  now with no award; every other payment shows "up to" its no-award amount. The
805
808
  agreement adds a clause that the plan is re-issued once the award is confirmed.
809
+ --esa-award DOLLARS is for a family whose annual ESA award is confirmed: --annual
810
+ stays their income-based price with no award, the award pays first, then Recess
811
+ aid, and every amount on the sheet is the family's share (each payment shows its
812
+ tuition and what the award and aid pay). Implies --state-funding; not Florida.
806
813
 
807
814
  Admissions notes: an admission packet is the one link a school family gets to go
808
815
  from "yes" to enrolled: create account, sign the tuition plan (and the partner
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "recess-cli",
3
- "version": "3.16.0",
3
+ "version": "3.17.0",
4
4
  "description": "Safe Recess administration and family AI tools from the command line.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {