@cranberry-money/shared-constants 5.1.1 → 8.0.0
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/api/auth.d.ts +12 -28
- package/dist/api/auth.d.ts.map +1 -1
- package/dist/api/auth.js +14 -32
- package/dist/api/config.d.ts.map +1 -1
- package/dist/api/config.js +11 -8
- package/dist/business/bank-accounts.d.ts +10 -17
- package/dist/business/bank-accounts.d.ts.map +1 -1
- package/dist/business/bank-accounts.js +16 -24
- package/dist/business/documents.d.ts +6 -12
- package/dist/business/documents.d.ts.map +1 -1
- package/dist/business/documents.js +11 -11
- package/dist/business/holdings.d.ts +34 -0
- package/dist/business/holdings.d.ts.map +1 -0
- package/dist/business/holdings.js +34 -0
- package/dist/business/index.d.ts +1 -0
- package/dist/business/index.d.ts.map +1 -1
- package/dist/business/index.js +2 -0
- package/dist/business/status/banks.d.ts +6 -0
- package/dist/business/status/banks.d.ts.map +1 -1
- package/dist/business/status/banks.js +6 -0
- package/dist/business/status/cash-accounts.d.ts.map +1 -1
- package/dist/business/status/cash-accounts.js +4 -3
- package/dist/business/status/documents.d.ts +7 -16
- package/dist/business/status/documents.d.ts.map +1 -1
- package/dist/business/status/documents.js +13 -14
- package/dist/business/status/portfolios.d.ts +6 -0
- package/dist/business/status/portfolios.d.ts.map +1 -1
- package/dist/business/status/portfolios.js +6 -0
- package/dist/business/status/trades.d.ts +26 -39
- package/dist/business/status/trades.d.ts.map +1 -1
- package/dist/business/status/trades.js +41 -32
- package/dist/business/status/withdrawals.d.ts +34 -62
- package/dist/business/status/withdrawals.d.ts.map +1 -1
- package/dist/business/status/withdrawals.js +61 -40
- package/dist/common/index.d.ts +2 -0
- package/dist/common/index.d.ts.map +1 -0
- package/dist/common/index.js +1 -0
- package/dist/common/statuses.d.ts +18 -0
- package/dist/common/statuses.d.ts.map +1 -0
- package/dist/common/statuses.js +17 -0
- package/dist/config/defaults.d.ts +68 -0
- package/dist/config/defaults.d.ts.map +1 -0
- package/dist/config/defaults.js +66 -0
- package/dist/config/index.d.ts +8 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +7 -0
- package/dist/config/pagination.d.ts +28 -0
- package/dist/config/pagination.d.ts.map +1 -0
- package/dist/config/pagination.js +40 -0
- package/dist/config/thresholds.d.ts +65 -0
- package/dist/config/thresholds.d.ts.map +1 -0
- package/dist/config/thresholds.js +82 -0
- package/dist/financial/currency.d.ts +7 -0
- package/dist/financial/currency.d.ts.map +1 -1
- package/dist/financial/currency.js +7 -1
- package/dist/financial/formatting.d.ts +1 -1
- package/dist/financial/formatting.d.ts.map +1 -1
- package/dist/financial/formatting.js +20 -32
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/ui/colors.d.ts +10 -10
- package/dist/ui/colors.d.ts.map +1 -1
- package/dist/ui/colors.js +28 -25
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +1 -0
- package/dist/ui/status-colors-unified.d.ts +91 -0
- package/dist/ui/status-colors-unified.d.ts.map +1 -0
- package/dist/ui/status-colors-unified.js +106 -0
- package/dist/utilities/common.d.ts +10 -20
- package/dist/utilities/common.d.ts.map +1 -1
- package/dist/utilities/common.js +14 -31
- package/dist/utilities/defaults.d.ts.map +1 -1
- package/dist/utilities/defaults.js +35 -28
- package/package.json +1 -1
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified status color mappings
|
|
3
|
+
* Consolidates duplicate color assignments for consistent UI styling
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Unified mapping of status states to Tailwind CSS color classes
|
|
7
|
+
* Groups similar states that should have the same visual treatment
|
|
8
|
+
*/
|
|
9
|
+
export declare const UNIFIED_STATUS_COLORS: {
|
|
10
|
+
readonly pending: "text-warning-600";
|
|
11
|
+
readonly awaiting: "text-warning-600";
|
|
12
|
+
readonly pending_review: "text-warning-600";
|
|
13
|
+
readonly on_hold: "text-warning-600";
|
|
14
|
+
readonly processing: "text-primary-600";
|
|
15
|
+
readonly in_progress: "text-primary-600";
|
|
16
|
+
readonly active: "text-primary-600";
|
|
17
|
+
readonly completed: "text-success-700";
|
|
18
|
+
readonly approved: "text-success-600";
|
|
19
|
+
readonly executed: "text-success-600";
|
|
20
|
+
readonly settled: "text-success-600";
|
|
21
|
+
readonly success: "text-success-600";
|
|
22
|
+
readonly failed: "text-error-700";
|
|
23
|
+
readonly rejected: "text-error-600";
|
|
24
|
+
readonly error: "text-error-600";
|
|
25
|
+
readonly cancelled: "text-content-subtle";
|
|
26
|
+
readonly expired: "text-content-subtle";
|
|
27
|
+
readonly inactive: "text-content-subtle";
|
|
28
|
+
readonly closed: "text-content-subtle";
|
|
29
|
+
readonly default: "text-content-subtle";
|
|
30
|
+
};
|
|
31
|
+
export type StatusColorKey = keyof typeof UNIFIED_STATUS_COLORS;
|
|
32
|
+
export type StatusColorValue = (typeof UNIFIED_STATUS_COLORS)[StatusColorKey];
|
|
33
|
+
/**
|
|
34
|
+
* Get color class for a status
|
|
35
|
+
* @param status - The status key (lowercase)
|
|
36
|
+
* @returns The Tailwind CSS color class
|
|
37
|
+
*/
|
|
38
|
+
export declare const getStatusColor: (status: string) => string;
|
|
39
|
+
/**
|
|
40
|
+
* Background color variants for status states
|
|
41
|
+
* Uses lighter shades for backgrounds
|
|
42
|
+
*/
|
|
43
|
+
export declare const UNIFIED_STATUS_BG_COLORS: {
|
|
44
|
+
readonly pending: "bg-warning-50";
|
|
45
|
+
readonly awaiting: "bg-warning-50";
|
|
46
|
+
readonly pending_review: "bg-warning-50";
|
|
47
|
+
readonly on_hold: "bg-warning-50";
|
|
48
|
+
readonly processing: "bg-primary-50";
|
|
49
|
+
readonly in_progress: "bg-primary-50";
|
|
50
|
+
readonly active: "bg-primary-50";
|
|
51
|
+
readonly completed: "bg-success-50";
|
|
52
|
+
readonly approved: "bg-success-50";
|
|
53
|
+
readonly executed: "bg-success-50";
|
|
54
|
+
readonly settled: "bg-success-50";
|
|
55
|
+
readonly success: "bg-success-50";
|
|
56
|
+
readonly failed: "bg-error-50";
|
|
57
|
+
readonly rejected: "bg-error-50";
|
|
58
|
+
readonly error: "bg-error-50";
|
|
59
|
+
readonly cancelled: "bg-gray-50";
|
|
60
|
+
readonly expired: "bg-gray-50";
|
|
61
|
+
readonly inactive: "bg-gray-50";
|
|
62
|
+
readonly closed: "bg-gray-50";
|
|
63
|
+
readonly default: "bg-gray-50";
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Badge color combinations (background + text)
|
|
67
|
+
* For use in status badges and pills
|
|
68
|
+
*/
|
|
69
|
+
export declare const UNIFIED_STATUS_BADGE_COLORS: {
|
|
70
|
+
readonly pending: "bg-warning-100 text-warning-700";
|
|
71
|
+
readonly awaiting: "bg-warning-100 text-warning-700";
|
|
72
|
+
readonly pending_review: "bg-warning-100 text-warning-700";
|
|
73
|
+
readonly on_hold: "bg-warning-100 text-warning-700";
|
|
74
|
+
readonly processing: "bg-primary-100 text-primary-700";
|
|
75
|
+
readonly in_progress: "bg-primary-100 text-primary-700";
|
|
76
|
+
readonly active: "bg-primary-100 text-primary-700";
|
|
77
|
+
readonly completed: "bg-success-100 text-success-700";
|
|
78
|
+
readonly approved: "bg-success-100 text-success-700";
|
|
79
|
+
readonly executed: "bg-success-100 text-success-700";
|
|
80
|
+
readonly settled: "bg-success-100 text-success-700";
|
|
81
|
+
readonly success: "bg-success-100 text-success-700";
|
|
82
|
+
readonly failed: "bg-error-100 text-error-700";
|
|
83
|
+
readonly rejected: "bg-error-100 text-error-700";
|
|
84
|
+
readonly error: "bg-error-100 text-error-700";
|
|
85
|
+
readonly cancelled: "bg-gray-100 text-gray-700";
|
|
86
|
+
readonly expired: "bg-gray-100 text-gray-700";
|
|
87
|
+
readonly inactive: "bg-gray-100 text-gray-700";
|
|
88
|
+
readonly closed: "bg-gray-100 text-gray-700";
|
|
89
|
+
readonly default: "bg-gray-100 text-gray-700";
|
|
90
|
+
};
|
|
91
|
+
//# sourceMappingURL=status-colors-unified.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status-colors-unified.d.ts","sourceRoot":"","sources":["../../src/ui/status-colors-unified.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;CA8BxB,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,qBAAqB,CAAC;AAChE,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,cAAc,CAAC,CAAC;AAE9E;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,QAAQ,MAAM,KAAG,MAG/C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;CA8B3B,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;CA8B9B,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified status color mappings
|
|
3
|
+
* Consolidates duplicate color assignments for consistent UI styling
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Unified mapping of status states to Tailwind CSS color classes
|
|
7
|
+
* Groups similar states that should have the same visual treatment
|
|
8
|
+
*/
|
|
9
|
+
export const UNIFIED_STATUS_COLORS = {
|
|
10
|
+
// Pending/Waiting states - Warning color (amber/yellow)
|
|
11
|
+
pending: 'text-warning-600',
|
|
12
|
+
awaiting: 'text-warning-600',
|
|
13
|
+
pending_review: 'text-warning-600',
|
|
14
|
+
on_hold: 'text-warning-600',
|
|
15
|
+
// Processing/Active states - Primary color (blue)
|
|
16
|
+
processing: 'text-primary-600',
|
|
17
|
+
in_progress: 'text-primary-600',
|
|
18
|
+
active: 'text-primary-600',
|
|
19
|
+
// Success states - Success color (green)
|
|
20
|
+
completed: 'text-success-700',
|
|
21
|
+
approved: 'text-success-600',
|
|
22
|
+
executed: 'text-success-600',
|
|
23
|
+
settled: 'text-success-600',
|
|
24
|
+
success: 'text-success-600',
|
|
25
|
+
// Error states - Error color (red)
|
|
26
|
+
failed: 'text-error-700',
|
|
27
|
+
rejected: 'text-error-600',
|
|
28
|
+
error: 'text-error-600',
|
|
29
|
+
// Neutral/Cancelled states - Subtle color (gray)
|
|
30
|
+
cancelled: 'text-content-subtle',
|
|
31
|
+
expired: 'text-content-subtle',
|
|
32
|
+
inactive: 'text-content-subtle',
|
|
33
|
+
closed: 'text-content-subtle',
|
|
34
|
+
default: 'text-content-subtle',
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Get color class for a status
|
|
38
|
+
* @param status - The status key (lowercase)
|
|
39
|
+
* @returns The Tailwind CSS color class
|
|
40
|
+
*/
|
|
41
|
+
export const getStatusColor = (status) => {
|
|
42
|
+
const normalizedStatus = status.toLowerCase().replace(/_/g, '_');
|
|
43
|
+
return UNIFIED_STATUS_COLORS[normalizedStatus] || UNIFIED_STATUS_COLORS.default;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Background color variants for status states
|
|
47
|
+
* Uses lighter shades for backgrounds
|
|
48
|
+
*/
|
|
49
|
+
export const UNIFIED_STATUS_BG_COLORS = {
|
|
50
|
+
// Pending/Waiting states
|
|
51
|
+
pending: 'bg-warning-50',
|
|
52
|
+
awaiting: 'bg-warning-50',
|
|
53
|
+
pending_review: 'bg-warning-50',
|
|
54
|
+
on_hold: 'bg-warning-50',
|
|
55
|
+
// Processing/Active states
|
|
56
|
+
processing: 'bg-primary-50',
|
|
57
|
+
in_progress: 'bg-primary-50',
|
|
58
|
+
active: 'bg-primary-50',
|
|
59
|
+
// Success states
|
|
60
|
+
completed: 'bg-success-50',
|
|
61
|
+
approved: 'bg-success-50',
|
|
62
|
+
executed: 'bg-success-50',
|
|
63
|
+
settled: 'bg-success-50',
|
|
64
|
+
success: 'bg-success-50',
|
|
65
|
+
// Error states
|
|
66
|
+
failed: 'bg-error-50',
|
|
67
|
+
rejected: 'bg-error-50',
|
|
68
|
+
error: 'bg-error-50',
|
|
69
|
+
// Neutral/Cancelled states
|
|
70
|
+
cancelled: 'bg-gray-50',
|
|
71
|
+
expired: 'bg-gray-50',
|
|
72
|
+
inactive: 'bg-gray-50',
|
|
73
|
+
closed: 'bg-gray-50',
|
|
74
|
+
default: 'bg-gray-50',
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Badge color combinations (background + text)
|
|
78
|
+
* For use in status badges and pills
|
|
79
|
+
*/
|
|
80
|
+
export const UNIFIED_STATUS_BADGE_COLORS = {
|
|
81
|
+
// Pending/Waiting states
|
|
82
|
+
pending: 'bg-warning-100 text-warning-700',
|
|
83
|
+
awaiting: 'bg-warning-100 text-warning-700',
|
|
84
|
+
pending_review: 'bg-warning-100 text-warning-700',
|
|
85
|
+
on_hold: 'bg-warning-100 text-warning-700',
|
|
86
|
+
// Processing/Active states
|
|
87
|
+
processing: 'bg-primary-100 text-primary-700',
|
|
88
|
+
in_progress: 'bg-primary-100 text-primary-700',
|
|
89
|
+
active: 'bg-primary-100 text-primary-700',
|
|
90
|
+
// Success states
|
|
91
|
+
completed: 'bg-success-100 text-success-700',
|
|
92
|
+
approved: 'bg-success-100 text-success-700',
|
|
93
|
+
executed: 'bg-success-100 text-success-700',
|
|
94
|
+
settled: 'bg-success-100 text-success-700',
|
|
95
|
+
success: 'bg-success-100 text-success-700',
|
|
96
|
+
// Error states
|
|
97
|
+
failed: 'bg-error-100 text-error-700',
|
|
98
|
+
rejected: 'bg-error-100 text-error-700',
|
|
99
|
+
error: 'bg-error-100 text-error-700',
|
|
100
|
+
// Neutral/Cancelled states
|
|
101
|
+
cancelled: 'bg-gray-100 text-gray-700',
|
|
102
|
+
expired: 'bg-gray-100 text-gray-700',
|
|
103
|
+
inactive: 'bg-gray-100 text-gray-700',
|
|
104
|
+
closed: 'bg-gray-100 text-gray-700',
|
|
105
|
+
default: 'bg-gray-100 text-gray-700',
|
|
106
|
+
};
|
|
@@ -2,38 +2,28 @@
|
|
|
2
2
|
* Common shared constants
|
|
3
3
|
* These match the constants from Blueberry's src/constants/common.ts
|
|
4
4
|
*/
|
|
5
|
-
export declare const DECIMAL_PLACES
|
|
6
|
-
export declare const DEFAULT_NUMERIC_ZERO
|
|
7
|
-
export declare const DEFAULT_EMPTY_STRING
|
|
8
|
-
export declare const QUANTITY_FORMAT_THRESHOLD: {
|
|
9
|
-
readonly MILLION: 1000000;
|
|
10
|
-
readonly THOUSAND: 1000;
|
|
11
|
-
};
|
|
5
|
+
export declare const DECIMAL_PLACES: 2;
|
|
6
|
+
export declare const DEFAULT_NUMERIC_ZERO: 0;
|
|
7
|
+
export declare const DEFAULT_EMPTY_STRING: "";
|
|
12
8
|
export declare const QUANTITY_FORMAT_THRESHOLD_MILLION: 1000000;
|
|
13
9
|
export declare const QUANTITY_FORMAT_THRESHOLD_THOUSAND: 1000;
|
|
14
|
-
export declare const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
19
|
-
export type ErrorType = (typeof ERROR_TYPE)[keyof typeof ERROR_TYPE];
|
|
20
|
-
export declare const ERROR_TYPE_BUSINESS_LOGIC: "business_logic";
|
|
21
|
-
export declare const ERROR_TYPE_PERMISSION: "permission";
|
|
22
|
-
export declare const ERROR_TYPE_SERVER: "server";
|
|
23
|
-
export declare const LOCALE_AUSTRALIA = "en-AU";
|
|
10
|
+
export declare const ERROR_TYPE_BUSINESS_LOGIC = "business_logic";
|
|
11
|
+
export declare const ERROR_TYPE_PERMISSION = "permission";
|
|
12
|
+
export declare const ERROR_TYPE_SERVER = "server";
|
|
13
|
+
export declare const LOCALE_AUSTRALIA: "en-AU";
|
|
24
14
|
export declare const NUMBER_FORMAT_OPTIONS_CURRENCY: {
|
|
25
15
|
readonly style: "currency";
|
|
26
16
|
readonly minimumFractionDigits: 2;
|
|
27
17
|
readonly maximumFractionDigits: 2;
|
|
28
18
|
};
|
|
29
19
|
export declare const NUMBER_FORMAT_OPTIONS_CURRENCY_SIGNED: {
|
|
30
|
-
readonly signDisplay: "always";
|
|
31
20
|
readonly style: "currency";
|
|
32
21
|
readonly minimumFractionDigits: 2;
|
|
33
22
|
readonly maximumFractionDigits: 2;
|
|
23
|
+
readonly signDisplay: "always";
|
|
34
24
|
};
|
|
35
25
|
export declare const QUERY_PARAM_ORDER_BY = "order_by";
|
|
36
26
|
export declare const ORDER_BY_CREATED_AT = "created_at";
|
|
37
|
-
export declare const DEFAULT_UNKNOWN_VALUE
|
|
38
|
-
export declare const DEFAULT_ERROR_MESSAGE
|
|
27
|
+
export declare const DEFAULT_UNKNOWN_VALUE: "Unknown";
|
|
28
|
+
export declare const DEFAULT_ERROR_MESSAGE: "An error occurred";
|
|
39
29
|
//# sourceMappingURL=common.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/utilities/common.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/utilities/common.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,eAAO,MAAM,cAAc,GAAqC,CAAC;AAGjE,eAAO,MAAM,oBAAoB,GAAuB,CAAC;AACzD,eAAO,MAAM,oBAAoB,IAAwB,CAAC;AAG1D,eAAO,MAAM,iCAAiC,SAA4B,CAAC;AAC3E,eAAO,MAAM,kCAAkC,MAA6B,CAAC;AAG7E,eAAO,MAAM,yBAAyB,mBAAmB,CAAC;AAC1D,eAAO,MAAM,qBAAqB,eAAe,CAAC;AAClD,eAAO,MAAM,iBAAiB,WAAW,CAAC;AAG1C,eAAO,MAAM,gBAAgB,SAAwB,CAAC;AAGtD,eAAO,MAAM,8BAA8B;;;;CAAkC,CAAC;AAE9E,eAAO,MAAM,qCAAqC;;;;;CAAyC,CAAC;AAG5F,eAAO,MAAM,oBAAoB,aAAa,CAAC;AAC/C,eAAO,MAAM,mBAAmB,eAAe,CAAC;AAGhD,eAAO,MAAM,qBAAqB,WAA0B,CAAC;AAC7D,eAAO,MAAM,qBAAqB,qBAAgC,CAAC"}
|
package/dist/utilities/common.js
CHANGED
|
@@ -2,44 +2,27 @@
|
|
|
2
2
|
* Common shared constants
|
|
3
3
|
* These match the constants from Blueberry's src/constants/common.ts
|
|
4
4
|
*/
|
|
5
|
+
import { COMMON_THRESHOLDS, DEFAULT_STRINGS, DEFAULT_NUMBERS, LOCALE_CONFIG, DEFAULT_FORMAT_OPTIONS } from '../config';
|
|
5
6
|
// Number formatting
|
|
6
|
-
export const DECIMAL_PLACES =
|
|
7
|
+
export const DECIMAL_PLACES = COMMON_THRESHOLDS.DEFAULT_DECIMALS;
|
|
7
8
|
// Default numeric values
|
|
8
|
-
export const DEFAULT_NUMERIC_ZERO =
|
|
9
|
-
export const DEFAULT_EMPTY_STRING =
|
|
9
|
+
export const DEFAULT_NUMERIC_ZERO = DEFAULT_NUMBERS.ZERO;
|
|
10
|
+
export const DEFAULT_EMPTY_STRING = DEFAULT_STRINGS.EMPTY;
|
|
10
11
|
// Quantity formatting thresholds
|
|
11
|
-
export const
|
|
12
|
-
|
|
13
|
-
THOUSAND: 1000,
|
|
14
|
-
};
|
|
15
|
-
// Backward compatibility: individual exports
|
|
16
|
-
export const QUANTITY_FORMAT_THRESHOLD_MILLION = QUANTITY_FORMAT_THRESHOLD.MILLION;
|
|
17
|
-
export const QUANTITY_FORMAT_THRESHOLD_THOUSAND = QUANTITY_FORMAT_THRESHOLD.THOUSAND;
|
|
12
|
+
export const QUANTITY_FORMAT_THRESHOLD_MILLION = COMMON_THRESHOLDS.MILLION;
|
|
13
|
+
export const QUANTITY_FORMAT_THRESHOLD_THOUSAND = COMMON_THRESHOLDS.THOUSAND;
|
|
18
14
|
// Error types
|
|
19
|
-
export const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
SERVER: 'server',
|
|
23
|
-
};
|
|
24
|
-
// Backward compatibility: individual exports
|
|
25
|
-
export const ERROR_TYPE_BUSINESS_LOGIC = ERROR_TYPE.BUSINESS_LOGIC;
|
|
26
|
-
export const ERROR_TYPE_PERMISSION = ERROR_TYPE.PERMISSION;
|
|
27
|
-
export const ERROR_TYPE_SERVER = ERROR_TYPE.SERVER;
|
|
15
|
+
export const ERROR_TYPE_BUSINESS_LOGIC = 'business_logic';
|
|
16
|
+
export const ERROR_TYPE_PERMISSION = 'permission';
|
|
17
|
+
export const ERROR_TYPE_SERVER = 'server';
|
|
28
18
|
// Locale and formatting constants
|
|
29
|
-
export const LOCALE_AUSTRALIA =
|
|
19
|
+
export const LOCALE_AUSTRALIA = LOCALE_CONFIG.DEFAULT;
|
|
30
20
|
// Number formatting options
|
|
31
|
-
export const NUMBER_FORMAT_OPTIONS_CURRENCY =
|
|
32
|
-
|
|
33
|
-
minimumFractionDigits: DECIMAL_PLACES,
|
|
34
|
-
maximumFractionDigits: DECIMAL_PLACES,
|
|
35
|
-
};
|
|
36
|
-
export const NUMBER_FORMAT_OPTIONS_CURRENCY_SIGNED = {
|
|
37
|
-
...NUMBER_FORMAT_OPTIONS_CURRENCY,
|
|
38
|
-
signDisplay: 'always',
|
|
39
|
-
};
|
|
21
|
+
export const NUMBER_FORMAT_OPTIONS_CURRENCY = DEFAULT_FORMAT_OPTIONS.CURRENCY;
|
|
22
|
+
export const NUMBER_FORMAT_OPTIONS_CURRENCY_SIGNED = DEFAULT_FORMAT_OPTIONS.CURRENCY_SIGNED;
|
|
40
23
|
// Query parameter constants
|
|
41
24
|
export const QUERY_PARAM_ORDER_BY = 'order_by';
|
|
42
25
|
export const ORDER_BY_CREATED_AT = 'created_at';
|
|
43
26
|
// Default strings for auth
|
|
44
|
-
export const DEFAULT_UNKNOWN_VALUE =
|
|
45
|
-
export const DEFAULT_ERROR_MESSAGE =
|
|
27
|
+
export const DEFAULT_UNKNOWN_VALUE = DEFAULT_STRINGS.UNKNOWN;
|
|
28
|
+
export const DEFAULT_ERROR_MESSAGE = DEFAULT_STRINGS.ERROR_MESSAGE;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/utilities/defaults.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/utilities/defaults.ts"],"names":[],"mappings":"AAAA;;GAEG;AAYH,eAAO,MAAM,cAAc;;;;;;CAMjB,CAAC;AAIX,eAAO,MAAM,gBAAgB;;;;;;CAMnB,CAAC;AAIX,eAAO,MAAM,mBAAmB;;;;;;CAMtB,CAAC;AAIX,eAAO,MAAM,UAAU;;;;;;CAMb,CAAC;AAIX,eAAO,MAAM,cAAc;;;;;;CAMjB,CAAC;AAIX,eAAO,MAAM,mBAAmB;;;;CAItB,CAAC"}
|
|
@@ -1,50 +1,57 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Default values and common constants
|
|
3
3
|
*/
|
|
4
|
+
import { DEFAULT_STRINGS, DEFAULT_NUMBERS, PAGINATION_CONFIG, COMMON_THRESHOLDS, CONFIG_ALLOCATION_DEFAULTS, } from '../config';
|
|
4
5
|
// Default values
|
|
6
|
+
// Now references consolidated defaults
|
|
5
7
|
export const DEFAULT_VALUES = {
|
|
6
|
-
ZERO:
|
|
7
|
-
EMPTY_STRING:
|
|
8
|
-
UNKNOWN: 'UNKNOWN',
|
|
9
|
-
NOT_APPLICABLE:
|
|
10
|
-
NULL_UUID:
|
|
8
|
+
ZERO: DEFAULT_STRINGS.ZERO,
|
|
9
|
+
EMPTY_STRING: DEFAULT_STRINGS.EMPTY,
|
|
10
|
+
UNKNOWN: 'UNKNOWN', // Different from DEFAULT_STRINGS.UNKNOWN ('Unknown')
|
|
11
|
+
NOT_APPLICABLE: DEFAULT_STRINGS.NOT_APPLICABLE,
|
|
12
|
+
NULL_UUID: DEFAULT_STRINGS.NULL_UUID,
|
|
11
13
|
};
|
|
12
14
|
// Numeric defaults
|
|
15
|
+
// Now references consolidated thresholds
|
|
13
16
|
export const NUMERIC_DEFAULTS = {
|
|
14
|
-
MIN_AMOUNT:
|
|
15
|
-
MAX_AMOUNT: 999999999.99,
|
|
16
|
-
DEFAULT_PRECISION:
|
|
17
|
-
PERCENTAGE_PRECISION:
|
|
18
|
-
QUANTITY_PRECISION:
|
|
17
|
+
MIN_AMOUNT: DEFAULT_NUMBERS.ZERO,
|
|
18
|
+
MAX_AMOUNT: 999999999.99, // Keep specific value
|
|
19
|
+
DEFAULT_PRECISION: DEFAULT_NUMBERS.PRECISION,
|
|
20
|
+
PERCENTAGE_PRECISION: DEFAULT_NUMBERS.PERCENTAGE_PRECISION,
|
|
21
|
+
QUANTITY_PRECISION: DEFAULT_NUMBERS.QUANTITY_PRECISION,
|
|
19
22
|
};
|
|
20
23
|
// Pagination defaults
|
|
24
|
+
// @deprecated Use PAGINATION_CONFIG from config/pagination instead
|
|
21
25
|
export const PAGINATION_DEFAULTS = {
|
|
22
|
-
PAGE:
|
|
23
|
-
PAGE_SIZE:
|
|
24
|
-
MIN_PAGE_SIZE:
|
|
25
|
-
MAX_PAGE_SIZE:
|
|
26
|
-
PAGE_SIZE_OPTIONS:
|
|
26
|
+
PAGE: PAGINATION_CONFIG.DEFAULT_PAGE,
|
|
27
|
+
PAGE_SIZE: PAGINATION_CONFIG.DEFAULT_PAGE_SIZE,
|
|
28
|
+
MIN_PAGE_SIZE: PAGINATION_CONFIG.MIN_PAGE_SIZE,
|
|
29
|
+
MAX_PAGE_SIZE: PAGINATION_CONFIG.MAX_PAGE_SIZE,
|
|
30
|
+
PAGE_SIZE_OPTIONS: PAGINATION_CONFIG.PAGE_SIZE_OPTIONS,
|
|
27
31
|
};
|
|
28
32
|
// Common thresholds
|
|
33
|
+
// Now references consolidated thresholds
|
|
29
34
|
export const THRESHOLDS = {
|
|
30
|
-
MIN_PORTFOLIO_VALUE:
|
|
31
|
-
MIN_TRADE_AMOUNT:
|
|
32
|
-
MIN_WITHDRAWAL_AMOUNT:
|
|
33
|
-
MAX_PORTFOLIOS_PER_USER:
|
|
34
|
-
MAX_TRADES_PER_DAY:
|
|
35
|
+
MIN_PORTFOLIO_VALUE: COMMON_THRESHOLDS.MIN_PORTFOLIO_VALUE,
|
|
36
|
+
MIN_TRADE_AMOUNT: COMMON_THRESHOLDS.MIN_TRADE_AMOUNT,
|
|
37
|
+
MIN_WITHDRAWAL_AMOUNT: COMMON_THRESHOLDS.MIN_WITHDRAWAL_AMOUNT,
|
|
38
|
+
MAX_PORTFOLIOS_PER_USER: COMMON_THRESHOLDS.MAX_PORTFOLIOS_PER_USER,
|
|
39
|
+
MAX_TRADES_PER_DAY: COMMON_THRESHOLDS.MAX_TRADES_PER_DAY,
|
|
35
40
|
};
|
|
36
41
|
// Display limits
|
|
42
|
+
// Now references consolidated thresholds
|
|
37
43
|
export const DISPLAY_LIMITS = {
|
|
38
|
-
MAX_NAME_LENGTH:
|
|
39
|
-
MAX_DESCRIPTION_LENGTH:
|
|
40
|
-
MAX_NOTES_LENGTH:
|
|
41
|
-
MAX_FILE_SIZE_MB:
|
|
42
|
-
MAX_FILE_NAME_LENGTH:
|
|
44
|
+
MAX_NAME_LENGTH: COMMON_THRESHOLDS.MAX_NAME_LENGTH,
|
|
45
|
+
MAX_DESCRIPTION_LENGTH: COMMON_THRESHOLDS.MAX_DESCRIPTION_LENGTH,
|
|
46
|
+
MAX_NOTES_LENGTH: COMMON_THRESHOLDS.MAX_NOTES_LENGTH,
|
|
47
|
+
MAX_FILE_SIZE_MB: COMMON_THRESHOLDS.MAX_FILE_SIZE_MB,
|
|
48
|
+
MAX_FILE_NAME_LENGTH: COMMON_THRESHOLDS.MAX_FILE_NAME_LENGTH,
|
|
43
49
|
};
|
|
44
50
|
// Asset allocation defaults
|
|
51
|
+
// Now references consolidated defaults
|
|
45
52
|
export const ALLOCATION_DEFAULTS = {
|
|
46
|
-
DEFAULT_PERCENTAGE:
|
|
47
|
-
PERCENTAGE_PRECISION:
|
|
48
|
-
TARGET_TOTAL:
|
|
53
|
+
DEFAULT_PERCENTAGE: CONFIG_ALLOCATION_DEFAULTS.DEFAULT_PERCENTAGE,
|
|
54
|
+
PERCENTAGE_PRECISION: CONFIG_ALLOCATION_DEFAULTS.PERCENTAGE_PRECISION,
|
|
55
|
+
TARGET_TOTAL: CONFIG_ALLOCATION_DEFAULTS.TARGET_TOTAL,
|
|
49
56
|
};
|
|
50
57
|
// Note: DEFAULT_UNKNOWN_VALUE and DEFAULT_ERROR_MESSAGE are already exported from common.ts
|