placementt-core 1.400.919 → 1.400.920

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.
@@ -424,6 +424,16 @@ export type UserData = {
424
424
  referrals?: number;
425
425
  shareNameWithReferralLeaderboardConsent?: boolean;
426
426
  shareNameWithReferralLeaderboardConsentDate?: boolean;
427
+ alumniConsent?: boolean;
428
+ alumniConsentDate?: string;
429
+ checkInConsent?: boolean;
430
+ checkInConsentDate?: string;
431
+ nccisDataSharingConsent?: boolean;
432
+ nccisDataSharingConsentDate?: string;
433
+ trustedContact?: TrustedContact;
434
+ trustedContactConsent?: boolean;
435
+ trustedContactConsentDate?: string;
436
+ trustedContactAsked?: boolean;
427
437
  referralCode?: string;
428
438
  notificationFrequency?: "daily" | "weekly" | "fortnightly" | "never";
429
439
  monthAdded?: number;
@@ -2060,14 +2070,14 @@ export type LeaverTransitionData = {
2060
2070
  nccisDataSharingConsent?: boolean;
2061
2071
  };
2062
2072
  /**
2063
- * Consent, contact and alumni opt-in captured on a post-leaving checkpoint when
2064
- * the student never completed the intentions form (checkpoint 1). Mirrors the
2065
- * consent/alumni half of LeaverTransitionData so a leaver who only ever answers
2066
- * the results-day or Christmas form still gives the parent-contact, alumni and
2067
- * NCCIS data-sharing consent that the intentions form would have collected.
2068
- * The destination itself is NOT here — the checkpoint already asks for it.
2073
+ * Consent / one-time capture bundle submitted by the leaver forms. The
2074
+ * destination forms collect these but they are NOT stored on the LeaverRequest —
2075
+ * the backend routes them to the canonical home on UserData (and the Alumni
2076
+ * record), where they are captured once and never re-asked. A given form only
2077
+ * includes the items still outstanding for that leaver (see the needs* flags on
2078
+ * getLeaverCheckpointRequest). The destination itself is not here.
2069
2079
  */
2070
- export type LeaverIntentionsCapture = {
2080
+ export type LeaverConsentCapture = {
2071
2081
  becomeAlumni?: boolean;
2072
2082
  mobile?: string;
2073
2083
  linkedinUrl?: string;
@@ -2078,6 +2088,9 @@ export type LeaverIntentionsCapture = {
2078
2088
  checkInConsent?: boolean;
2079
2089
  checkInConsentDate?: string;
2080
2090
  nccisDataSharingConsent?: boolean;
2091
+ /** True when the additional-contact step was shown on this form (given or
2092
+ * declined) — lets the backend mark trustedContactAsked so it isn't re-asked. */
2093
+ additionalContactAsked?: boolean;
2081
2094
  };
2082
2095
  /**
2083
2096
  * Response payload for a post-leaving checkpoint (results day / Christmas).
@@ -2098,9 +2111,9 @@ export type LeaverCheckpointResponse = {
2098
2111
  wellbeingScore?: 1 | 2 | 3 | 4 | 5;
2099
2112
  personalEmail?: string;
2100
2113
  date: string;
2101
- /** Present only when checkpoint 1 was skipped the consent/alumni data the
2102
- * intentions form would have collected, bolted onto this form instead. */
2103
- intentionsCapture?: LeaverIntentionsCapture;
2114
+ /** Consent / one-time items still outstanding for this leaver, collected on
2115
+ * this form and routed to UserData by the backend (never stored here). */
2116
+ intentionsCapture?: LeaverConsentCapture;
2104
2117
  };
2105
2118
  /**
2106
2119
  * One per leaver per LeaverGroup — tracks whether the student has completed Form B.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "private": false,
3
3
  "name": "placementt-core",
4
4
  "author": "Placementt",
5
- "version": "1.400.919",
5
+ "version": "1.400.920",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",
8
8
  "scripts": {
@@ -430,6 +430,23 @@ export type UserData = {
430
430
  referrals?: number,
431
431
  shareNameWithReferralLeaderboardConsent?: boolean,
432
432
  shareNameWithReferralLeaderboardConsentDate?: boolean,
433
+
434
+ // ── Leaver / alumni one-time consent (canonical home) ──
435
+ // Captured once across the leaver forms (Form B / results day / Christmas) and
436
+ // never re-asked. The leaver forms gate each section on these: `undefined`
437
+ // means "never asked" (show the page); `true`/`false` means answered (skip it).
438
+ // Dates are server-stamped ISO strings. These are the source of truth; the
439
+ // Alumni record holds denormalised copies taken at opt-in.
440
+ alumniConsent?: boolean, // becomeAlumni — only meaningful for leavers, not sixth-form stayers
441
+ alumniConsentDate?: string,
442
+ checkInConsent?: boolean, // annual check-in (alumni only)
443
+ checkInConsentDate?: string,
444
+ nccisDataSharingConsent?: boolean, // statutory NCCIS destination-tracking consent (all leavers)
445
+ nccisDataSharingConsentDate?: string,
446
+ trustedContact?: TrustedContact, // backup/additional contact
447
+ trustedContactConsent?: boolean,
448
+ trustedContactConsentDate?: string,
449
+ trustedContactAsked?: boolean, // set once the additional-contact step is submitted (given or declined) so an empty contact isn't re-prompted
433
450
  referralCode?: string,
434
451
  notificationFrequency?: "daily"|"weekly"|"fortnightly"|"never",
435
452
  monthAdded?: number,
@@ -1969,14 +1986,14 @@ export type LeaverTransitionData = {
1969
1986
  }
1970
1987
 
1971
1988
  /**
1972
- * Consent, contact and alumni opt-in captured on a post-leaving checkpoint when
1973
- * the student never completed the intentions form (checkpoint 1). Mirrors the
1974
- * consent/alumni half of LeaverTransitionData so a leaver who only ever answers
1975
- * the results-day or Christmas form still gives the parent-contact, alumni and
1976
- * NCCIS data-sharing consent that the intentions form would have collected.
1977
- * The destination itself is NOT here — the checkpoint already asks for it.
1989
+ * Consent / one-time capture bundle submitted by the leaver forms. The
1990
+ * destination forms collect these but they are NOT stored on the LeaverRequest —
1991
+ * the backend routes them to the canonical home on UserData (and the Alumni
1992
+ * record), where they are captured once and never re-asked. A given form only
1993
+ * includes the items still outstanding for that leaver (see the needs* flags on
1994
+ * getLeaverCheckpointRequest). The destination itself is not here.
1978
1995
  */
1979
- export type LeaverIntentionsCapture = {
1996
+ export type LeaverConsentCapture = {
1980
1997
  becomeAlumni?: boolean,
1981
1998
  mobile?: string,
1982
1999
  linkedinUrl?: string,
@@ -1987,6 +2004,9 @@ export type LeaverIntentionsCapture = {
1987
2004
  checkInConsent?: boolean,
1988
2005
  checkInConsentDate?: string, // server-stamped
1989
2006
  nccisDataSharingConsent?: boolean,
2007
+ /** True when the additional-contact step was shown on this form (given or
2008
+ * declined) — lets the backend mark trustedContactAsked so it isn't re-asked. */
2009
+ additionalContactAsked?: boolean,
1990
2010
  }
1991
2011
 
1992
2012
  /**
@@ -2008,9 +2028,9 @@ export type LeaverCheckpointResponse = {
2008
2028
  wellbeingScore?: 1|2|3|4|5, // christmas only, optional
2009
2029
  personalEmail?: string, // lets them update their contact email
2010
2030
  date: string, // ISO — server-stamped submission time
2011
- /** Present only when checkpoint 1 was skipped the consent/alumni data the
2012
- * intentions form would have collected, bolted onto this form instead. */
2013
- intentionsCapture?: LeaverIntentionsCapture,
2031
+ /** Consent / one-time items still outstanding for this leaver, collected on
2032
+ * this form and routed to UserData by the backend (never stored here). */
2033
+ intentionsCapture?: LeaverConsentCapture,
2014
2034
  }
2015
2035
 
2016
2036
  /**