@cranberry-money/shared-constants 8.8.0 → 8.9.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.
Files changed (160) hide show
  1. package/package.json +1 -1
  2. package/dist/api/auth.d.ts +0 -21
  3. package/dist/api/auth.d.ts.map +0 -1
  4. package/dist/api/auth.js +0 -23
  5. package/dist/api/config.d.ts +0 -36
  6. package/dist/api/config.d.ts.map +0 -1
  7. package/dist/api/config.js +0 -44
  8. package/dist/api/endpoints.d.ts +0 -157
  9. package/dist/api/endpoints.d.ts.map +0 -1
  10. package/dist/api/endpoints.js +0 -184
  11. package/dist/api/http.d.ts +0 -57
  12. package/dist/api/http.d.ts.map +0 -1
  13. package/dist/api/http.js +0 -62
  14. package/dist/api/index.d.ts +0 -9
  15. package/dist/api/index.d.ts.map +0 -1
  16. package/dist/api/index.js +0 -8
  17. package/dist/api/services.d.ts +0 -9
  18. package/dist/api/services.d.ts.map +0 -1
  19. package/dist/api/services.js +0 -8
  20. package/dist/business/accounts.d.ts +0 -38
  21. package/dist/business/accounts.d.ts.map +0 -1
  22. package/dist/business/accounts.js +0 -53
  23. package/dist/business/bank-accounts.d.ts +0 -71
  24. package/dist/business/bank-accounts.d.ts.map +0 -1
  25. package/dist/business/bank-accounts.js +0 -69
  26. package/dist/business/banking.d.ts +0 -44
  27. package/dist/business/banking.d.ts.map +0 -1
  28. package/dist/business/banking.js +0 -69
  29. package/dist/business/cache.d.ts +0 -9
  30. package/dist/business/cache.d.ts.map +0 -1
  31. package/dist/business/cache.js +0 -8
  32. package/dist/business/countries.d.ts +0 -11
  33. package/dist/business/countries.d.ts.map +0 -1
  34. package/dist/business/countries.js +0 -11
  35. package/dist/business/documents.d.ts +0 -48
  36. package/dist/business/documents.d.ts.map +0 -1
  37. package/dist/business/documents.js +0 -75
  38. package/dist/business/holdings.d.ts +0 -34
  39. package/dist/business/holdings.d.ts.map +0 -1
  40. package/dist/business/holdings.js +0 -34
  41. package/dist/business/index.d.ts +0 -16
  42. package/dist/business/index.d.ts.map +0 -1
  43. package/dist/business/index.js +0 -27
  44. package/dist/business/industries.d.ts +0 -9
  45. package/dist/business/industries.d.ts.map +0 -1
  46. package/dist/business/industries.js +0 -9
  47. package/dist/business/investments.d.ts +0 -87
  48. package/dist/business/investments.d.ts.map +0 -1
  49. package/dist/business/investments.js +0 -93
  50. package/dist/business/status/banks.d.ts +0 -29
  51. package/dist/business/status/banks.d.ts.map +0 -1
  52. package/dist/business/status/banks.js +0 -35
  53. package/dist/business/status/cash-accounts.d.ts +0 -56
  54. package/dist/business/status/cash-accounts.d.ts.map +0 -1
  55. package/dist/business/status/cash-accounts.js +0 -62
  56. package/dist/business/status/documents.d.ts +0 -25
  57. package/dist/business/status/documents.d.ts.map +0 -1
  58. package/dist/business/status/documents.js +0 -34
  59. package/dist/business/status/index.d.ts +0 -11
  60. package/dist/business/status/index.d.ts.map +0 -1
  61. package/dist/business/status/index.js +0 -10
  62. package/dist/business/status/instruments.d.ts +0 -42
  63. package/dist/business/status/instruments.d.ts.map +0 -1
  64. package/dist/business/status/instruments.js +0 -55
  65. package/dist/business/status/portfolios.d.ts +0 -18
  66. package/dist/business/status/portfolios.d.ts.map +0 -1
  67. package/dist/business/status/portfolios.js +0 -21
  68. package/dist/business/status/trades.d.ts +0 -89
  69. package/dist/business/status/trades.d.ts.map +0 -1
  70. package/dist/business/status/trades.js +0 -130
  71. package/dist/business/status/withdrawals.d.ts +0 -104
  72. package/dist/business/status/withdrawals.d.ts.map +0 -1
  73. package/dist/business/status/withdrawals.js +0 -153
  74. package/dist/business/trading.d.ts +0 -52
  75. package/dist/business/trading.d.ts.map +0 -1
  76. package/dist/business/trading.js +0 -68
  77. package/dist/common/index.d.ts +0 -2
  78. package/dist/common/index.d.ts.map +0 -1
  79. package/dist/common/index.js +0 -1
  80. package/dist/common/statuses.d.ts +0 -18
  81. package/dist/common/statuses.d.ts.map +0 -1
  82. package/dist/common/statuses.js +0 -17
  83. package/dist/config/defaults.d.ts +0 -68
  84. package/dist/config/defaults.d.ts.map +0 -1
  85. package/dist/config/defaults.js +0 -66
  86. package/dist/config/index.d.ts +0 -8
  87. package/dist/config/index.d.ts.map +0 -1
  88. package/dist/config/index.js +0 -7
  89. package/dist/config/pagination.d.ts +0 -28
  90. package/dist/config/pagination.d.ts.map +0 -1
  91. package/dist/config/pagination.js +0 -40
  92. package/dist/config/thresholds.d.ts +0 -65
  93. package/dist/config/thresholds.d.ts.map +0 -1
  94. package/dist/config/thresholds.js +0 -82
  95. package/dist/financial/currency.d.ts +0 -38
  96. package/dist/financial/currency.d.ts.map +0 -1
  97. package/dist/financial/currency.js +0 -75
  98. package/dist/financial/formatting.d.ts +0 -52
  99. package/dist/financial/formatting.d.ts.map +0 -1
  100. package/dist/financial/formatting.js +0 -49
  101. package/dist/financial/index.d.ts +0 -7
  102. package/dist/financial/index.d.ts.map +0 -1
  103. package/dist/financial/index.js +0 -6
  104. package/dist/financial/instruments.d.ts +0 -51
  105. package/dist/financial/instruments.d.ts.map +0 -1
  106. package/dist/financial/instruments.js +0 -68
  107. package/dist/index.d.ts +0 -15
  108. package/dist/index.d.ts.map +0 -1
  109. package/dist/index.js +0 -22
  110. package/dist/ui/cache.d.ts +0 -47
  111. package/dist/ui/cache.d.ts.map +0 -1
  112. package/dist/ui/cache.js +0 -45
  113. package/dist/ui/chart-config.d.ts +0 -35
  114. package/dist/ui/chart-config.d.ts.map +0 -1
  115. package/dist/ui/chart-config.js +0 -33
  116. package/dist/ui/colors.d.ts +0 -53
  117. package/dist/ui/colors.d.ts.map +0 -1
  118. package/dist/ui/colors.js +0 -94
  119. package/dist/ui/display.d.ts +0 -69
  120. package/dist/ui/display.d.ts.map +0 -1
  121. package/dist/ui/display.js +0 -80
  122. package/dist/ui/index.d.ts +0 -13
  123. package/dist/ui/index.d.ts.map +0 -1
  124. package/dist/ui/index.js +0 -12
  125. package/dist/ui/labels/index.d.ts +0 -20
  126. package/dist/ui/labels/index.d.ts.map +0 -1
  127. package/dist/ui/labels/index.js +0 -23
  128. package/dist/ui/navigation.d.ts +0 -45
  129. package/dist/ui/navigation.d.ts.map +0 -1
  130. package/dist/ui/navigation.js +0 -47
  131. package/dist/ui/status-colors-unified.d.ts +0 -91
  132. package/dist/ui/status-colors-unified.d.ts.map +0 -1
  133. package/dist/ui/status-colors-unified.js +0 -106
  134. package/dist/ui/timing.d.ts +0 -26
  135. package/dist/ui/timing.d.ts.map +0 -1
  136. package/dist/ui/timing.js +0 -24
  137. package/dist/ui/zIndex.d.ts +0 -80
  138. package/dist/ui/zIndex.d.ts.map +0 -1
  139. package/dist/ui/zIndex.js +0 -77
  140. package/dist/utilities/common.d.ts +0 -29
  141. package/dist/utilities/common.d.ts.map +0 -1
  142. package/dist/utilities/common.js +0 -28
  143. package/dist/utilities/defaults.d.ts +0 -52
  144. package/dist/utilities/defaults.d.ts.map +0 -1
  145. package/dist/utilities/defaults.js +0 -68
  146. package/dist/utilities/index.d.ts +0 -9
  147. package/dist/utilities/index.d.ts.map +0 -1
  148. package/dist/utilities/index.js +0 -8
  149. package/dist/utilities/sorting.d.ts +0 -45
  150. package/dist/utilities/sorting.d.ts.map +0 -1
  151. package/dist/utilities/sorting.js +0 -51
  152. package/dist/utilities/time.d.ts +0 -53
  153. package/dist/utilities/time.d.ts.map +0 -1
  154. package/dist/utilities/time.js +0 -65
  155. package/dist/utilities/validation.d.ts +0 -57
  156. package/dist/utilities/validation.d.ts.map +0 -1
  157. package/dist/utilities/validation.js +0 -65
  158. package/dist/validation/index.d.ts +0 -27
  159. package/dist/validation/index.d.ts.map +0 -1
  160. package/dist/validation/index.js +0 -26
