@jaws-developers-customers/consulca-types 1.0.0 → 1.0.1
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/index.d.ts +19 -0
- package/index.js +15 -9
- package/index.mjs +3 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -12,6 +12,23 @@ export type ConditionStatus = 'good' | 'minor_damage' | 'major_damage' | 'not_ch
|
|
|
12
12
|
export type ClaimStatus = 'draft' | 'submitted' | 'in_review' | 'approved' | 'rejected' | 'closed';
|
|
13
13
|
export type WorkStatus = 'planned' | 'assigned' | 'in_progress' | 'completed' | 'cancelled';
|
|
14
14
|
|
|
15
|
+
export interface ColorPalette {
|
|
16
|
+
primary: string;
|
|
17
|
+
secondary: string;
|
|
18
|
+
accent: string;
|
|
19
|
+
background: string;
|
|
20
|
+
text: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface ColorPalettes {
|
|
24
|
+
parcoCeresio: ColorPalette;
|
|
25
|
+
general: ColorPalette;
|
|
26
|
+
}
|
|
27
|
+
export interface Constants {
|
|
28
|
+
API_DEV: string;
|
|
29
|
+
API: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
15
32
|
export interface Addressable {
|
|
16
33
|
address_line1?: string | null;
|
|
17
34
|
address_line2?: string | null;
|
|
@@ -220,6 +237,7 @@ export declare const INSPECTION_STATUSES: readonly InspectionStatus[];
|
|
|
220
237
|
export declare const CONDITION_STATUSES: readonly ConditionStatus[];
|
|
221
238
|
export declare const CLAIM_STATUSES: readonly ClaimStatus[];
|
|
222
239
|
export declare const WORK_STATUSES: readonly WorkStatus[];
|
|
240
|
+
export declare const COLOR_PALETTE: Readonly<ColorPalettes>;
|
|
223
241
|
|
|
224
242
|
export declare function toDate(value: string | number | Date | null | undefined): Date | null;
|
|
225
243
|
export declare function formatDate(
|
|
@@ -238,6 +256,7 @@ export declare function formatCurrency(
|
|
|
238
256
|
locales?: string | string[],
|
|
239
257
|
options?: Intl.NumberFormatOptions
|
|
240
258
|
): string;
|
|
259
|
+
export declare function getColorPalette(): Readonly<ColorPalettes>;
|
|
241
260
|
export declare function getUserFullName(
|
|
242
261
|
user: Pick<User, 'first_name' | 'last_name'> | Partial<Pick<User, 'first_name' | 'last_name'>> | null | undefined
|
|
243
262
|
): string;
|
package/index.js
CHANGED
|
@@ -13,6 +13,17 @@ const INSPECTION_STATUSES = Object.freeze(['draft', 'in_progress', 'submitted',
|
|
|
13
13
|
const CONDITION_STATUSES = Object.freeze(['good', 'minor_damage', 'major_damage', 'not_checked']);
|
|
14
14
|
const CLAIM_STATUSES = Object.freeze(['draft', 'submitted', 'in_review', 'approved', 'rejected', 'closed']);
|
|
15
15
|
const WORK_STATUSES = Object.freeze(['planned', 'assigned', 'in_progress', 'completed', 'cancelled']);
|
|
16
|
+
const COLOR_PALETTE = Object.freeze({
|
|
17
|
+
primary: '#334E68',
|
|
18
|
+
secondary: '#829AB1',
|
|
19
|
+
accent: '#D64545',
|
|
20
|
+
background: '#F7F9FB',
|
|
21
|
+
text: '#102A43',
|
|
22
|
+
});
|
|
23
|
+
const CONSTANTS = Object.freeze({
|
|
24
|
+
API_DEV: 'api.consulca.local',
|
|
25
|
+
API: 'api.consulca.ch'
|
|
26
|
+
});
|
|
16
27
|
|
|
17
28
|
function toDate(value) {
|
|
18
29
|
if (value === null || value === undefined || value === '') {
|
|
@@ -105,21 +116,15 @@ function hasAccessChannel(accessChannels, channel) {
|
|
|
105
116
|
});
|
|
106
117
|
}
|
|
107
118
|
|
|
108
|
-
function getColorPalette(){
|
|
109
|
-
|
|
110
|
-
"parcoCeresio": {
|
|
111
|
-
|
|
112
|
-
},
|
|
113
|
-
"general": {
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
};
|
|
119
|
+
function getColorPalette() {
|
|
120
|
+
return COLOR_PALETTE;
|
|
117
121
|
}
|
|
118
122
|
|
|
119
123
|
module.exports = {
|
|
120
124
|
ACCESS_CHANNELS,
|
|
121
125
|
ACCESS_STATUSES,
|
|
122
126
|
CLAIM_STATUSES,
|
|
127
|
+
COLOR_PALETTE,
|
|
123
128
|
CONDITION_STATUSES,
|
|
124
129
|
INSPECTION_STATUSES,
|
|
125
130
|
INSPECTION_TYPES,
|
|
@@ -134,6 +139,7 @@ module.exports = {
|
|
|
134
139
|
formatCurrency,
|
|
135
140
|
formatDate,
|
|
136
141
|
formatDateTime,
|
|
142
|
+
getColorPalette,
|
|
137
143
|
getUserFullName,
|
|
138
144
|
hasAccessChannel,
|
|
139
145
|
hasUserRole,
|
package/index.mjs
CHANGED
|
@@ -4,6 +4,7 @@ export const {
|
|
|
4
4
|
ACCESS_CHANNELS,
|
|
5
5
|
ACCESS_STATUSES,
|
|
6
6
|
CLAIM_STATUSES,
|
|
7
|
+
COLOR_PALETTE,
|
|
7
8
|
CONDITION_STATUSES,
|
|
8
9
|
INSPECTION_STATUSES,
|
|
9
10
|
INSPECTION_TYPES,
|
|
@@ -14,10 +15,12 @@ export const {
|
|
|
14
15
|
USER_ROLES,
|
|
15
16
|
USER_STATUSES,
|
|
16
17
|
WORK_STATUSES,
|
|
18
|
+
CONSTANTS,
|
|
17
19
|
formatAddress,
|
|
18
20
|
formatCurrency,
|
|
19
21
|
formatDate,
|
|
20
22
|
formatDateTime,
|
|
23
|
+
getColorPalette,
|
|
21
24
|
getUserFullName,
|
|
22
25
|
hasAccessChannel,
|
|
23
26
|
hasUserRole,
|