@cranberry-money/shared-constants 5.0.0 → 5.1.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 (98) hide show
  1. package/dist/api/auth.d.ts +28 -12
  2. package/dist/api/auth.d.ts.map +1 -1
  3. package/dist/api/auth.js +39 -18
  4. package/dist/api/config.d.ts.map +1 -1
  5. package/dist/api/config.js +15 -15
  6. package/dist/api/endpoints.js +31 -28
  7. package/dist/api/http.js +9 -6
  8. package/dist/api/index.js +20 -4
  9. package/dist/business/accounts.d.ts +1 -1
  10. package/dist/business/accounts.d.ts.map +1 -1
  11. package/dist/business/accounts.js +37 -35
  12. package/dist/business/bank-accounts.d.ts +17 -10
  13. package/dist/business/bank-accounts.d.ts.map +1 -1
  14. package/dist/business/bank-accounts.js +63 -51
  15. package/dist/business/banking.js +29 -26
  16. package/dist/business/countries.js +6 -3
  17. package/dist/business/documents.d.ts +12 -6
  18. package/dist/business/documents.d.ts.map +1 -1
  19. package/dist/business/documents.js +46 -43
  20. package/dist/business/index.d.ts +0 -1
  21. package/dist/business/index.d.ts.map +1 -1
  22. package/dist/business/index.js +74 -14
  23. package/dist/business/industries.js +5 -2
  24. package/dist/business/investments.js +56 -53
  25. package/dist/business/status/banks.d.ts +0 -6
  26. package/dist/business/status/banks.d.ts.map +1 -1
  27. package/dist/business/status/banks.js +14 -17
  28. package/dist/business/status/cash-accounts.d.ts.map +1 -1
  29. package/dist/business/status/cash-accounts.js +39 -37
  30. package/dist/business/status/documents.d.ts +4 -4
  31. package/dist/business/status/documents.d.ts.map +1 -1
  32. package/dist/business/status/documents.js +28 -24
  33. package/dist/business/status/index.js +23 -7
  34. package/dist/business/status/instruments.js +24 -21
  35. package/dist/business/status/portfolios.d.ts +0 -6
  36. package/dist/business/status/portfolios.d.ts.map +1 -1
  37. package/dist/business/status/portfolios.js +8 -11
  38. package/dist/business/status/trades.d.ts +12 -15
  39. package/dist/business/status/trades.d.ts.map +1 -1
  40. package/dist/business/status/trades.js +89 -90
  41. package/dist/business/status/withdrawals.d.ts +19 -18
  42. package/dist/business/status/withdrawals.d.ts.map +1 -1
  43. package/dist/business/status/withdrawals.js +102 -111
  44. package/dist/business/trading.js +26 -23
  45. package/dist/financial/currency.d.ts +0 -16
  46. package/dist/financial/currency.d.ts.map +1 -1
  47. package/dist/financial/currency.js +46 -58
  48. package/dist/financial/formatting.d.ts +1 -1
  49. package/dist/financial/formatting.d.ts.map +1 -1
  50. package/dist/financial/formatting.js +39 -24
  51. package/dist/financial/index.js +19 -3
  52. package/dist/financial/instruments.js +28 -25
  53. package/dist/index.d.ts +0 -2
  54. package/dist/index.d.ts.map +1 -1
  55. package/dist/index.js +21 -9
  56. package/dist/ui/colors.d.ts +10 -10
  57. package/dist/ui/colors.d.ts.map +1 -1
  58. package/dist/ui/colors.js +41 -40
  59. package/dist/ui/display.js +23 -20
  60. package/dist/ui/index.d.ts +0 -1
  61. package/dist/ui/index.d.ts.map +1 -1
  62. package/dist/ui/index.js +19 -4
  63. package/dist/ui/labels/index.js +49 -15
  64. package/dist/utilities/common.d.ts +20 -10
  65. package/dist/utilities/common.d.ts.map +1 -1
  66. package/dist/utilities/common.js +36 -16
  67. package/dist/utilities/defaults.d.ts.map +1 -1
  68. package/dist/utilities/defaults.js +37 -41
  69. package/dist/utilities/index.js +21 -5
  70. package/dist/utilities/sorting.js +16 -13
  71. package/dist/utilities/time.js +12 -9
  72. package/dist/utilities/validation.d.ts.map +1 -1
  73. package/dist/utilities/validation.js +8 -6
  74. package/package.json +1 -1
  75. package/dist/business/holdings.d.ts +0 -34
  76. package/dist/business/holdings.d.ts.map +0 -1
  77. package/dist/business/holdings.js +0 -34
  78. package/dist/common/index.d.ts +0 -2
  79. package/dist/common/index.d.ts.map +0 -1
  80. package/dist/common/index.js +0 -1
  81. package/dist/common/statuses.d.ts +0 -20
  82. package/dist/common/statuses.d.ts.map +0 -1
  83. package/dist/common/statuses.js +0 -19
  84. package/dist/config/defaults.d.ts +0 -79
  85. package/dist/config/defaults.d.ts.map +0 -1
  86. package/dist/config/defaults.js +0 -77
  87. package/dist/config/index.d.ts +0 -8
  88. package/dist/config/index.d.ts.map +0 -1
  89. package/dist/config/index.js +0 -7
  90. package/dist/config/pagination.d.ts +0 -28
  91. package/dist/config/pagination.d.ts.map +0 -1
  92. package/dist/config/pagination.js +0 -40
  93. package/dist/config/thresholds.d.ts +0 -65
  94. package/dist/config/thresholds.d.ts.map +0 -1
  95. package/dist/config/thresholds.js +0 -82
  96. package/dist/ui/status-colors-unified.d.ts +0 -91
  97. package/dist/ui/status-colors-unified.d.ts.map +0 -1
  98. package/dist/ui/status-colors-unified.js +0 -106
