recess-cli 3.57.0 → 3.58.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.
@@ -329,6 +329,9 @@ export async function runTuitionCommand({ parsed, api, writeCommand, }) {
329
329
  };
330
330
  });
331
331
  const note = textFlag(parsed, "note");
332
+ const annualCents = centsFlag(parsed, "annual");
333
+ const startDate = dateFlag(parsed, "start");
334
+ const endDate = dateFlag(parsed, "end");
332
335
  const body = {
333
336
  kidUserId,
334
337
  institutionSlug: textFlag(parsed, "school") ?? "recess-academy",
@@ -339,6 +342,9 @@ export async function runTuitionCommand({ parsed, api, writeCommand, }) {
339
342
  defaultCollection,
340
343
  installments,
341
344
  ...(note ? { note } : {}),
345
+ ...(annualCents !== undefined ? { annualTuitionCents: annualCents } : {}),
346
+ ...(startDate ? { startDate } : {}),
347
+ ...(endDate ? { endDate } : {}),
342
348
  };
343
349
  const { preview } = unwrap(await api.client.POST("/admin/tuition-billing/", {
344
350
  body: { ...body, dryRun: true },
@@ -435,6 +441,28 @@ export async function runTuitionCommand({ parsed, api, writeCommand, }) {
435
441
  on: "on",
436
442
  off: "off",
437
443
  });
444
+ const enrollmentType = choiceFlag(parsed, "enrollment", {
445
+ direct: "DIRECT",
446
+ "partner-school": "PARTNER_SCHOOL",
447
+ program: "PROGRAM",
448
+ });
449
+ const partnerSlug = textFlag(parsed, "partner-school");
450
+ const annualCents = centsFlag(parsed, "annual");
451
+ const startDate = dateFlag(parsed, "start");
452
+ const endRaw = flagString(parsed, "end")?.trim();
453
+ const endDate = endRaw === "none" ? null : dateFlag(parsed, "end");
454
+ const term = annualCents !== undefined || startDate || endRaw !== undefined
455
+ ? {
456
+ ...(annualCents !== undefined
457
+ ? { annualTuitionCents: annualCents }
458
+ : {}),
459
+ ...(startDate ? { startDate } : {}),
460
+ ...(endRaw !== undefined ? { endDate } : {}),
461
+ }
462
+ : null;
463
+ if (enrollmentType === "PARTNER_SCHOOL" && !partnerSlug) {
464
+ throw new CliError("invalid_arguments", "--enrollment partner-school needs --partner-school <slug>.");
465
+ }
438
466
  const body = verb === "pause"
439
467
  ? { paused: true, ...(note ? { pausedNote: note } : {}) }
440
468
  : verb === "resume"
@@ -443,16 +471,27 @@ export async function runTuitionCommand({ parsed, api, writeCommand, }) {
443
471
  ...(payer ? { payer } : {}),
444
472
  ...(defaultCollection ? { defaultCollection } : {}),
445
473
  ...(auto ? { autoInvoice: auto === "on" } : {}),
474
+ ...(term ? { term } : {}),
475
+ ...(enrollmentType
476
+ ? {
477
+ enrollment: {
478
+ type: enrollmentType,
479
+ ...(enrollmentType === "PARTNER_SCHOOL"
480
+ ? { partnerSchoolSlug: partnerSlug }
481
+ : {}),
482
+ },
483
+ }
484
+ : {}),
446
485
  };
447
486
  if (Object.keys(body).length === 0) {
448
- throw new CliError("invalid_arguments", "Nothing to change. Use --payer family|az-esa|fl-scholarship|partner-school, --collection invoice|auto-charge|out-of-band, or --auto-invoice on|off.");
487
+ throw new CliError("invalid_arguments", "Nothing to change. Use --payer family|az-esa|fl-scholarship|partner-school, --collection invoice|auto-charge|out-of-band, --auto-invoice on|off, --enrollment direct|partner-school|program, or --annual/--start/--end.");
449
488
  }
450
489
  return writeCommand(parsed, {
451
490
  action: verb === "pause"
452
491
  ? `pause tuition schedule ${scheduleId}: nothing on it is drafted or sent while paused`
453
492
  : verb === "resume"
454
493
  ? `resume tuition schedule ${scheduleId}`
455
- : `change tuition schedule ${scheduleId}'s settings${"autoInvoice" in body ? ` (automatic invoicing ${body.autoInvoice ? "ON: the daily run drafts, sends and chases its invoices" : "OFF"})` : ""}`,
494
+ : `change tuition schedule ${scheduleId}'s settings${"autoInvoice" in body ? ` (automatic invoicing ${body.autoInvoice ? "ON: the daily run drafts, sends and chases its invoices" : "OFF"})` : ""}${"enrollment" in body && body.enrollment ? ` (enrollment → ${body.enrollment.type}${body.enrollment.type === "PARTNER_SCHOOL" ? ` ${partnerSlug}` : ""})` : ""}`,
456
495
  target: { scheduleId },
457
496
  request: body,
458
497
  }, async () => shown(unwrap(await api.client.PATCH("/admin/tuition-billing/{scheduleId}", {
package/dist/help.js CHANGED
@@ -394,7 +394,7 @@ Usage:
394
394
  recess [--json] tuition list [--status NEEDS_REVIEW|SCHEDULED|DRAFTED|SENT|PAID|PAID_OUT_OF_BAND|VOID] [--family <family-id>] [--packet <packet-id>] [--q TEXT] [--limit N]
395
395
  recess [--json] tuition show <schedule-id>
396
396
  recess [--json] tuition edit <installment-id> [--amount DOLLARS] [--invoice-date YYYY-MM-DD] [--due-date YYYY-MM-DD] [--label TEXT] [--collection invoice|auto-charge|out-of-band|default] [--note TEXT] [--ask-family [--family-note TEXT]] [--confirm]
397
- recess [--json] tuition create --student <kid-id> --state XX --enrollment direct|partner-school|program [--partner-school <slug>] [--school <institution-slug>] [--payer family|az-esa|fl-scholarship|partner-school] [--collection invoice|auto-charge|out-of-band] --installment "LABEL|DOLLARS|INVOICE-DATE|DUE-DATE[|SERVICE-START|SERVICE-END]"... [--note TEXT] [--confirm]
397
+ recess [--json] tuition create --student <kid-id> --state XX --enrollment direct|partner-school|program [--partner-school <slug>] [--school <institution-slug>] [--payer family|az-esa|fl-scholarship|partner-school] [--collection invoice|auto-charge|out-of-band] --installment "LABEL|DOLLARS|INVOICE-DATE|DUE-DATE[|SERVICE-START|SERVICE-END]"... [--annual DOLLARS] [--start YYYY-MM-DD] [--end YYYY-MM-DD] [--note TEXT] [--confirm]
398
398
  recess [--json] tuition add <schedule-id> --label TEXT --amount DOLLARS --invoice-date YYYY-MM-DD --due-date YYYY-MM-DD [--collection invoice|auto-charge|out-of-band] [--note TEXT] [--ask-family [--family-note TEXT]] [--confirm]
399
399
  recess [--json] tuition release <installment-id> [--note TEXT] [--confirm]
400
400
  recess [--json] tuition void <installment-id> --reason TEXT [--ask-family [--family-note TEXT]] [--confirm]
@@ -411,7 +411,7 @@ Usage:
411
411
  recess [--json] tuition auto-invoice on|off (<schedule-id>... | --all) [--confirm]
412
412
  recess [--json] tuition pause <schedule-id> [--note TEXT] [--confirm]
413
413
  recess [--json] tuition resume <schedule-id> [--confirm]
414
- recess [--json] tuition set <schedule-id> [--payer family|az-esa|fl-scholarship|partner-school] [--collection invoice|auto-charge|out-of-band] [--auto-invoice on|off] [--confirm]
414
+ recess [--json] tuition set <schedule-id> [--payer family|az-esa|fl-scholarship|partner-school] [--collection invoice|auto-charge|out-of-band] [--auto-invoice on|off] [--enrollment direct|partner-school|program [--partner-school <slug>]] [--annual DOLLARS] [--start YYYY-MM-DD] [--end YYYY-MM-DD|none] [--confirm]
415
415
  recess [--json] admissions create --school <institution-slug> --enrollment direct|partner-school|program
416
416
  [--partner-school <slug|id>] --parent "First Last" --email EMAIL [--phone TEXT] --state XX
417
417
  --kid "First Last:YYYY-MM-DD[:grade]" (repeat per child) [--existing-kid USER_ID[:grade]]...
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "recess-cli",
3
- "version": "3.57.0",
3
+ "version": "3.58.0",
4
4
  "description": "Safe Recess administration and family AI tools from the command line.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -46,8 +46,8 @@
46
46
  "oxlint-tsgolint": "^0.6.0",
47
47
  "typescript": "^5.9.2",
48
48
  "vitest": "^1.6.0",
49
- "@tryrecess/api-types": "0.0.0",
50
- "@tryrecess/typescript-config": "0.0.0"
49
+ "@tryrecess/typescript-config": "0.0.0",
50
+ "@tryrecess/api-types": "0.0.0"
51
51
  },
52
52
  "scripts": {
53
53
  "build": "node node_modules/@tryrecess/typescript-config/bin/tsc-fast.mjs",