@careflair/common 1.0.51 → 1.0.53
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/dist/constants/index.d.ts +5 -0
- package/dist/constants/index.js +9 -1
- package/dist/enums/index.d.ts +8 -0
- package/dist/enums/index.js +10 -1
- package/dist/utils/enum.d.ts +5 -0
- package/dist/utils/enum.js +9 -0
- package/package.json +1 -1
|
@@ -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";
|
package/dist/constants/index.js
CHANGED
|
@@ -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 = {
|
package/dist/enums/index.d.ts
CHANGED
|
@@ -366,6 +366,14 @@ export declare enum screeningAndChildrenCheckStatus {
|
|
|
366
366
|
DECLINED = "declined",
|
|
367
367
|
EXPIRED = "expired"
|
|
368
368
|
}
|
|
369
|
+
/** Job application (proposal) status – matches Prisma JobApplication.status */
|
|
370
|
+
export declare enum JobApplicationStatus {
|
|
371
|
+
PENDING = "pending",
|
|
372
|
+
SHORTLISTED = "shortlisted",
|
|
373
|
+
ARCHIVED = "archived",
|
|
374
|
+
HIRED = "hired",
|
|
375
|
+
WITHDRAWN = "withdrawn"
|
|
376
|
+
}
|
|
369
377
|
export declare enum PushNotificationType {
|
|
370
378
|
CHAT_MESSAGE = "chat_message",
|
|
371
379
|
ONBOARDING_REMINDER = "onboarding_reminder",
|
package/dist/enums/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PushNotificationType = exports.screeningAndChildrenCheckStatus = exports.veriffStatuses = exports.ContractTypeEnum = exports.OnboardingSteps = exports.DocumentType = exports.JOB_TABS = exports.BOOKING_ACTIVITY_TYPE = exports.JOB_WORKER_TYPE = exports.SupportWorkerService = exports.AltCommunication = exports.NotificationType = exports.JobScheduleFrequencyEnum = exports.FileContentType = exports.MessageStatus = exports.MessageType = exports.PostUpvoteTypes = exports.PostTypes = exports.CommunityMembersStatuses = exports.AttachmentFilesEnum = exports.ProviderInterestEnum = exports.ProviderPreferenceEnum = exports.ParticipantInterestEnum = exports.ParticipantPreferenceEnum = exports.DaysOfWeek = exports.ProfileAllStepsEnum = exports.BusinessClassTypes = exports.BusinessType = exports.OtpType = exports.UserRole = exports.EducationTypeEnum = exports.ComplexNeedsSupportedEnum = exports.AgesSupportedEnum = exports.GenderOfAttendanceEnum = exports.DeliveryEnum = exports.LanguageEnum = exports.StatesEnum = void 0;
|
|
3
|
+
exports.PushNotificationType = exports.JobApplicationStatus = exports.screeningAndChildrenCheckStatus = exports.veriffStatuses = exports.ContractTypeEnum = exports.OnboardingSteps = exports.DocumentType = exports.JOB_TABS = exports.BOOKING_ACTIVITY_TYPE = exports.JOB_WORKER_TYPE = exports.SupportWorkerService = exports.AltCommunication = exports.NotificationType = exports.JobScheduleFrequencyEnum = exports.FileContentType = exports.MessageStatus = exports.MessageType = exports.PostUpvoteTypes = exports.PostTypes = exports.CommunityMembersStatuses = exports.AttachmentFilesEnum = exports.ProviderInterestEnum = exports.ProviderPreferenceEnum = exports.ParticipantInterestEnum = exports.ParticipantPreferenceEnum = exports.DaysOfWeek = exports.ProfileAllStepsEnum = exports.BusinessClassTypes = exports.BusinessType = exports.OtpType = exports.UserRole = exports.EducationTypeEnum = exports.ComplexNeedsSupportedEnum = exports.AgesSupportedEnum = exports.GenderOfAttendanceEnum = exports.DeliveryEnum = exports.LanguageEnum = exports.StatesEnum = void 0;
|
|
4
4
|
var StatesEnum;
|
|
5
5
|
(function (StatesEnum) {
|
|
6
6
|
StatesEnum["NEW_SOUTH_WALES_NSW"] = "New South Wales (NSW)";
|
|
@@ -435,6 +435,15 @@ var screeningAndChildrenCheckStatus;
|
|
|
435
435
|
screeningAndChildrenCheckStatus["DECLINED"] = "declined";
|
|
436
436
|
screeningAndChildrenCheckStatus["EXPIRED"] = "expired";
|
|
437
437
|
})(screeningAndChildrenCheckStatus || (exports.screeningAndChildrenCheckStatus = screeningAndChildrenCheckStatus = {}));
|
|
438
|
+
/** Job application (proposal) status – matches Prisma JobApplication.status */
|
|
439
|
+
var JobApplicationStatus;
|
|
440
|
+
(function (JobApplicationStatus) {
|
|
441
|
+
JobApplicationStatus["PENDING"] = "pending";
|
|
442
|
+
JobApplicationStatus["SHORTLISTED"] = "shortlisted";
|
|
443
|
+
JobApplicationStatus["ARCHIVED"] = "archived";
|
|
444
|
+
JobApplicationStatus["HIRED"] = "hired";
|
|
445
|
+
JobApplicationStatus["WITHDRAWN"] = "withdrawn";
|
|
446
|
+
})(JobApplicationStatus || (exports.JobApplicationStatus = JobApplicationStatus = {}));
|
|
438
447
|
// Push notification types for mobile app navigation
|
|
439
448
|
var PushNotificationType;
|
|
440
449
|
(function (PushNotificationType) {
|
package/dist/utils/enum.d.ts
CHANGED
|
@@ -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 {};
|
package/dist/utils/enum.js
CHANGED
|
@@ -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
|
+
}
|