@@ -1,13 +1,16 @@
1
+ "use strict";
1
2
  /**
2
3
  * Sorting-related constants
3
4
  */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.SORT_DIRECTION_DESC = exports.SORT_DIRECTION_ASC = exports.DEFAULT_SORT_CONFIG = exports.SORT_FIELDS = exports.SORT_DIRECTION = void 0;
4
7
  // Sort directions
5
- export const SORT_DIRECTION = {
8
+ exports.SORT_DIRECTION = {
6
9
  ASC: 'asc',
7
10
  DESC: 'desc',
8
11
  };
9
12
  // Common sort fields
10
- export const SORT_FIELDS = {
13
+ exports.SORT_FIELDS = {
11
14
  // Time-based
12
15
  CREATED_AT: 'created_at',
13
16
  UPDATED_AT: 'updated_at',
@@ -28,24 +31,24 @@ export const SORT_FIELDS = {
28
31
  TYPE: 'type',
29
32
  };
30
33
  // Default sort configurations
31
- export const DEFAULT_SORT_CONFIG = {
34
+ exports.DEFAULT_SORT_CONFIG = {
32
35
  PORTFOLIOS: {
33
- field: SORT_FIELDS.UPDATED_AT,
34
- direction: SORT_DIRECTION.DESC,
36
+ field: exports.SORT_FIELDS.UPDATED_AT,
37
+ direction: exports.SORT_DIRECTION.DESC,
35
38
  },
36
39
  TRADES: {
37
- field: SORT_FIELDS.CREATED_AT,
38
- direction: SORT_DIRECTION.DESC,
40
+ field: exports.SORT_FIELDS.CREATED_AT,
41
+ direction: exports.SORT_DIRECTION.DESC,
39
42
  },
40
43
  WITHDRAWALS: {
41
- field: SORT_FIELDS.CREATED_AT,
42
- direction: SORT_DIRECTION.DESC,
44
+ field: exports.SORT_FIELDS.CREATED_AT,
45
+ direction: exports.SORT_DIRECTION.DESC,
43
46
  },
44
47
  TRANSACTIONS: {
45
- field: SORT_FIELDS.DATE,
46
- direction: SORT_DIRECTION.DESC,
48
+ field: exports.SORT_FIELDS.DATE,
49
+ direction: exports.SORT_DIRECTION.DESC,
47
50
  },
48
51
  };
49
52
  // Blueberry compatibility exports
50
- export const SORT_DIRECTION_ASC = SORT_DIRECTION.ASC;
51
- export const SORT_DIRECTION_DESC = SORT_DIRECTION.DESC;
53
+ exports.SORT_DIRECTION_ASC = exports.SORT_DIRECTION.ASC;
54
+ exports.SORT_DIRECTION_DESC = exports.SORT_DIRECTION.DESC;
@@ -1,8 +1,11 @@
1
+ "use strict";
1
2
  /**
2
3
  * Time-related constants
3
4
  */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.TIME_RANGES = exports.DATE_ISO_TIME_SEPARATOR = exports.DEFAULT_RECENT_TRANSACTIONS_DAYS = exports.MILLISECONDS_PER_DAY = exports.SESSION_DURATIONS = exports.TIME_ZONES = exports.DATE_FORMATS = exports.SECONDS = exports.MILLISECONDS = void 0;
4
7
  // Time conversions in milliseconds
5
- export const MILLISECONDS = {
8
+ exports.MILLISECONDS = {
6
9
  SECOND: 1000,
7
10
  MINUTE: 60 * 1000,
8
11
  HOUR: 60 * 60 * 1000,
@@ -10,14 +13,14 @@ export const MILLISECONDS = {
10
13
  WEEK: 7 * 24 * 60 * 60 * 1000,
11
14
  };
12
15
  // Time conversions in seconds
13
- export const SECONDS = {
16
+ exports.SECONDS = {
14
17
  MINUTE: 60,
15
18
  HOUR: 60 * 60,
16
19
  DAY: 24 * 60 * 60,
17
20
  WEEK: 7 * 24 * 60 * 60,
18
21
  };
19
22
  // Common date formats
20
- export const DATE_FORMATS = {
23
+ exports.DATE_FORMATS = {
21
24
  // Display formats
22
25
  DISPLAY_DATE: 'MMM dd, yyyy',
23
26
  DISPLAY_DATE_TIME: 'MMM dd, yyyy HH:mm',
@@ -34,7 +37,7 @@ export const DATE_FORMATS = {
34
37
  TIME_WITH_SECONDS: 'HH:mm:ss',
35
38
  };
36
39
  // Time zones
37
- export const TIME_ZONES = {
40
+ exports.TIME_ZONES = {
38
41
  UTC: 'UTC',
39
42
  EST: 'America/New_York',
40
43
  PST: 'America/Los_Angeles',
@@ -42,19 +45,19 @@ export const TIME_ZONES = {
42
45
  MELBOURNE: 'Australia/Melbourne',
43
46
  };
44
47
  // Session durations
45
- export const SESSION_DURATIONS = {
48
+ exports.SESSION_DURATIONS = {
46
49
  DEFAULT: 30 * 60 * 1000, // 30 minutes
47
50
  EXTENDED: 24 * 60 * 60 * 1000, // 24 hours
48
51
  REMEMBER_ME: 30 * 24 * 60 * 60 * 1000, // 30 days
49
52
  };
50
53
  // Time unit constants (matching Blueberry)
51
- export const MILLISECONDS_PER_DAY = 24 * 60 * 60 * 1000;
54
+ exports.MILLISECONDS_PER_DAY = 24 * 60 * 60 * 1000;
52
55
  // Default time periods
53
- export const DEFAULT_RECENT_TRANSACTIONS_DAYS = 30;
56
+ exports.DEFAULT_RECENT_TRANSACTIONS_DAYS = 30;
54
57
  // Date format patterns
55
- export const DATE_ISO_TIME_SEPARATOR = 'T';
58
+ exports.DATE_ISO_TIME_SEPARATOR = 'T';
56
59
  // Time range configurations with labels and day counts
57
- export const TIME_RANGES = [
60
+ exports.TIME_RANGES = [
58
61
  { label: '1W', value: '1W', days: 7 },
59
62
  { label: '1M', value: '1M', days: 30 },
60
63
  { label: '6M', value: '6M', days: 180 },
@@ -1 +1 @@
1
- {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/utilities/validation.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,eAAO,MAAM,cAAc;;;;;;;;;;;CAWjB,CAAC;AAGX,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCnB,CAAC;AAGX,eAAO,MAAM,iBAAiB;;;;;;iCAMR,MAAM,OAAO,MAAM;iCACnB,MAAM,OAAO,MAAM;gCACpB,MAAM,OAAO,MAAM;gCACnB,MAAM,OAAO,MAAM;qCACd,MAAM;;CAEtB,CAAC"}
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/utilities/validation.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,eAAO,MAAM,cAAc;;;;;;;;;;;CAWjB,CAAC;AAGX,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCnB,CAAC;AAGX,eAAO,MAAM,iBAAiB;;;;;;iCAMR,MAAM,OAAO,MAAM;iCACnB,MAAM,OAAO,MAAM;gCACpB,MAAM,OAAO,MAAM;gCACnB,MAAM,OAAO,MAAM;qCACd,MAAM;;CAEtB,CAAC"}
@@ -1,9 +1,11 @@
1
+ "use strict";
1
2
  /**
2
3
  * Validation-related constants
3
4
  */
4
- import { COMMON_THRESHOLDS } from '../config/thresholds';
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.VALIDATION_ERRORS = exports.VALIDATION_RULES = exports.REGEX_PATTERNS = void 0;
5
7
  // Regular expression patterns
6
- export const REGEX_PATTERNS = {
8
+ exports.REGEX_PATTERNS = {
7
9
  EMAIL: /^[^\s@]+@[^\s@]+\.[^\s@]+$/,
8
10
  PHONE: /^\+?[\d\s-()]+$/,
9
11
  USERNAME: /^[a-zA-Z0-9_-]{3,30}$/,
@@ -16,7 +18,7 @@ export const REGEX_PATTERNS = {
16
18
  URL: /^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)$/,
17
19
  };
18
20
  // Validation rules
19
- export const VALIDATION_RULES = {
21
+ exports.VALIDATION_RULES = {
20
22
  // User-related
21
23
  MIN_USERNAME_LENGTH: 3,
22
24
  MAX_USERNAME_LENGTH: 30,
@@ -28,7 +30,7 @@ export const VALIDATION_RULES = {
28
30
  MIN_PORTFOLIO_NAME_LENGTH: 3,
29
31
  MAX_PORTFOLIO_NAME_LENGTH: 100,
30
32
  MIN_PORTFOLIO_DESCRIPTION_LENGTH: 0,
31
- MAX_PORTFOLIO_DESCRIPTION_LENGTH: COMMON_THRESHOLDS.MAX_DESCRIPTION_LENGTH,
33
+ MAX_PORTFOLIO_DESCRIPTION_LENGTH: 500,
32
34
  // Trade-related
33
35
  MIN_TRADE_AMOUNT: 0.01,
34
36
  MAX_TRADE_AMOUNT: 1000000,
@@ -40,7 +42,7 @@ export const VALIDATION_RULES = {
40
42
  MIN_WITHDRAWAL_AMOUNT: 100,
41
43
  MAX_WITHDRAWAL_AMOUNT: 1000000,
42
44
  // General
43
- MAX_DESCRIPTION_LENGTH: COMMON_THRESHOLDS.MAX_DESCRIPTION_LENGTH,
45
+ MAX_DESCRIPTION_LENGTH: 500,
44
46
  MAX_NOTES_LENGTH: 1000,
45
47
  MAX_FILE_SIZE_MB: 10,
46
48
  MAX_FILE_NAME_LENGTH: 255,
@@ -51,7 +53,7 @@ export const VALIDATION_RULES = {
51
53
  MAX_POSTAL_CODE_LENGTH: 10,
52
54
  };
53
55
  // Error messages
54
- export const VALIDATION_ERRORS = {
56
+ exports.VALIDATION_ERRORS = {
55
57
  REQUIRED: 'This field is required',
56
58
  INVALID_EMAIL: 'Please enter a valid email address',
57
59
  INVALID_PHONE: 'Please enter a valid phone number',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cranberry-money/shared-constants",
3
- "version": "5.0.0",
3
+ "version": "5.1.0",
4
4
  "description": "Shared constants for MyPortfolio platform",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,34 +0,0 @@
1
- /**
2
- * Holdings and snapshot related constants
3
- * These constants should match the backend constants
4
- */
5
- export declare const SNAPSHOT_REASON_TRADE = "TRADE";
6
- export declare const SNAPSHOT_REASON_REBALANCE = "REBALANCE";
7
- export declare const SNAPSHOT_REASON_VALUATION = "VALUATION";
8
- export declare const SNAPSHOT_REASON_AUDIT = "AUDIT";
9
- export declare const SNAPSHOT_REASON: {
10
- readonly TRADE: "TRADE";
11
- readonly REBALANCE: "REBALANCE";
12
- readonly VALUATION: "VALUATION";
13
- readonly AUDIT: "AUDIT";
14
- };
15
- export type SnapshotReason = (typeof SNAPSHOT_REASON)[keyof typeof SNAPSHOT_REASON];
16
- export declare const SNAPSHOT_REASON_LABEL_TRADE = "Trade Execution";
17
- export declare const SNAPSHOT_REASON_LABEL_REBALANCE = "Portfolio Rebalance";
18
- export declare const SNAPSHOT_REASON_LABEL_VALUATION = "Valuation Update";
19
- export declare const SNAPSHOT_REASON_LABEL_AUDIT = "Audit Record";
20
- export declare const SNAPSHOT_REASON_LABELS: Record<SnapshotReason, string>;
21
- export declare const SNAPSHOT_REASON_OPTIONS: readonly [{
22
- readonly value: "TRADE";
23
- readonly label: "Trade Execution";
24
- }, {
25
- readonly value: "REBALANCE";
26
- readonly label: "Portfolio Rebalance";
27
- }, {
28
- readonly value: "VALUATION";
29
- readonly label: "Valuation Update";
30
- }, {
31
- readonly value: "AUDIT";
32
- readonly label: "Audit Record";
33
- }];
34
- //# sourceMappingURL=holdings.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"holdings.d.ts","sourceRoot":"","sources":["../../src/business/holdings.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,eAAO,MAAM,qBAAqB,UAAU,CAAC;AAC7C,eAAO,MAAM,yBAAyB,cAAc,CAAC;AACrD,eAAO,MAAM,yBAAyB,cAAc,CAAC;AACrD,eAAO,MAAM,qBAAqB,UAAU,CAAC;AAE7C,eAAO,MAAM,eAAe;;;;;CAKlB,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;AAGpF,eAAO,MAAM,2BAA2B,oBAAoB,CAAC;AAC7D,eAAO,MAAM,+BAA+B,wBAAwB,CAAC;AACrE,eAAO,MAAM,+BAA+B,qBAAqB,CAAC;AAClE,eAAO,MAAM,2BAA2B,iBAAiB,CAAC;AAG1D,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAKxD,CAAC;AAGX,eAAO,MAAM,uBAAuB;;;;;;;;;;;;EAK1B,CAAC"}
@@ -1,34 +0,0 @@
1
- /**
2
- * Holdings and snapshot related constants
3
- * These constants should match the backend constants
4
- */
5
- // Asset holding snapshot reason constants
6
- export const SNAPSHOT_REASON_TRADE = 'TRADE';
7
- export const SNAPSHOT_REASON_REBALANCE = 'REBALANCE';
8
- export const SNAPSHOT_REASON_VALUATION = 'VALUATION';
9
- export const SNAPSHOT_REASON_AUDIT = 'AUDIT';
10
- export const SNAPSHOT_REASON = {
11
- TRADE: SNAPSHOT_REASON_TRADE,
12
- REBALANCE: SNAPSHOT_REASON_REBALANCE,
13
- VALUATION: SNAPSHOT_REASON_VALUATION,
14
- AUDIT: SNAPSHOT_REASON_AUDIT,
15
- };
16
- // Snapshot reason label constants
17
- export const SNAPSHOT_REASON_LABEL_TRADE = 'Trade Execution';
18
- export const SNAPSHOT_REASON_LABEL_REBALANCE = 'Portfolio Rebalance';
19
- export const SNAPSHOT_REASON_LABEL_VALUATION = 'Valuation Update';
20
- export const SNAPSHOT_REASON_LABEL_AUDIT = 'Audit Record';
21
- // Snapshot reason labels for UI display
22
- export const SNAPSHOT_REASON_LABELS = {
23
- [SNAPSHOT_REASON.TRADE]: SNAPSHOT_REASON_LABEL_TRADE,
24
- [SNAPSHOT_REASON.REBALANCE]: SNAPSHOT_REASON_LABEL_REBALANCE,
25
- [SNAPSHOT_REASON.VALUATION]: SNAPSHOT_REASON_LABEL_VALUATION,
26
- [SNAPSHOT_REASON.AUDIT]: SNAPSHOT_REASON_LABEL_AUDIT,
27
- };
28
- // Snapshot reason options for forms
29
- export const SNAPSHOT_REASON_OPTIONS = [
30
- { value: SNAPSHOT_REASON_TRADE, label: SNAPSHOT_REASON_LABEL_TRADE },
31
- { value: SNAPSHOT_REASON_REBALANCE, label: SNAPSHOT_REASON_LABEL_REBALANCE },
32
- { value: SNAPSHOT_REASON_VALUATION, label: SNAPSHOT_REASON_LABEL_VALUATION },
33
- { value: SNAPSHOT_REASON_AUDIT, label: SNAPSHOT_REASON_LABEL_AUDIT },
34
- ];
@@ -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,20 +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
- readonly REJECTED: "REJECTED";
16
- readonly EXPIRED: "EXPIRED";
17
- };
18
- export type CommonStatusValues = (typeof COMMON_STATUS)[keyof typeof COMMON_STATUS];
19
- export declare const PENDING: "PENDING", APPROVED: "APPROVED", CANCELLED: "CANCELLED", FAILED: "FAILED", COMPLETED: "COMPLETED", PROCESSING: "PROCESSING", ACTIVE: "ACTIVE", INACTIVE: "INACTIVE", EXECUTED: "EXECUTED", REJECTED: "REJECTED", EXPIRED: "EXPIRED";
20
- //# 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;;;;;;;;;;;;CAYhB,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAGpF,eAAO,MACL,OAAO,aACP,QAAQ,cACR,SAAS,eACT,MAAM,YACN,SAAS,eACT,UAAU,gBACV,MAAM,YACN,QAAQ,cACR,QAAQ,cACR,QAAQ,cACR,OAAO,WACQ,CAAC"}
@@ -1,19 +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
- REJECTED: 'REJECTED',
16
- EXPIRED: 'EXPIRED',
17
- };
18
- // Re-export individual values for convenience
19
- export const { PENDING, APPROVED, CANCELLED, FAILED, COMPLETED, PROCESSING, ACTIVE, INACTIVE, EXECUTED, REJECTED, EXPIRED, } = COMMON_STATUS;
@@ -1,79 +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
- * Common label values used across domains
18
- */
19
- export declare const COMMON_LABELS: {
20
- readonly OTHER: "Other";
21
- readonly UNKNOWN: "Unknown";
22
- readonly NONE: "None";
23
- readonly ALL: "All";
24
- readonly DEFAULT: "Default";
25
- readonly CUSTOM: "Custom";
26
- };
27
- /**
28
- * Default numeric values
29
- */
30
- export declare const DEFAULT_NUMBERS: {
31
- readonly ZERO: 0;
32
- readonly PRECISION: 2;
33
- readonly PERCENTAGE_PRECISION: 2;
34
- readonly QUANTITY_PRECISION: 6;
35
- };
36
- /**
37
- * Locale configuration
38
- */
39
- export declare const LOCALE_CONFIG: {
40
- readonly DEFAULT: "en-AU";
41
- readonly FALLBACK: "en-US";
42
- readonly SUPPORTED: readonly ["en-AU", "en-US", "en-GB"];
43
- };
44
- export type SupportedLocale = (typeof LOCALE_CONFIG.SUPPORTED)[number];
45
- /**
46
- * Default allocation values
47
- */
48
- export declare const CONFIG_ALLOCATION_DEFAULTS: {
49
- readonly DEFAULT_PERCENTAGE: 10;
50
- readonly PERCENTAGE_PRECISION: 0.01;
51
- readonly TARGET_TOTAL: 100;
52
- };
53
- /**
54
- * Default format options for number formatting
55
- */
56
- export declare const DEFAULT_FORMAT_OPTIONS: {
57
- readonly CURRENCY: {
58
- readonly style: "currency";
59
- readonly minimumFractionDigits: 2;
60
- readonly maximumFractionDigits: 2;
61
- };
62
- readonly CURRENCY_SIGNED: {
63
- readonly style: "currency";
64
- readonly minimumFractionDigits: 2;
65
- readonly maximumFractionDigits: 2;
66
- readonly signDisplay: "always";
67
- };
68
- readonly PERCENTAGE: {
69
- readonly style: "percent";
70
- readonly minimumFractionDigits: 0;
71
- readonly maximumFractionDigits: 2;
72
- };
73
- readonly DECIMAL: {
74
- readonly style: "decimal";
75
- readonly minimumFractionDigits: 0;
76
- readonly maximumFractionDigits: 8;
77
- };
78
- };
79
- //# 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,aAAa;;;;;;;CAOhB,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,77 +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
- * Common label values used across domains
18
- */
19
- export const COMMON_LABELS = {
20
- OTHER: 'Other',
21
- UNKNOWN: 'Unknown',
22
- NONE: 'None',
23
- ALL: 'All',
24
- DEFAULT: 'Default',
25
- CUSTOM: 'Custom',
26
- };
27
- /**
28
- * Default numeric values
29
- */
30
- export const DEFAULT_NUMBERS = {
31
- ZERO: 0,
32
- PRECISION: 2,
33
- PERCENTAGE_PRECISION: 2,
34
- QUANTITY_PRECISION: 6,
35
- };
36
- /**
37
- * Locale configuration
38
- */
39
- export const LOCALE_CONFIG = {
40
- DEFAULT: 'en-AU',
41
- FALLBACK: 'en-US',
42
- SUPPORTED: ['en-AU', 'en-US', 'en-GB'],
43
- };
44
- /**
45
- * Default allocation values
46
- */
47
- export const CONFIG_ALLOCATION_DEFAULTS = {
48
- DEFAULT_PERCENTAGE: 10,
49
- PERCENTAGE_PRECISION: 0.01,
50
- TARGET_TOTAL: 100,
51
- };
52
- /**
53
- * Default format options for number formatting
54
- */
55
- export const DEFAULT_FORMAT_OPTIONS = {
56
- CURRENCY: {
57
- style: 'currency',
58
- minimumFractionDigits: DEFAULT_NUMBERS.PRECISION,
59
- maximumFractionDigits: DEFAULT_NUMBERS.PRECISION,
60
- },
61
- CURRENCY_SIGNED: {
62
- style: 'currency',
63
- minimumFractionDigits: DEFAULT_NUMBERS.PRECISION,
64
- maximumFractionDigits: DEFAULT_NUMBERS.PRECISION,
65
- signDisplay: 'always',
66
- },
67
- PERCENTAGE: {
68
- style: 'percent',
69
- minimumFractionDigits: 0,
70
- maximumFractionDigits: DEFAULT_NUMBERS.PERCENTAGE_PRECISION,
71
- },
72
- DECIMAL: {
73
- style: 'decimal',
74
- minimumFractionDigits: 0,
75
- maximumFractionDigits: 8,
76
- },
77
- };
@@ -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"}