@@ -1,2 +0,0 @@
1
- export * from './statuses';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
@@ -1 +0,0 @@
1
- export * from './statuses';
@@ -1,18 +0,0 @@
1
- /**
2
- * Common status constants shared across multiple domains
3
- * These values appear frequently across withdrawals, trades, cash accounts, etc.
4
- */
5
- export declare const COMMON_STATUS: {
6
- readonly PENDING: "PENDING";
7
- readonly APPROVED: "APPROVED";
8
- readonly CANCELLED: "CANCELLED";
9
- readonly FAILED: "FAILED";
10
- readonly COMPLETED: "COMPLETED";
11
- readonly PROCESSING: "PROCESSING";
12
- readonly ACTIVE: "ACTIVE";
13
- readonly INACTIVE: "INACTIVE";
14
- readonly EXECUTED: "EXECUTED";
15
- };
16
- export type CommonStatusValues = (typeof COMMON_STATUS)[keyof typeof COMMON_STATUS];
17
- export declare const PENDING: "PENDING", APPROVED: "APPROVED", CANCELLED: "CANCELLED", FAILED: "FAILED", COMPLETED: "COMPLETED", PROCESSING: "PROCESSING", ACTIVE: "ACTIVE", INACTIVE: "INACTIVE", EXECUTED: "EXECUTED";
18
- //# sourceMappingURL=statuses.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"statuses.d.ts","sourceRoot":"","sources":["../../src/common/statuses.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;CAUhB,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAGpF,eAAO,MAAQ,OAAO,aAAE,QAAQ,cAAE,SAAS,eAAE,MAAM,YAAE,SAAS,eAAE,UAAU,gBAAE,MAAM,YAAE,QAAQ,cAAE,QAAQ,YACvF,CAAC"}
@@ -1,17 +0,0 @@
1
- /**
2
- * Common status constants shared across multiple domains
3
- * These values appear frequently across withdrawals, trades, cash accounts, etc.
4
- */
5
- export const COMMON_STATUS = {
6
- PENDING: 'PENDING',
7
- APPROVED: 'APPROVED',
8
- CANCELLED: 'CANCELLED',
9
- FAILED: 'FAILED',
10
- COMPLETED: 'COMPLETED',
11
- PROCESSING: 'PROCESSING',
12
- ACTIVE: 'ACTIVE',
13
- INACTIVE: 'INACTIVE',
14
- EXECUTED: 'EXECUTED',
15
- };
16
- // Re-export individual values for convenience
17
- export const { PENDING, APPROVED, CANCELLED, FAILED, COMPLETED, PROCESSING, ACTIVE, INACTIVE, EXECUTED } = COMMON_STATUS;
@@ -1,68 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,66 +0,0 @@
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
- };
@@ -1,8 +0,0 @@
1
- /**
2
- * Configuration constants module
3
- * Exports all configuration-related constants
4
- */
5
- export * from './pagination';
6
- export * from './thresholds';
7
- export * from './defaults';
8
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
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"}
@@ -1,7 +0,0 @@
1
- /**
2
- * Configuration constants module
3
- * Exports all configuration-related constants
4
- */
5
- export * from './pagination';
6
- export * from './thresholds';
7
- export * from './defaults';
@@ -1,28 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,40 +0,0 @@
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
- };
@@ -1,65 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,82 +0,0 @@
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
- };
@@ -1,38 +0,0 @@
1
- /**
2
- * Currency-related constants
3
- */
4
- export declare const CURRENCY_CODES: {
5
- readonly AUD: "AUD";
6
- readonly USD: "USD";
7
- readonly EUR: "EUR";
8
- readonly GBP: "GBP";
9
- readonly JPY: "JPY";
10
- readonly CAD: "CAD";
11
- readonly CHF: "CHF";
12
- readonly NZD: "NZD";
13
- readonly SGD: "SGD";
14
- readonly HKD: "HKD";
15
- };
16
- export type CurrencyCode = (typeof CURRENCY_CODES)[keyof typeof CURRENCY_CODES];
17
- export declare const CURRENCY_SYMBOLS: Record<CurrencyCode, string>;
18
- export declare const CURRENCY_NAMES: Record<CurrencyCode, string>;
19
- export declare const CURRENCY_DECIMALS: Record<CurrencyCode, number>;
20
- /**
21
- * Default currency for the platform
22
- * @intentional-duplicate AUD value appears in multiple places
23
- * @reason Different semantic purposes - DEFAULT_CURRENCY sets platform default,
24
- * CURRENCY_AUD defines the currency code constant
25
- * @see INTENTIONAL-DUPLICATES.md
26
- */
27
- export declare const DEFAULT_CURRENCY: "AUD";
28
- export declare const CURRENCY_OPTIONS: {
29
- value: string;
30
- label: string;
31
- }[];
32
- export declare const CURRENCY_AUD: "AUD";
33
- export declare const CURRENCY_USD: "USD";
34
- export declare const CURRENCY_EUR: "EUR";
35
- export declare const CURRENCY_GBP: "GBP";
36
- export declare const CURRENCY_LABEL_AUD: string;
37
- export declare const CURRENCY_LABEL_USD: string;
38
- //# sourceMappingURL=currency.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"currency.d.ts","sourceRoot":"","sources":["../../src/financial/currency.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,eAAO,MAAM,cAAc;;;;;;;;;;;CAWjB,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;AAGhF,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAWhD,CAAC;AAGX,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAW9C,CAAC;AAGX,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAWjD,CAAC;AAEX;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,OAAqB,CAAC;AAGnD,eAAO,MAAM,gBAAgB;;;GAG1B,CAAC;AAGJ,eAAO,MAAM,YAAY,OAAqB,CAAC;AAC/C,eAAO,MAAM,YAAY,OAAqB,CAAC;AAC/C,eAAO,MAAM,YAAY,OAAqB,CAAC;AAC/C,eAAO,MAAM,YAAY,OAAqB,CAAC;AAC/C,eAAO,MAAM,kBAAkB,QAAqC,CAAC;AACrE,eAAO,MAAM,kBAAkB,QAAqC,CAAC"}
@@ -1,75 +0,0 @@
1
- /**
2
- * Currency-related constants
3
- */
4
- // Currency codes (ISO 4217)
5
- export const CURRENCY_CODES = {
6
- AUD: 'AUD',
7
- USD: 'USD',
8
- EUR: 'EUR',
9
- GBP: 'GBP',
10
- JPY: 'JPY',
11
- CAD: 'CAD',
12
- CHF: 'CHF',
13
- NZD: 'NZD',
14
- SGD: 'SGD',
15
- HKD: 'HKD',
16
- };
17
- // Currency symbols
18
- export const CURRENCY_SYMBOLS = {
19
- [CURRENCY_CODES.AUD]: '$',
20
- [CURRENCY_CODES.USD]: '$',
21
- [CURRENCY_CODES.EUR]: '€',
22
- [CURRENCY_CODES.GBP]: '£',
23
- [CURRENCY_CODES.JPY]: '¥',
24
- [CURRENCY_CODES.CAD]: '$',
25
- [CURRENCY_CODES.CHF]: 'CHF',
26
- [CURRENCY_CODES.NZD]: '$',
27
- [CURRENCY_CODES.SGD]: '$',
28
- [CURRENCY_CODES.HKD]: '$',
29
- };
30
- // Currency names
31
- export const CURRENCY_NAMES = {
32
- [CURRENCY_CODES.AUD]: 'Australian Dollar',
33
- [CURRENCY_CODES.USD]: 'US Dollar',
34
- [CURRENCY_CODES.EUR]: 'Euro',
35
- [CURRENCY_CODES.GBP]: 'British Pound',
36
- [CURRENCY_CODES.JPY]: 'Japanese Yen',
37
- [CURRENCY_CODES.CAD]: 'Canadian Dollar',
38
- [CURRENCY_CODES.CHF]: 'Swiss Franc',
39
- [CURRENCY_CODES.NZD]: 'New Zealand Dollar',
40
- [CURRENCY_CODES.SGD]: 'Singapore Dollar',
41
- [CURRENCY_CODES.HKD]: 'Hong Kong Dollar',
42
- };
43
- // Currency decimal places
44
- export const CURRENCY_DECIMALS = {
45
- [CURRENCY_CODES.AUD]: 2,
46
- [CURRENCY_CODES.USD]: 2,
47
- [CURRENCY_CODES.EUR]: 2,
48
- [CURRENCY_CODES.GBP]: 2,
49
- [CURRENCY_CODES.JPY]: 0, // Japanese Yen doesn't use decimal places
50
- [CURRENCY_CODES.CAD]: 2,
51
- [CURRENCY_CODES.CHF]: 2,
52
- [CURRENCY_CODES.NZD]: 2,
53
- [CURRENCY_CODES.SGD]: 2,
54
- [CURRENCY_CODES.HKD]: 2,
55
- };
56
- /**
57
- * Default currency for the platform
58
- * @intentional-duplicate AUD value appears in multiple places
59
- * @reason Different semantic purposes - DEFAULT_CURRENCY sets platform default,
60
- * CURRENCY_AUD defines the currency code constant
61
- * @see INTENTIONAL-DUPLICATES.md
62
- */
63
- export const DEFAULT_CURRENCY = CURRENCY_CODES.AUD;
64
- // Currency options for forms
65
- export const CURRENCY_OPTIONS = Object.entries(CURRENCY_NAMES).map(([code, name]) => ({
66
- value: code,
67
- label: `${code} - ${name}`,
68
- }));
69
- // Blueberry compatibility exports
70
- export const CURRENCY_AUD = CURRENCY_CODES.AUD;
71
- export const CURRENCY_USD = CURRENCY_CODES.USD;
72
- export const CURRENCY_EUR = CURRENCY_CODES.EUR;
73
- export const CURRENCY_GBP = CURRENCY_CODES.GBP;
74
- export const CURRENCY_LABEL_AUD = CURRENCY_NAMES[CURRENCY_CODES.AUD];
75
- export const CURRENCY_LABEL_USD = CURRENCY_NAMES[CURRENCY_CODES.USD];
@@ -1,52 +0,0 @@
1
- /**
2
- * Financial formatting constants
3
- */
4
- export declare const NUMBER_FORMATS: {
5
- readonly CURRENCY_DECIMALS: 2;
6
- readonly PERCENTAGE_DECIMALS: 2;
7
- readonly QUANTITY_DECIMALS: 6;
8
- readonly PRICE_DECIMALS: 4;
9
- readonly MIN_CURRENCY_DECIMALS: 2;
10
- readonly MIN_PERCENTAGE_DECIMALS: 0;
11
- readonly MIN_QUANTITY_DECIMALS: 0;
12
- readonly MIN_PRICE_DECIMALS: 2;
13
- readonly MAX_CURRENCY_DECIMALS: 2;
14
- readonly MAX_PERCENTAGE_DECIMALS: 4;
15
- readonly MAX_QUANTITY_DECIMALS: 8;
16
- readonly MAX_PRICE_DECIMALS: 6;
17
- };
18
- export declare const LOCALE_SETTINGS: {
19
- readonly DEFAULT: "en-AU";
20
- readonly FALLBACK: "en-US";
21
- readonly SUPPORTED: readonly ["en-AU", "en-US", "en-GB"];
22
- };
23
- export declare const FORMATTING_OPTIONS: {
24
- readonly CURRENCY: {
25
- readonly style: "currency";
26
- readonly minimumFractionDigits: 2;
27
- readonly maximumFractionDigits: 2;
28
- };
29
- readonly PERCENTAGE: {
30
- readonly style: "percent";
31
- readonly minimumFractionDigits: 0;
32
- readonly maximumFractionDigits: 2;
33
- };
34
- readonly DECIMAL: {
35
- readonly style: "decimal";
36
- readonly minimumFractionDigits: 0;
37
- readonly maximumFractionDigits: 8;
38
- };
39
- };
40
- export declare const DISPLAY_THRESHOLDS: {
41
- readonly MIN_DISPLAY_AMOUNT: 0.01;
42
- readonly MIN_DISPLAY_PERCENTAGE: 0.01;
43
- readonly THOUSAND: 1000;
44
- readonly MILLION: 1000000;
45
- readonly BILLION: 1000000000;
46
- };
47
- export declare const ABBREVIATION_SUFFIXES: {
48
- readonly THOUSAND: "K";
49
- readonly MILLION: "M";
50
- readonly BILLION: "B";
51
- };
52
- //# sourceMappingURL=formatting.d.ts.map
@@ -1 +0,0 @@
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,49 +0,0 @@
1
- /**
2
- * Financial formatting constants
3
- */
4
- import { COMMON_THRESHOLDS, LOCALE_CONFIG, DEFAULT_FORMAT_OPTIONS, NUMBER_ABBREVIATIONS } from '../config';
5
- // Number formatting
6
- export const NUMBER_FORMATS = {
7
- // Decimal places
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,
12
- // Minimum decimal places
13
- MIN_CURRENCY_DECIMALS: 2,
14
- MIN_PERCENTAGE_DECIMALS: 0,
15
- MIN_QUANTITY_DECIMALS: 0,
16
- MIN_PRICE_DECIMALS: 2,
17
- // Maximum decimal places
18
- MAX_CURRENCY_DECIMALS: 2,
19
- MAX_PERCENTAGE_DECIMALS: 4,
20
- MAX_QUANTITY_DECIMALS: 8,
21
- MAX_PRICE_DECIMALS: 6,
22
- };
23
- // Locale settings
24
- // Now references consolidated locale config
25
- export const LOCALE_SETTINGS = {
26
- DEFAULT: LOCALE_CONFIG.DEFAULT,
27
- FALLBACK: LOCALE_CONFIG.FALLBACK,
28
- SUPPORTED: LOCALE_CONFIG.SUPPORTED,
29
- };
30
- // Formatting options
31
- // Partially references consolidated options
32
- export const FORMATTING_OPTIONS = {
33
- CURRENCY: DEFAULT_FORMAT_OPTIONS.CURRENCY,
34
- PERCENTAGE: DEFAULT_FORMAT_OPTIONS.PERCENTAGE,
35
- DECIMAL: DEFAULT_FORMAT_OPTIONS.DECIMAL,
36
- };
37
- // Display thresholds
38
- export const DISPLAY_THRESHOLDS = {
39
- // Values below these thresholds show as "< threshold"
40
- MIN_DISPLAY_AMOUNT: COMMON_THRESHOLDS.MIN_DISPLAY_AMOUNT,
41
- MIN_DISPLAY_PERCENTAGE: COMMON_THRESHOLDS.MIN_DISPLAY_PERCENTAGE,
42
- // Large number abbreviations
43
- THOUSAND: COMMON_THRESHOLDS.THOUSAND,
44
- MILLION: COMMON_THRESHOLDS.MILLION,
45
- BILLION: COMMON_THRESHOLDS.BILLION,
46
- };
47
- // Abbreviation suffixes
48
- // @deprecated Use NUMBER_ABBREVIATIONS from config/thresholds instead
49
- export const ABBREVIATION_SUFFIXES = NUMBER_ABBREVIATIONS;
@@ -1,7 +0,0 @@
1
- /**
2
- * Financial constants
3
- */
4
- export * from './currency';
5
- export * from './instruments';
6
- export * from './formatting';
7
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/financial/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC"}