@quesmed/types-rn 2.6.73 → 2.6.74
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/package.json +1 -1
- package/resolvers/constants.d.ts +4 -0
- package/resolvers/constants.js +32 -2
- package/utils/wordsToNumber.d.ts +1 -0
- package/utils/wordsToNumber.js +10 -1
package/package.json
CHANGED
package/resolvers/constants.d.ts
CHANGED
|
@@ -5,3 +5,7 @@ export declare const productMapping: Partial<Record<EProductType, {
|
|
|
5
5
|
topicType: ETopicType[];
|
|
6
6
|
mockType: EMockTestType[];
|
|
7
7
|
}>>;
|
|
8
|
+
export declare const getEntitlementFromTopicType: (topicType: ETopicType, productType: EProductType) => {
|
|
9
|
+
id: number;
|
|
10
|
+
name: string;
|
|
11
|
+
};
|
package/resolvers/constants.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.productMapping = void 0;
|
|
3
|
+
exports.getEntitlementFromTopicType = exports.productMapping = void 0;
|
|
4
4
|
const models_1 = require("../models");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
5
6
|
const enums_1 = require("./enums");
|
|
6
7
|
const ALL_TOPIC_TYPE_WITHOUT_ANATOMY = [
|
|
7
8
|
models_1.ETopicType.CLINICAL,
|
|
@@ -40,7 +41,7 @@ exports.productMapping = {
|
|
|
40
41
|
},
|
|
41
42
|
[models_1.EProductType.MEDICAL_SCIENCES]: {
|
|
42
43
|
db: enums_1.DB_TYPE.FINALS,
|
|
43
|
-
topicType: [models_1.ETopicType.PRE_CLINICAL],
|
|
44
|
+
topicType: [models_1.ETopicType.PRE_CLINICAL, models_1.ETopicType.CLINICAL],
|
|
44
45
|
mockType: [models_1.EMockTestType.UNIVERSITY_SPECIFIC],
|
|
45
46
|
},
|
|
46
47
|
[models_1.EProductType.ANATOMY_BUNDLE]: {
|
|
@@ -102,3 +103,32 @@ exports.productMapping = {
|
|
|
102
103
|
mockType: ALL_MOCKS,
|
|
103
104
|
},
|
|
104
105
|
};
|
|
106
|
+
const topicEntitlementMap = {
|
|
107
|
+
[models_1.ETopicType.PRE_CLINICAL]: models_1.EEntitlementType.PRE_CLINICAL,
|
|
108
|
+
[models_1.ETopicType.CLINICAL]: models_1.EEntitlementType.CLINICAL,
|
|
109
|
+
[models_1.ETopicType.ANATOMY]: models_1.EEntitlementType.ANATOMY,
|
|
110
|
+
[models_1.ETopicType.DATA_INTERPRETATION]: models_1.EEntitlementType.DATA_INTERPRETATION,
|
|
111
|
+
[models_1.ETopicType.SJT]: models_1.EEntitlementType.PROFESSIONAL_DILEMMA,
|
|
112
|
+
[models_1.ETopicType.INTERVIEW_ANAESTHETICS]: models_1.EEntitlementType.INTERVIEW_ANAESTHETICS,
|
|
113
|
+
[models_1.ETopicType.INTERVIEW_CST]: models_1.EEntitlementType.INTERVIEW_CST,
|
|
114
|
+
[models_1.ETopicType.INTERVIEW_IMT]: models_1.EEntitlementType.INTERVIEW_IMT,
|
|
115
|
+
[models_1.ETopicType.INTERVIEW_RADIOLOGY]: models_1.EEntitlementType.INTERVIEW_RADIOLOGY,
|
|
116
|
+
};
|
|
117
|
+
const clinicalEntitlementMap = {
|
|
118
|
+
[models_1.EProductType.MEDICAL_SCIENCES]: models_1.EEntitlementType.CLINICAL_SUBSET,
|
|
119
|
+
[models_1.EProductType.QBANK]: models_1.EEntitlementType.CLINICAL,
|
|
120
|
+
[models_1.EProductType.MSRA]: models_1.EEntitlementType.CLINICAL_PROBLEM_SOLVING,
|
|
121
|
+
[models_1.EProductType.PLAB1]: models_1.EEntitlementType.PLAB_1,
|
|
122
|
+
[models_1.EProductType.MRCP_PART1]: models_1.EEntitlementType.MRCP_PART_1,
|
|
123
|
+
[models_1.EProductType.MRCP_PART2]: models_1.EEntitlementType.MRCP_PART_2,
|
|
124
|
+
};
|
|
125
|
+
const getEntitlementFromTopicType = (topicType, productType) => {
|
|
126
|
+
const entitlement = topicType === models_1.ETopicType.CLINICAL
|
|
127
|
+
? clinicalEntitlementMap[productType]
|
|
128
|
+
: topicEntitlementMap[topicType];
|
|
129
|
+
if (!entitlement) {
|
|
130
|
+
return { id: 0, name: 'Unknown' };
|
|
131
|
+
}
|
|
132
|
+
return { id: entitlement, name: (0, utils_1.titleCase)(models_1.EEntitlementType[entitlement]) };
|
|
133
|
+
};
|
|
134
|
+
exports.getEntitlementFromTopicType = getEntitlementFromTopicType;
|
package/utils/wordsToNumber.d.ts
CHANGED
package/utils/wordsToNumber.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.wordsToNumber = void 0;
|
|
3
|
+
exports.titleCase = exports.wordsToNumber = void 0;
|
|
4
4
|
const Small = {
|
|
5
5
|
zero: 0,
|
|
6
6
|
one: 1,
|
|
@@ -49,3 +49,12 @@ function wordsToNumber(s, checkForDigits = false) {
|
|
|
49
49
|
return total;
|
|
50
50
|
}
|
|
51
51
|
exports.wordsToNumber = wordsToNumber;
|
|
52
|
+
function titleCase(input) {
|
|
53
|
+
return input
|
|
54
|
+
.split(' ')
|
|
55
|
+
.map((word) => {
|
|
56
|
+
return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();
|
|
57
|
+
})
|
|
58
|
+
.join(' ');
|
|
59
|
+
}
|
|
60
|
+
exports.titleCase = titleCase;
|