@careflair/common 1.0.49 → 1.0.52

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.
@@ -43,6 +43,11 @@ export declare const educationTypeOptions: {
43
43
  label: string;
44
44
  value: string;
45
45
  }[];
46
+ /** Role options for "looking for support" in registration (participant, support_person) */
47
+ export declare const LOOKING_FOR_SUPPORT_ROLE_OPTIONS: readonly {
48
+ label: string;
49
+ value: string;
50
+ }[];
46
51
  export declare const ProfileAllSteps: ProfileAllStepsEnum[];
47
52
  export declare const StateFullToShort: {
48
53
  readonly "New South Wales (NSW)": "NSW";
@@ -161,7 +166,7 @@ export declare const onboardingStepsDetails: readonly [{
161
166
  readonly url: "/onboarding/business-info/locations";
162
167
  }, {
163
168
  readonly id: OnboardingSteps.SUPPORTED_AGES;
164
- readonly isRequired: false;
169
+ readonly isRequired: true;
165
170
  readonly title: "Supported Ages";
166
171
  readonly description: "Select the participant ages you support";
167
172
  readonly url: "/onboarding/business-info/supported-ages";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.flagCodeByLanguage = exports.daysOfWeek = exports.contractTypeDetails = exports.onboardingStepsDetails = exports.DocumentTypeLabels = exports.altCommunicationOptions = exports.altCommunicationLabels = exports.commonLabels = exports.supportWorkerServiceTooltip = exports.SupportWorkerServiceLabels = exports.serviceTooltip = exports.PROVIDER_SERVICES_FILTERS = exports.SUPPORT_WORKER_SERVICES_FILTERS = exports.ServiceLabels = exports.StateShortToFull = exports.StateFullToShort = exports.ProfileAllSteps = exports.educationTypeOptions = exports.providerInterestOptions = exports.providerPreferenceOptions = exports.participantInterestOptions = exports.participantPreferenceOptions = exports.complexNeedsSupportedOptions = exports.agesSupportedOptions = exports.genderOfAttendanceOptions = exports.deliveryOptions = exports.languageOptions = exports.statesOptions = void 0;
3
+ exports.flagCodeByLanguage = exports.daysOfWeek = exports.contractTypeDetails = exports.onboardingStepsDetails = exports.DocumentTypeLabels = exports.altCommunicationOptions = exports.altCommunicationLabels = exports.commonLabels = exports.supportWorkerServiceTooltip = exports.SupportWorkerServiceLabels = exports.serviceTooltip = exports.PROVIDER_SERVICES_FILTERS = exports.SUPPORT_WORKER_SERVICES_FILTERS = exports.ServiceLabels = exports.StateShortToFull = exports.StateFullToShort = exports.ProfileAllSteps = exports.LOOKING_FOR_SUPPORT_ROLE_OPTIONS = exports.educationTypeOptions = exports.providerInterestOptions = exports.providerPreferenceOptions = exports.participantInterestOptions = exports.participantPreferenceOptions = exports.complexNeedsSupportedOptions = exports.agesSupportedOptions = exports.genderOfAttendanceOptions = exports.deliveryOptions = exports.languageOptions = exports.statesOptions = void 0;
4
4
  const enums_1 = require("../enums");
5
5
  const utils_1 = require("../utils/utils");
6
6
  exports.statesOptions = (0, utils_1.enumToOptions)(enums_1.StatesEnum);
@@ -14,6 +14,14 @@ exports.participantInterestOptions = (0, utils_1.enumToOptions)(enums_1.Particip
14
14
  exports.providerPreferenceOptions = (0, utils_1.enumToOptions)(enums_1.ProviderPreferenceEnum);
15
15
  exports.providerInterestOptions = (0, utils_1.enumToOptions)(enums_1.ProviderInterestEnum);
16
16
  exports.educationTypeOptions = (0, utils_1.enumToOptions)(enums_1.EducationTypeEnum);
17
+ /** Role options for "looking for support" in registration (participant, support_person) */
18
+ exports.LOOKING_FOR_SUPPORT_ROLE_OPTIONS = [
19
+ { label: "I am a participant", value: enums_1.UserRole.PARTICIPANT },
20
+ {
21
+ label: "I represent a participant (family/nominees/coordinators)",
22
+ value: enums_1.UserRole.SUPPORT_PERSON,
23
+ },
24
+ ];
17
25
  exports.ProfileAllSteps = Object.values(enums_1.ProfileAllStepsEnum);
18
26
  // Hardcoded mapping for full name to short form and vice versa
19
27
  exports.StateFullToShort = {
@@ -278,7 +286,7 @@ exports.onboardingStepsDetails = [
278
286
  // },
279
287
  {
280
288
  id: enums_1.OnboardingSteps.SUPPORTED_AGES,
281
- isRequired: false,
289
+ isRequired: true,
282
290
  title: "Supported Ages",
283
291
  description: "Select the participant ages you support",
284
292
  url: "/onboarding/business-info/supported-ages",
@@ -3,4 +3,9 @@ type Option = {
3
3
  value: string;
4
4
  };
5
5
  export declare function enumToOptions<T extends Record<string, string>>(enumObj: T): Option[];
6
+ /**
7
+ * Map enum display values back to enum keys (for API payloads).
8
+ * e.g. getEnumKeysFromValues(LanguageEnum, ['English']) => ['ENGLISH']
9
+ */
10
+ export declare function getEnumKeysFromValues<T extends Record<string, string>, K extends keyof T>(enumObj: T, values: string[]): K[];
6
11
  export {};
@@ -1,9 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.enumToOptions = enumToOptions;
4
+ exports.getEnumKeysFromValues = getEnumKeysFromValues;
4
5
  function enumToOptions(enumObj) {
5
6
  return Object.values(enumObj).map((value) => ({
6
7
  label: value, // Use the enum value for the label
7
8
  value: value, // Use the enum value for the value
8
9
  }));
9
10
  }
11
+ /**
12
+ * Map enum display values back to enum keys (for API payloads).
13
+ * e.g. getEnumKeysFromValues(LanguageEnum, ['English']) => ['ENGLISH']
14
+ */
15
+ function getEnumKeysFromValues(enumObj, values) {
16
+ const reverseEnum = Object.fromEntries(Object.entries(enumObj).map(([key, value]) => [value, key]));
17
+ return values.map((value) => reverseEnum[value]);
18
+ }
@@ -19,7 +19,7 @@ export declare const getCurrentOnboardingStep: (completedSteps: OnboardingSteps[
19
19
  readonly url: "/onboarding/business-info/locations";
20
20
  } | {
21
21
  readonly id: OnboardingSteps.SUPPORTED_AGES;
22
- readonly isRequired: false;
22
+ readonly isRequired: true;
23
23
  readonly title: "Supported Ages";
24
24
  readonly description: "Select the participant ages you support";
25
25
  readonly url: "/onboarding/business-info/supported-ages";
@@ -88,7 +88,7 @@ export declare const getNextOnboardingStep: (currentStep: OnboardingSteps) => {
88
88
  readonly url: "/onboarding/business-info/locations";
89
89
  } | {
90
90
  readonly id: OnboardingSteps.SUPPORTED_AGES;
91
- readonly isRequired: false;
91
+ readonly isRequired: true;
92
92
  readonly title: "Supported Ages";
93
93
  readonly description: "Select the participant ages you support";
94
94
  readonly url: "/onboarding/business-info/supported-ages";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@careflair/common",
3
- "version": "1.0.49",
3
+ "version": "1.0.52",
4
4
  "description": "Shared assets for CareFlair",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",