placementt-core 1.400.1093 → 1.400.1094
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.
- package/lib/typeDefinitions.d.ts +81 -0
- package/lib/typeDefinitions.js.map +1 -1
- package/package.json +1 -1
- package/src/typeDefinitions.ts +82 -0
package/lib/typeDefinitions.d.ts
CHANGED
|
@@ -1347,6 +1347,14 @@ export type InstituteData = {
|
|
|
1347
1347
|
};
|
|
1348
1348
|
};
|
|
1349
1349
|
cs?: CustomerSuccessData;
|
|
1350
|
+
/** Engagement email state: the weekly cap shared by onboarding nudges and
|
|
1351
|
+
* feature marketing, and where each engine has got to. Written only by
|
|
1352
|
+
* the engagement cron (Placementt-Backend featureEngagement.ts). */
|
|
1353
|
+
engagement?: InstituteEngagement;
|
|
1354
|
+
/** The last engagement email, for the dashboard to show the same message
|
|
1355
|
+
* as a popup. Overwritten on every send; the web app writes `clickedAt`
|
|
1356
|
+
* and `declinedAt` back, and the cron reads them to steer campaigns. */
|
|
1357
|
+
engagementPrompt?: EngagementPrompt;
|
|
1350
1358
|
/** The ONS region the school sits in, as an ASHE Table 15 region code
|
|
1351
1359
|
* ("E12000008" for the South East). Set by an admin; nothing derives it
|
|
1352
1360
|
* from the address. When present, the careers library adds a "pay near
|
|
@@ -4304,6 +4312,79 @@ export type CustomerSuccessData = {
|
|
|
4304
4312
|
};
|
|
4305
4313
|
metrics?: CustomerSuccessMetrics;
|
|
4306
4314
|
};
|
|
4315
|
+
export type InstituteEngagement = {
|
|
4316
|
+
/** Last engagement email of any kind, for the one-per-week cap. */
|
|
4317
|
+
lastEmailAt?: string;
|
|
4318
|
+
onboarding?: {
|
|
4319
|
+
/** The step last nudged, so the same step is not sent twice in a row
|
|
4320
|
+
* without a change (the cron caps repeats of one step). */
|
|
4321
|
+
lastStepKey?: string;
|
|
4322
|
+
lastVariant?: "setup" | "resend";
|
|
4323
|
+
lastSentAt?: string;
|
|
4324
|
+
/** How many times in a row the same step has been sent. */
|
|
4325
|
+
repeats?: number;
|
|
4326
|
+
};
|
|
4327
|
+
marketing?: {
|
|
4328
|
+
activeCampaignId?: string;
|
|
4329
|
+
cooldownUntil?: string;
|
|
4330
|
+
consecutiveIgnored?: number;
|
|
4331
|
+
/** Feature key → ISO date the suppression lifts. */
|
|
4332
|
+
suppressed?: {
|
|
4333
|
+
[featureKey: string]: string;
|
|
4334
|
+
};
|
|
4335
|
+
};
|
|
4336
|
+
};
|
|
4337
|
+
export type EngagementPrompt = {
|
|
4338
|
+
/** `${kind}:${key}:${variant|touch}:${YYYY-MM-DD}` */
|
|
4339
|
+
id: string;
|
|
4340
|
+
kind: "marketing" | "onboarding";
|
|
4341
|
+
/** FeatureMarketingKey or OnboardingStep.key */
|
|
4342
|
+
key: string;
|
|
4343
|
+
/** Onboarding only. */
|
|
4344
|
+
variant?: "setup" | "resend";
|
|
4345
|
+
/** Marketing only, 0-based. */
|
|
4346
|
+
touch?: number;
|
|
4347
|
+
label: string;
|
|
4348
|
+
description: string;
|
|
4349
|
+
path: string;
|
|
4350
|
+
sentAt: string;
|
|
4351
|
+
/** Written by the web app. */
|
|
4352
|
+
clickedAt?: string;
|
|
4353
|
+
/** Written by the web app, marketing only. */
|
|
4354
|
+
declinedAt?: string;
|
|
4355
|
+
};
|
|
4356
|
+
/** `featureCampaigns/{oId}_{featureKey}_{academicYear}` */
|
|
4357
|
+
export type FeatureCampaign = {
|
|
4358
|
+
oId: string;
|
|
4359
|
+
featureKey: string;
|
|
4360
|
+
/** "2026-27" */
|
|
4361
|
+
academicYear: string;
|
|
4362
|
+
status: "active" | "adopted" | "declined" | "expired";
|
|
4363
|
+
startedAt: string;
|
|
4364
|
+
touchesSent: {
|
|
4365
|
+
touch: number;
|
|
4366
|
+
templateId: number;
|
|
4367
|
+
sentAt: string;
|
|
4368
|
+
recipients: string[];
|
|
4369
|
+
}[];
|
|
4370
|
+
clickedAt?: string;
|
|
4371
|
+
declinedAt?: string;
|
|
4372
|
+
adoptedAt?: string;
|
|
4373
|
+
endedAt?: string;
|
|
4374
|
+
};
|
|
4375
|
+
/** `engagementEmails/{autoId}`: one flat log document per send, for the
|
|
4376
|
+
* admin view. */
|
|
4377
|
+
export type EngagementEmailLog = {
|
|
4378
|
+
oId: string;
|
|
4379
|
+
kind: "marketing" | "onboarding";
|
|
4380
|
+
key: string;
|
|
4381
|
+
variant?: "setup" | "resend";
|
|
4382
|
+
touch?: number;
|
|
4383
|
+
templateId: number;
|
|
4384
|
+
recipients: string[];
|
|
4385
|
+
sentAt: string;
|
|
4386
|
+
campaignId?: string;
|
|
4387
|
+
};
|
|
4307
4388
|
export type CustomerTask = {
|
|
4308
4389
|
id: string;
|
|
4309
4390
|
customerId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeDefinitions.js","sourceRoot":"","sources":["../src/typeDefinitions.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"typeDefinitions.js","sourceRoot":"","sources":["../src/typeDefinitions.ts"],"names":[],"mappings":";;;AA0qIA,sDASC;AAeD,oDAKC;AAaD,0CAEC;AAnoED;;;;;kFAKkF;AACrE,QAAA,qBAAqB,GAAG,SAAS,CAAC;AAClC,QAAA,iBAAiB,GAAG,OAAO,CAAC;AA+iEzC;yEACyE;AAC5D,QAAA,0BAA0B,GAA2C;IAC9E,gBAAgB,EAAE,2BAA2B;IAC7C,mBAAmB,EAAE,sBAAsB;IAC3C,cAAc,EAAE,iBAAiB;IACjC,kBAAkB,EAAE,qBAAqB;IACzC,UAAU,EAAE,oCAAoC;IAChD,aAAa,EAAE,yBAAyB;IACxC,aAAa,EAAE,wBAAwB;IACvC,KAAK,EAAE,OAAO;CACjB,CAAC;AAEW,QAAA,0BAA0B,GAA+C;IAClF,QAAQ,EAAE,WAAW;IACrB,KAAK,EAAE,YAAY;IACnB,KAAK,EAAE,OAAO;CACjB,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,SAAgB,qBAAqB,CAAC,SAAsC;IACxE,QAAQ,SAAS,EAAE,CAAC;QACpB,KAAK,MAAM,CAAC,CAAC,OAAO,OAAO,CAAC;QAC5B,KAAK,OAAO,CAAC,CAAC,OAAO,OAAO,CAAC;QAC7B,KAAK,WAAW,CAAC;QACjB,KAAK,OAAO,CAAC;QACb,KAAK,OAAO,CAAC;QACb,OAAO,CAAC,CAAC,OAAO,UAAU,CAAC;IAC3B,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,SAAgB,oBAAoB,CAChC,IAAwC,EACxC,MAA6C;IAE7C,OAAO,IAAI,EAAE,WAAW,IAAI,MAAM,EAAE,YAAY,IAAI,KAAK,CAAC;AAC9D,CAAC;AAED;;;;;;;;;;GAUG;AACH,SAAgB,eAAe,CAAC,KAA6D;IACzF,OAAO,GAAG,KAAK,CAAC,cAAc,IAAI,EAAE,IAAI,KAAK,CAAC,aAAa,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC;AAC/E,CAAC"}
|
package/package.json
CHANGED
package/src/typeDefinitions.ts
CHANGED
|
@@ -1381,6 +1381,14 @@ export type InstituteData = {
|
|
|
1381
1381
|
}
|
|
1382
1382
|
},
|
|
1383
1383
|
cs?: CustomerSuccessData,
|
|
1384
|
+
/** Engagement email state: the weekly cap shared by onboarding nudges and
|
|
1385
|
+
* feature marketing, and where each engine has got to. Written only by
|
|
1386
|
+
* the engagement cron (Placementt-Backend featureEngagement.ts). */
|
|
1387
|
+
engagement?: InstituteEngagement,
|
|
1388
|
+
/** The last engagement email, for the dashboard to show the same message
|
|
1389
|
+
* as a popup. Overwritten on every send; the web app writes `clickedAt`
|
|
1390
|
+
* and `declinedAt` back, and the cron reads them to steer campaigns. */
|
|
1391
|
+
engagementPrompt?: EngagementPrompt,
|
|
1384
1392
|
/** The ONS region the school sits in, as an ASHE Table 15 region code
|
|
1385
1393
|
* ("E12000008" for the South East). Set by an admin; nothing derives it
|
|
1386
1394
|
* from the address. When present, the careers library adds a "pay near
|
|
@@ -4456,6 +4464,80 @@ export type CustomerSuccessData = {
|
|
|
4456
4464
|
metrics?: CustomerSuccessMetrics;
|
|
4457
4465
|
};
|
|
4458
4466
|
|
|
4467
|
+
// ─── Engagement emails ───────────────────────────────────────────────────────
|
|
4468
|
+
// Onboarding nudges and feature marketing (onboardingPathways.ts and
|
|
4469
|
+
// featureMarketing.ts decide what to say; the backend cron decides when).
|
|
4470
|
+
|
|
4471
|
+
export type InstituteEngagement = {
|
|
4472
|
+
/** Last engagement email of any kind, for the one-per-week cap. */
|
|
4473
|
+
lastEmailAt?: string,
|
|
4474
|
+
onboarding?: {
|
|
4475
|
+
/** The step last nudged, so the same step is not sent twice in a row
|
|
4476
|
+
* without a change (the cron caps repeats of one step). */
|
|
4477
|
+
lastStepKey?: string,
|
|
4478
|
+
lastVariant?: "setup"|"resend",
|
|
4479
|
+
lastSentAt?: string,
|
|
4480
|
+
/** How many times in a row the same step has been sent. */
|
|
4481
|
+
repeats?: number,
|
|
4482
|
+
},
|
|
4483
|
+
marketing?: {
|
|
4484
|
+
activeCampaignId?: string,
|
|
4485
|
+
cooldownUntil?: string,
|
|
4486
|
+
consecutiveIgnored?: number,
|
|
4487
|
+
/** Feature key → ISO date the suppression lifts. */
|
|
4488
|
+
suppressed?: {[featureKey: string]: string},
|
|
4489
|
+
},
|
|
4490
|
+
};
|
|
4491
|
+
|
|
4492
|
+
export type EngagementPrompt = {
|
|
4493
|
+
/** `${kind}:${key}:${variant|touch}:${YYYY-MM-DD}` */
|
|
4494
|
+
id: string,
|
|
4495
|
+
kind: "marketing"|"onboarding",
|
|
4496
|
+
/** FeatureMarketingKey or OnboardingStep.key */
|
|
4497
|
+
key: string,
|
|
4498
|
+
/** Onboarding only. */
|
|
4499
|
+
variant?: "setup"|"resend",
|
|
4500
|
+
/** Marketing only, 0-based. */
|
|
4501
|
+
touch?: number,
|
|
4502
|
+
label: string,
|
|
4503
|
+
description: string,
|
|
4504
|
+
path: string,
|
|
4505
|
+
sentAt: string,
|
|
4506
|
+
/** Written by the web app. */
|
|
4507
|
+
clickedAt?: string,
|
|
4508
|
+
/** Written by the web app, marketing only. */
|
|
4509
|
+
declinedAt?: string,
|
|
4510
|
+
};
|
|
4511
|
+
|
|
4512
|
+
/** `featureCampaigns/{oId}_{featureKey}_{academicYear}` */
|
|
4513
|
+
export type FeatureCampaign = {
|
|
4514
|
+
oId: string,
|
|
4515
|
+
featureKey: string,
|
|
4516
|
+
/** "2026-27" */
|
|
4517
|
+
academicYear: string,
|
|
4518
|
+
status: "active"|"adopted"|"declined"|"expired",
|
|
4519
|
+
startedAt: string,
|
|
4520
|
+
touchesSent: {touch: number, templateId: number, sentAt: string, recipients: string[]}[],
|
|
4521
|
+
clickedAt?: string,
|
|
4522
|
+
declinedAt?: string,
|
|
4523
|
+
adoptedAt?: string,
|
|
4524
|
+
endedAt?: string,
|
|
4525
|
+
};
|
|
4526
|
+
|
|
4527
|
+
/** `engagementEmails/{autoId}`: one flat log document per send, for the
|
|
4528
|
+
* admin view. */
|
|
4529
|
+
export type EngagementEmailLog = {
|
|
4530
|
+
oId: string,
|
|
4531
|
+
kind: "marketing"|"onboarding",
|
|
4532
|
+
key: string,
|
|
4533
|
+
variant?: "setup"|"resend",
|
|
4534
|
+
touch?: number,
|
|
4535
|
+
templateId: number,
|
|
4536
|
+
recipients: string[],
|
|
4537
|
+
sentAt: string,
|
|
4538
|
+
campaignId?: string,
|
|
4539
|
+
};
|
|
4540
|
+
|
|
4459
4541
|
export type CustomerTask = {
|
|
4460
4542
|
id: string;
|
|
4461
4543
|
customerId: string;
|