@cranberry-money/shared-constants 4.11.0 → 4.12.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/config.d.ts.map +1 -1
- package/dist/api/config.js +11 -8
- 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/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 +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/utilities/common.d.ts +9 -9
- package/dist/utilities/common.d.ts.map +1 -1
- package/dist/utilities/common.js +11 -17
- package/dist/utilities/defaults.d.ts.map +1 -1
- package/dist/utilities/defaults.js +35 -28
- package/package.json +1 -1
package/dist/api/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/api/config.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/api/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,eAAO,MAAM,YAAY;;;CAGf,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAI1E,eAAO,MAAM,UAAU;;;;;;CAMb,CAAC;AAIX,eAAO,MAAM,mBAAmB;;;;CAItB,CAAC;AAGX,eAAO,MAAM,eAAe;;;;;;;;;;;;;CAoBlB,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC"}
|
package/dist/api/config.js
CHANGED
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* API configuration constants
|
|
3
3
|
*/
|
|
4
|
+
import { PAGINATION_CONFIG, COMMON_THRESHOLDS } from '../config';
|
|
4
5
|
// API Versions
|
|
5
6
|
export const API_VERSIONS = {
|
|
6
7
|
V1: 'v1',
|
|
7
8
|
V2: 'v2',
|
|
8
9
|
};
|
|
9
10
|
// API Configuration
|
|
11
|
+
// Now references common thresholds for consistency
|
|
10
12
|
export const API_CONFIG = {
|
|
11
|
-
DEFAULT_TIMEOUT:
|
|
12
|
-
DEFAULT_RETRY_ATTEMPTS:
|
|
13
|
-
DEFAULT_RETRY_DELAY:
|
|
14
|
-
MAX_RETRY_DELAY:
|
|
15
|
-
REQUEST_DEBOUNCE_MS:
|
|
13
|
+
DEFAULT_TIMEOUT: COMMON_THRESHOLDS.DEFAULT_TIMEOUT_MS,
|
|
14
|
+
DEFAULT_RETRY_ATTEMPTS: COMMON_THRESHOLDS.DEFAULT_RETRY_ATTEMPTS,
|
|
15
|
+
DEFAULT_RETRY_DELAY: COMMON_THRESHOLDS.DEFAULT_RETRY_DELAY_MS,
|
|
16
|
+
MAX_RETRY_DELAY: COMMON_THRESHOLDS.MAX_RETRY_DELAY_MS,
|
|
17
|
+
REQUEST_DEBOUNCE_MS: COMMON_THRESHOLDS.REQUEST_DEBOUNCE_MS,
|
|
16
18
|
};
|
|
17
19
|
// API Response Configuration
|
|
20
|
+
// @deprecated Use PAGINATION_CONFIG from config/pagination instead
|
|
18
21
|
export const API_RESPONSE_CONFIG = {
|
|
19
|
-
DEFAULT_PAGE_SIZE:
|
|
20
|
-
MAX_PAGE_SIZE:
|
|
21
|
-
DEFAULT_SORT_ORDER:
|
|
22
|
+
DEFAULT_PAGE_SIZE: PAGINATION_CONFIG.DEFAULT_PAGE_SIZE,
|
|
23
|
+
MAX_PAGE_SIZE: PAGINATION_CONFIG.MAX_PAGE_SIZE,
|
|
24
|
+
DEFAULT_SORT_ORDER: PAGINATION_CONFIG.DEFAULT_SORT_ORDER,
|
|
22
25
|
};
|
|
23
26
|
// API Error Codes (custom application codes)
|
|
24
27
|
export const API_ERROR_CODES = {
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified default values
|
|
3
|
+
* Consolidates common default values used across the application
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Default string values
|
|
7
|
+
*/
|
|
8
|
+
export declare const DEFAULT_STRINGS: {
|
|
9
|
+
readonly EMPTY: "";
|
|
10
|
+
readonly UNKNOWN: "Unknown";
|
|
11
|
+
readonly NOT_APPLICABLE: "N/A";
|
|
12
|
+
readonly ERROR_MESSAGE: "An error occurred";
|
|
13
|
+
readonly ZERO: "0";
|
|
14
|
+
readonly NULL_UUID: "00000000-0000-0000-0000-000000000000";
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Default numeric values
|
|
18
|
+
*/
|
|
19
|
+
export declare const DEFAULT_NUMBERS: {
|
|
20
|
+
readonly ZERO: 0;
|
|
21
|
+
readonly PRECISION: 2;
|
|
22
|
+
readonly PERCENTAGE_PRECISION: 2;
|
|
23
|
+
readonly QUANTITY_PRECISION: 6;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Locale configuration
|
|
27
|
+
*/
|
|
28
|
+
export declare const LOCALE_CONFIG: {
|
|
29
|
+
readonly DEFAULT: "en-AU";
|
|
30
|
+
readonly FALLBACK: "en-US";
|
|
31
|
+
readonly SUPPORTED: readonly ["en-AU", "en-US", "en-GB"];
|
|
32
|
+
};
|
|
33
|
+
export type SupportedLocale = (typeof LOCALE_CONFIG.SUPPORTED)[number];
|
|
34
|
+
/**
|
|
35
|
+
* Default allocation values
|
|
36
|
+
*/
|
|
37
|
+
export declare const CONFIG_ALLOCATION_DEFAULTS: {
|
|
38
|
+
readonly DEFAULT_PERCENTAGE: 10;
|
|
39
|
+
readonly PERCENTAGE_PRECISION: 0.01;
|
|
40
|
+
readonly TARGET_TOTAL: 100;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Default format options for number formatting
|
|
44
|
+
*/
|
|
45
|
+
export declare const DEFAULT_FORMAT_OPTIONS: {
|
|
46
|
+
readonly CURRENCY: {
|
|
47
|
+
readonly style: "currency";
|
|
48
|
+
readonly minimumFractionDigits: 2;
|
|
49
|
+
readonly maximumFractionDigits: 2;
|
|
50
|
+
};
|
|
51
|
+
readonly CURRENCY_SIGNED: {
|
|
52
|
+
readonly style: "currency";
|
|
53
|
+
readonly minimumFractionDigits: 2;
|
|
54
|
+
readonly maximumFractionDigits: 2;
|
|
55
|
+
readonly signDisplay: "always";
|
|
56
|
+
};
|
|
57
|
+
readonly PERCENTAGE: {
|
|
58
|
+
readonly style: "percent";
|
|
59
|
+
readonly minimumFractionDigits: 0;
|
|
60
|
+
readonly maximumFractionDigits: 2;
|
|
61
|
+
};
|
|
62
|
+
readonly DECIMAL: {
|
|
63
|
+
readonly style: "decimal";
|
|
64
|
+
readonly minimumFractionDigits: 0;
|
|
65
|
+
readonly maximumFractionDigits: 8;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=defaults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/config/defaults.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;CAOlB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;CAKlB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,aAAa;;;;CAIhB,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,aAAa,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvE;;GAEG;AACH,eAAO,MAAM,0BAA0B;;;;CAI7B,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;CAsBzB,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified default values
|
|
3
|
+
* Consolidates common default values used across the application
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Default string values
|
|
7
|
+
*/
|
|
8
|
+
export const DEFAULT_STRINGS = {
|
|
9
|
+
EMPTY: '',
|
|
10
|
+
UNKNOWN: 'Unknown',
|
|
11
|
+
NOT_APPLICABLE: 'N/A',
|
|
12
|
+
ERROR_MESSAGE: 'An error occurred',
|
|
13
|
+
ZERO: '0',
|
|
14
|
+
NULL_UUID: '00000000-0000-0000-0000-000000000000',
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Default numeric values
|
|
18
|
+
*/
|
|
19
|
+
export const DEFAULT_NUMBERS = {
|
|
20
|
+
ZERO: 0,
|
|
21
|
+
PRECISION: 2,
|
|
22
|
+
PERCENTAGE_PRECISION: 2,
|
|
23
|
+
QUANTITY_PRECISION: 6,
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Locale configuration
|
|
27
|
+
*/
|
|
28
|
+
export const LOCALE_CONFIG = {
|
|
29
|
+
DEFAULT: 'en-AU',
|
|
30
|
+
FALLBACK: 'en-US',
|
|
31
|
+
SUPPORTED: ['en-AU', 'en-US', 'en-GB'],
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Default allocation values
|
|
35
|
+
*/
|
|
36
|
+
export const CONFIG_ALLOCATION_DEFAULTS = {
|
|
37
|
+
DEFAULT_PERCENTAGE: 10,
|
|
38
|
+
PERCENTAGE_PRECISION: 0.01,
|
|
39
|
+
TARGET_TOTAL: 100,
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Default format options for number formatting
|
|
43
|
+
*/
|
|
44
|
+
export const DEFAULT_FORMAT_OPTIONS = {
|
|
45
|
+
CURRENCY: {
|
|
46
|
+
style: 'currency',
|
|
47
|
+
minimumFractionDigits: DEFAULT_NUMBERS.PRECISION,
|
|
48
|
+
maximumFractionDigits: DEFAULT_NUMBERS.PRECISION,
|
|
49
|
+
},
|
|
50
|
+
CURRENCY_SIGNED: {
|
|
51
|
+
style: 'currency',
|
|
52
|
+
minimumFractionDigits: DEFAULT_NUMBERS.PRECISION,
|
|
53
|
+
maximumFractionDigits: DEFAULT_NUMBERS.PRECISION,
|
|
54
|
+
signDisplay: 'always',
|
|
55
|
+
},
|
|
56
|
+
PERCENTAGE: {
|
|
57
|
+
style: 'percent',
|
|
58
|
+
minimumFractionDigits: 0,
|
|
59
|
+
maximumFractionDigits: DEFAULT_NUMBERS.PERCENTAGE_PRECISION,
|
|
60
|
+
},
|
|
61
|
+
DECIMAL: {
|
|
62
|
+
style: 'decimal',
|
|
63
|
+
minimumFractionDigits: 0,
|
|
64
|
+
maximumFractionDigits: 8,
|
|
65
|
+
},
|
|
66
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified pagination configuration constants
|
|
3
|
+
* Consolidates pagination settings from multiple locations
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Pagination configuration
|
|
7
|
+
* Single source of truth for all pagination-related constants
|
|
8
|
+
*/
|
|
9
|
+
export declare const PAGINATION_CONFIG: {
|
|
10
|
+
readonly DEFAULT_PAGE: 1;
|
|
11
|
+
readonly DEFAULT_PAGE_SIZE: 20;
|
|
12
|
+
readonly MIN_PAGE_SIZE: 1;
|
|
13
|
+
readonly MAX_PAGE_SIZE: 100;
|
|
14
|
+
readonly PAGE_SIZE_OPTIONS: readonly [10, 20, 50, 100];
|
|
15
|
+
readonly DEFAULT_SORT_ORDER: "desc";
|
|
16
|
+
};
|
|
17
|
+
export type PageSizeOption = (typeof PAGINATION_CONFIG.PAGE_SIZE_OPTIONS)[number];
|
|
18
|
+
/**
|
|
19
|
+
* Get validated page size
|
|
20
|
+
* Ensures page size is within allowed limits
|
|
21
|
+
*/
|
|
22
|
+
export declare const getValidPageSize: (pageSize: number) => number;
|
|
23
|
+
/**
|
|
24
|
+
* Get validated page number
|
|
25
|
+
* Ensures page number is at least 1
|
|
26
|
+
*/
|
|
27
|
+
export declare const getValidPageNumber: (page: number) => number;
|
|
28
|
+
//# sourceMappingURL=pagination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../src/config/pagination.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;;CAcpB,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,iBAAiB,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAAI,UAAU,MAAM,KAAG,MAQnD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,KAAG,MAEjD,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified pagination configuration constants
|
|
3
|
+
* Consolidates pagination settings from multiple locations
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Pagination configuration
|
|
7
|
+
* Single source of truth for all pagination-related constants
|
|
8
|
+
*/
|
|
9
|
+
export const PAGINATION_CONFIG = {
|
|
10
|
+
// Default values
|
|
11
|
+
DEFAULT_PAGE: 1,
|
|
12
|
+
DEFAULT_PAGE_SIZE: 20,
|
|
13
|
+
// Limits
|
|
14
|
+
MIN_PAGE_SIZE: 1,
|
|
15
|
+
MAX_PAGE_SIZE: 100,
|
|
16
|
+
// Common page size options for dropdowns
|
|
17
|
+
PAGE_SIZE_OPTIONS: [10, 20, 50, 100],
|
|
18
|
+
// Default sort order
|
|
19
|
+
DEFAULT_SORT_ORDER: 'desc',
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Get validated page size
|
|
23
|
+
* Ensures page size is within allowed limits
|
|
24
|
+
*/
|
|
25
|
+
export const getValidPageSize = (pageSize) => {
|
|
26
|
+
if (pageSize < PAGINATION_CONFIG.MIN_PAGE_SIZE) {
|
|
27
|
+
return PAGINATION_CONFIG.MIN_PAGE_SIZE;
|
|
28
|
+
}
|
|
29
|
+
if (pageSize > PAGINATION_CONFIG.MAX_PAGE_SIZE) {
|
|
30
|
+
return PAGINATION_CONFIG.MAX_PAGE_SIZE;
|
|
31
|
+
}
|
|
32
|
+
return pageSize;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Get validated page number
|
|
36
|
+
* Ensures page number is at least 1
|
|
37
|
+
*/
|
|
38
|
+
export const getValidPageNumber = (page) => {
|
|
39
|
+
return Math.max(PAGINATION_CONFIG.DEFAULT_PAGE, page);
|
|
40
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified threshold and limit constants
|
|
3
|
+
* Consolidates numeric thresholds, limits, and common values
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Common numeric thresholds used across the application
|
|
7
|
+
*/
|
|
8
|
+
export declare const COMMON_THRESHOLDS: {
|
|
9
|
+
readonly THOUSAND: 1000;
|
|
10
|
+
readonly MILLION: 1000000;
|
|
11
|
+
readonly BILLION: 1000000000;
|
|
12
|
+
readonly DEFAULT_DECIMALS: 2;
|
|
13
|
+
readonly CURRENCY_DECIMALS: 2;
|
|
14
|
+
readonly PERCENTAGE_DECIMALS: 2;
|
|
15
|
+
readonly QUANTITY_DECIMALS: 6;
|
|
16
|
+
readonly PRICE_DECIMALS: 4;
|
|
17
|
+
readonly MAX_NAME_LENGTH: 100;
|
|
18
|
+
readonly MAX_DESCRIPTION_LENGTH: 500;
|
|
19
|
+
readonly MAX_NOTES_LENGTH: 1000;
|
|
20
|
+
readonly MIN_PASSWORD_LENGTH: 8;
|
|
21
|
+
readonly MAX_FILE_SIZE_MB: 10;
|
|
22
|
+
readonly MAX_FILE_NAME_LENGTH: 255;
|
|
23
|
+
readonly MIN_PORTFOLIO_VALUE: 1000;
|
|
24
|
+
readonly MIN_TRADE_AMOUNT: 10;
|
|
25
|
+
readonly MIN_WITHDRAWAL_AMOUNT: 100;
|
|
26
|
+
readonly MAX_PORTFOLIOS_PER_USER: 10;
|
|
27
|
+
readonly MAX_TRADES_PER_DAY: 100;
|
|
28
|
+
readonly MIN_DISPLAY_AMOUNT: 0.01;
|
|
29
|
+
readonly MIN_DISPLAY_PERCENTAGE: 0.01;
|
|
30
|
+
readonly DEFAULT_TIMEOUT_MS: 30000;
|
|
31
|
+
readonly DEFAULT_RETRY_ATTEMPTS: 3;
|
|
32
|
+
readonly DEFAULT_RETRY_DELAY_MS: 1000;
|
|
33
|
+
readonly MAX_RETRY_DELAY_MS: 10000;
|
|
34
|
+
readonly REQUEST_DEBOUNCE_MS: 300;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Numeric ranges for validation
|
|
38
|
+
*/
|
|
39
|
+
export declare const NUMERIC_RANGES: {
|
|
40
|
+
readonly AMOUNT: {
|
|
41
|
+
readonly MIN: 0;
|
|
42
|
+
readonly MAX: 999999999.99;
|
|
43
|
+
};
|
|
44
|
+
readonly PERCENTAGE: {
|
|
45
|
+
readonly MIN: 0;
|
|
46
|
+
readonly MAX: 100;
|
|
47
|
+
};
|
|
48
|
+
readonly QUANTITY: {
|
|
49
|
+
readonly MIN: 0;
|
|
50
|
+
readonly MAX: 999999999.999999;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Format a number with thousand separators
|
|
55
|
+
*/
|
|
56
|
+
export declare const formatWithThousandSeparator: (value: number) => string;
|
|
57
|
+
/**
|
|
58
|
+
* Abbreviation suffixes for large numbers
|
|
59
|
+
*/
|
|
60
|
+
export declare const NUMBER_ABBREVIATIONS: {
|
|
61
|
+
readonly THOUSAND: "K";
|
|
62
|
+
readonly MILLION: "M";
|
|
63
|
+
readonly BILLION: "B";
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=thresholds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thresholds.d.ts","sourceRoot":"","sources":["../../src/config/thresholds.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCpB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;CAajB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,2BAA2B,GAAI,OAAO,MAAM,KAAG,MAW3D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;CAIvB,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified threshold and limit constants
|
|
3
|
+
* Consolidates numeric thresholds, limits, and common values
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Common numeric thresholds used across the application
|
|
7
|
+
*/
|
|
8
|
+
export const COMMON_THRESHOLDS = {
|
|
9
|
+
// Base units
|
|
10
|
+
THOUSAND: 1000,
|
|
11
|
+
MILLION: 1000000,
|
|
12
|
+
BILLION: 1000000000,
|
|
13
|
+
// Decimal places
|
|
14
|
+
DEFAULT_DECIMALS: 2,
|
|
15
|
+
CURRENCY_DECIMALS: 2,
|
|
16
|
+
PERCENTAGE_DECIMALS: 2,
|
|
17
|
+
QUANTITY_DECIMALS: 6,
|
|
18
|
+
PRICE_DECIMALS: 4,
|
|
19
|
+
// String lengths
|
|
20
|
+
MAX_NAME_LENGTH: 100,
|
|
21
|
+
MAX_DESCRIPTION_LENGTH: 500,
|
|
22
|
+
MAX_NOTES_LENGTH: 1000,
|
|
23
|
+
MIN_PASSWORD_LENGTH: 8,
|
|
24
|
+
// File limits
|
|
25
|
+
MAX_FILE_SIZE_MB: 10,
|
|
26
|
+
MAX_FILE_NAME_LENGTH: 255,
|
|
27
|
+
// Business limits
|
|
28
|
+
MIN_PORTFOLIO_VALUE: 1000,
|
|
29
|
+
MIN_TRADE_AMOUNT: 10,
|
|
30
|
+
MIN_WITHDRAWAL_AMOUNT: 100,
|
|
31
|
+
MAX_PORTFOLIOS_PER_USER: 10,
|
|
32
|
+
MAX_TRADES_PER_DAY: 100,
|
|
33
|
+
// Display thresholds
|
|
34
|
+
MIN_DISPLAY_AMOUNT: 0.01,
|
|
35
|
+
MIN_DISPLAY_PERCENTAGE: 0.01,
|
|
36
|
+
// API/Network
|
|
37
|
+
DEFAULT_TIMEOUT_MS: 30000, // 30 seconds
|
|
38
|
+
DEFAULT_RETRY_ATTEMPTS: 3,
|
|
39
|
+
DEFAULT_RETRY_DELAY_MS: 1000, // 1 second
|
|
40
|
+
MAX_RETRY_DELAY_MS: 10000, // 10 seconds
|
|
41
|
+
REQUEST_DEBOUNCE_MS: 300,
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Numeric ranges for validation
|
|
45
|
+
*/
|
|
46
|
+
export const NUMERIC_RANGES = {
|
|
47
|
+
AMOUNT: {
|
|
48
|
+
MIN: 0,
|
|
49
|
+
MAX: 999999999.99,
|
|
50
|
+
},
|
|
51
|
+
PERCENTAGE: {
|
|
52
|
+
MIN: 0,
|
|
53
|
+
MAX: 100,
|
|
54
|
+
},
|
|
55
|
+
QUANTITY: {
|
|
56
|
+
MIN: 0,
|
|
57
|
+
MAX: 999999999.999999,
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Format a number with thousand separators
|
|
62
|
+
*/
|
|
63
|
+
export const formatWithThousandSeparator = (value) => {
|
|
64
|
+
if (value >= COMMON_THRESHOLDS.BILLION) {
|
|
65
|
+
return `${(value / COMMON_THRESHOLDS.BILLION).toFixed(1)}B`;
|
|
66
|
+
}
|
|
67
|
+
if (value >= COMMON_THRESHOLDS.MILLION) {
|
|
68
|
+
return `${(value / COMMON_THRESHOLDS.MILLION).toFixed(1)}M`;
|
|
69
|
+
}
|
|
70
|
+
if (value >= COMMON_THRESHOLDS.THOUSAND) {
|
|
71
|
+
return `${(value / COMMON_THRESHOLDS.THOUSAND).toFixed(1)}K`;
|
|
72
|
+
}
|
|
73
|
+
return value.toString();
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Abbreviation suffixes for large numbers
|
|
77
|
+
*/
|
|
78
|
+
export const NUMBER_ABBREVIATIONS = {
|
|
79
|
+
THOUSAND: 'K',
|
|
80
|
+
MILLION: 'M',
|
|
81
|
+
BILLION: 'B',
|
|
82
|
+
};
|
|
@@ -29,7 +29,7 @@ export declare const FORMATTING_OPTIONS: {
|
|
|
29
29
|
readonly PERCENTAGE: {
|
|
30
30
|
readonly style: "percent";
|
|
31
31
|
readonly minimumFractionDigits: 0;
|
|
32
|
-
readonly maximumFractionDigits:
|
|
32
|
+
readonly maximumFractionDigits: 2;
|
|
33
33
|
};
|
|
34
34
|
readonly DECIMAL: {
|
|
35
35
|
readonly style: "decimal";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../src/financial/formatting.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../src/financial/formatting.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,eAAO,MAAM,cAAc;;;;;;;;;;;;;CAkBjB,CAAC;AAIX,eAAO,MAAM,eAAe;;;;CAIlB,CAAC;AAIX,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;CAIrB,CAAC;AAGX,eAAO,MAAM,kBAAkB;;;;;;CASrB,CAAC;AAIX,eAAO,MAAM,qBAAqB;;;;CAAuB,CAAC"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Financial formatting constants
|
|
3
3
|
*/
|
|
4
|
+
import { COMMON_THRESHOLDS, LOCALE_CONFIG, DEFAULT_FORMAT_OPTIONS, NUMBER_ABBREVIATIONS } from '../config';
|
|
4
5
|
// Number formatting
|
|
5
6
|
export const NUMBER_FORMATS = {
|
|
6
7
|
// Decimal places
|
|
7
|
-
CURRENCY_DECIMALS:
|
|
8
|
-
PERCENTAGE_DECIMALS:
|
|
9
|
-
QUANTITY_DECIMALS:
|
|
10
|
-
PRICE_DECIMALS:
|
|
8
|
+
CURRENCY_DECIMALS: COMMON_THRESHOLDS.CURRENCY_DECIMALS,
|
|
9
|
+
PERCENTAGE_DECIMALS: COMMON_THRESHOLDS.PERCENTAGE_DECIMALS,
|
|
10
|
+
QUANTITY_DECIMALS: COMMON_THRESHOLDS.QUANTITY_DECIMALS,
|
|
11
|
+
PRICE_DECIMALS: COMMON_THRESHOLDS.PRICE_DECIMALS,
|
|
11
12
|
// Minimum decimal places
|
|
12
13
|
MIN_CURRENCY_DECIMALS: 2,
|
|
13
14
|
MIN_PERCENTAGE_DECIMALS: 0,
|
|
@@ -20,42 +21,29 @@ export const NUMBER_FORMATS = {
|
|
|
20
21
|
MAX_PRICE_DECIMALS: 6,
|
|
21
22
|
};
|
|
22
23
|
// Locale settings
|
|
24
|
+
// Now references consolidated locale config
|
|
23
25
|
export const LOCALE_SETTINGS = {
|
|
24
|
-
DEFAULT:
|
|
25
|
-
FALLBACK:
|
|
26
|
-
SUPPORTED:
|
|
26
|
+
DEFAULT: LOCALE_CONFIG.DEFAULT,
|
|
27
|
+
FALLBACK: LOCALE_CONFIG.FALLBACK,
|
|
28
|
+
SUPPORTED: LOCALE_CONFIG.SUPPORTED,
|
|
27
29
|
};
|
|
28
30
|
// Formatting options
|
|
31
|
+
// Partially references consolidated options
|
|
29
32
|
export const FORMATTING_OPTIONS = {
|
|
30
|
-
CURRENCY:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
maximumFractionDigits: NUMBER_FORMATS.MAX_CURRENCY_DECIMALS,
|
|
34
|
-
},
|
|
35
|
-
PERCENTAGE: {
|
|
36
|
-
style: 'percent',
|
|
37
|
-
minimumFractionDigits: NUMBER_FORMATS.MIN_PERCENTAGE_DECIMALS,
|
|
38
|
-
maximumFractionDigits: NUMBER_FORMATS.MAX_PERCENTAGE_DECIMALS,
|
|
39
|
-
},
|
|
40
|
-
DECIMAL: {
|
|
41
|
-
style: 'decimal',
|
|
42
|
-
minimumFractionDigits: 0,
|
|
43
|
-
maximumFractionDigits: 8,
|
|
44
|
-
},
|
|
33
|
+
CURRENCY: DEFAULT_FORMAT_OPTIONS.CURRENCY,
|
|
34
|
+
PERCENTAGE: DEFAULT_FORMAT_OPTIONS.PERCENTAGE,
|
|
35
|
+
DECIMAL: DEFAULT_FORMAT_OPTIONS.DECIMAL,
|
|
45
36
|
};
|
|
46
37
|
// Display thresholds
|
|
47
38
|
export const DISPLAY_THRESHOLDS = {
|
|
48
39
|
// Values below these thresholds show as "< threshold"
|
|
49
|
-
MIN_DISPLAY_AMOUNT:
|
|
50
|
-
MIN_DISPLAY_PERCENTAGE:
|
|
40
|
+
MIN_DISPLAY_AMOUNT: COMMON_THRESHOLDS.MIN_DISPLAY_AMOUNT,
|
|
41
|
+
MIN_DISPLAY_PERCENTAGE: COMMON_THRESHOLDS.MIN_DISPLAY_PERCENTAGE,
|
|
51
42
|
// Large number abbreviations
|
|
52
|
-
THOUSAND:
|
|
53
|
-
MILLION:
|
|
54
|
-
BILLION:
|
|
43
|
+
THOUSAND: COMMON_THRESHOLDS.THOUSAND,
|
|
44
|
+
MILLION: COMMON_THRESHOLDS.MILLION,
|
|
45
|
+
BILLION: COMMON_THRESHOLDS.BILLION,
|
|
55
46
|
};
|
|
56
47
|
// Abbreviation suffixes
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
MILLION: 'M',
|
|
60
|
-
BILLION: 'B',
|
|
61
|
-
};
|
|
48
|
+
// @deprecated Use NUMBER_ABBREVIATIONS from config/thresholds instead
|
|
49
|
+
export const ABBREVIATION_SUFFIXES = NUMBER_ABBREVIATIONS;
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,OAAO,CAAC;AAGtB,cAAc,YAAY,CAAC;AAG3B,cAAc,aAAa,CAAC;AAG5B,cAAc,MAAM,CAAC;AAGrB,cAAc,aAAa,CAAC;AAG5B,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,OAAO,CAAC;AAGtB,cAAc,YAAY,CAAC;AAG3B,cAAc,aAAa,CAAC;AAG5B,cAAc,MAAM,CAAC;AAGrB,cAAc,aAAa,CAAC;AAG5B,cAAc,UAAU,CAAC;AAGzB,cAAc,UAAU,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -2,28 +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_MILLION
|
|
9
|
-
export declare const QUANTITY_FORMAT_THRESHOLD_THOUSAND
|
|
5
|
+
export declare const DECIMAL_PLACES: 2;
|
|
6
|
+
export declare const DEFAULT_NUMERIC_ZERO: 0;
|
|
7
|
+
export declare const DEFAULT_EMPTY_STRING: "";
|
|
8
|
+
export declare const QUANTITY_FORMAT_THRESHOLD_MILLION: 1000000;
|
|
9
|
+
export declare const QUANTITY_FORMAT_THRESHOLD_THOUSAND: 1000;
|
|
10
10
|
export declare const ERROR_TYPE_BUSINESS_LOGIC = "business_logic";
|
|
11
11
|
export declare const ERROR_TYPE_PERMISSION = "permission";
|
|
12
12
|
export declare const ERROR_TYPE_SERVER = "server";
|
|
13
|
-
export declare const LOCALE_AUSTRALIA
|
|
13
|
+
export declare const LOCALE_AUSTRALIA: "en-AU";
|
|
14
14
|
export declare const NUMBER_FORMAT_OPTIONS_CURRENCY: {
|
|
15
15
|
readonly style: "currency";
|
|
16
16
|
readonly minimumFractionDigits: 2;
|
|
17
17
|
readonly maximumFractionDigits: 2;
|
|
18
18
|
};
|
|
19
19
|
export declare const NUMBER_FORMAT_OPTIONS_CURRENCY_SIGNED: {
|
|
20
|
-
readonly signDisplay: "always";
|
|
21
20
|
readonly style: "currency";
|
|
22
21
|
readonly minimumFractionDigits: 2;
|
|
23
22
|
readonly maximumFractionDigits: 2;
|
|
23
|
+
readonly signDisplay: "always";
|
|
24
24
|
};
|
|
25
25
|
export declare const QUERY_PARAM_ORDER_BY = "order_by";
|
|
26
26
|
export declare const ORDER_BY_CREATED_AT = "created_at";
|
|
27
|
-
export declare const DEFAULT_UNKNOWN_VALUE
|
|
28
|
-
export declare const DEFAULT_ERROR_MESSAGE
|
|
27
|
+
export declare const DEFAULT_UNKNOWN_VALUE: "Unknown";
|
|
28
|
+
export declare const DEFAULT_ERROR_MESSAGE: "An error occurred";
|
|
29
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,33 +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 QUANTITY_FORMAT_THRESHOLD_MILLION =
|
|
12
|
-
export const QUANTITY_FORMAT_THRESHOLD_THOUSAND =
|
|
12
|
+
export const QUANTITY_FORMAT_THRESHOLD_MILLION = COMMON_THRESHOLDS.MILLION;
|
|
13
|
+
export const QUANTITY_FORMAT_THRESHOLD_THOUSAND = COMMON_THRESHOLDS.THOUSAND;
|
|
13
14
|
// Error types
|
|
14
15
|
export const ERROR_TYPE_BUSINESS_LOGIC = 'business_logic';
|
|
15
16
|
export const ERROR_TYPE_PERMISSION = 'permission';
|
|
16
17
|
export const ERROR_TYPE_SERVER = 'server';
|
|
17
18
|
// Locale and formatting constants
|
|
18
|
-
export const LOCALE_AUSTRALIA =
|
|
19
|
+
export const LOCALE_AUSTRALIA = LOCALE_CONFIG.DEFAULT;
|
|
19
20
|
// Number formatting options
|
|
20
|
-
export const NUMBER_FORMAT_OPTIONS_CURRENCY =
|
|
21
|
-
|
|
22
|
-
minimumFractionDigits: DECIMAL_PLACES,
|
|
23
|
-
maximumFractionDigits: DECIMAL_PLACES,
|
|
24
|
-
};
|
|
25
|
-
export const NUMBER_FORMAT_OPTIONS_CURRENCY_SIGNED = {
|
|
26
|
-
...NUMBER_FORMAT_OPTIONS_CURRENCY,
|
|
27
|
-
signDisplay: 'always',
|
|
28
|
-
};
|
|
21
|
+
export const NUMBER_FORMAT_OPTIONS_CURRENCY = DEFAULT_FORMAT_OPTIONS.CURRENCY;
|
|
22
|
+
export const NUMBER_FORMAT_OPTIONS_CURRENCY_SIGNED = DEFAULT_FORMAT_OPTIONS.CURRENCY_SIGNED;
|
|
29
23
|
// Query parameter constants
|
|
30
24
|
export const QUERY_PARAM_ORDER_BY = 'order_by';
|
|
31
25
|
export const ORDER_BY_CREATED_AT = 'created_at';
|
|
32
26
|
// Default strings for auth
|
|
33
|
-
export const DEFAULT_UNKNOWN_VALUE =
|
|
34
|
-
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
|