@cranberry-money/shared-constants 5.1.0 → 5.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/auth.js +18 -21
- package/dist/api/config.js +4 -7
- package/dist/api/endpoints.js +28 -31
- package/dist/api/http.js +6 -9
- package/dist/api/index.js +4 -20
- package/dist/business/accounts.js +34 -37
- package/dist/business/bank-accounts.js +51 -55
- package/dist/business/banking.js +26 -29
- package/dist/business/countries.js +3 -6
- package/dist/business/documents.js +38 -41
- package/dist/business/index.js +12 -74
- package/dist/business/industries.js +2 -5
- package/dist/business/investments.js +53 -56
- package/dist/business/status/banks.js +11 -14
- package/dist/business/status/cash-accounts.js +33 -36
- package/dist/business/status/documents.js +19 -22
- package/dist/business/status/index.js +7 -23
- package/dist/business/status/instruments.js +21 -24
- package/dist/business/status/portfolios.js +5 -8
- package/dist/business/status/trades.js +65 -68
- package/dist/business/status/withdrawals.js +77 -80
- package/dist/business/trading.js +23 -26
- package/dist/financial/currency.js +42 -45
- package/dist/financial/formatting.js +9 -12
- package/dist/financial/index.js +3 -19
- package/dist/financial/instruments.js +25 -28
- package/dist/index.js +5 -21
- package/dist/ui/colors.js +37 -41
- package/dist/ui/display.js +20 -23
- package/dist/ui/index.js +3 -19
- package/dist/ui/labels/index.js +15 -49
- package/dist/utilities/common.js +20 -23
- package/dist/utilities/defaults.js +6 -9
- package/dist/utilities/index.js +5 -21
- package/dist/utilities/sorting.js +13 -16
- package/dist/utilities/time.js +9 -12
- package/dist/utilities/validation.js +3 -6
- package/package.json +1 -1
package/dist/ui/colors.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* UI color constants
|
|
4
3
|
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getChartColor = exports.TRADING_STATUS_COLORS = exports.PERFORMANCE_COLORS = exports.SEMANTIC_COLORS = exports.BADGE_COLORS = exports.STATUS_BG_COLORS = exports.STATUS_COLOR_DEFAULT = exports.STATUS_COLOR_CANCELLED = exports.STATUS_COLOR_FAILED = exports.STATUS_COLOR_REJECTED = exports.STATUS_COLOR_COMPLETED = exports.STATUS_COLOR_APPROVED = exports.STATUS_COLOR_IN_PROGRESS = exports.STATUS_COLOR_PROCESSING = exports.STATUS_COLOR_AWAITING = exports.STATUS_COLOR_PENDING = exports.STATUS_COLORS = exports.CHART_COLORS = void 0;
|
|
7
4
|
// Chart color palette (10 colors for data visualization) - Blueberry compatible
|
|
8
|
-
|
|
5
|
+
export const CHART_COLORS = [
|
|
9
6
|
'#3B82F6', // Blue - primary data color
|
|
10
7
|
'#EF4444', // Red - negative/loss indicators
|
|
11
8
|
'#10B981', // Green - positive/gain indicators
|
|
@@ -18,7 +15,7 @@ exports.CHART_COLORS = [
|
|
|
18
15
|
'#6366F1', // Indigo - brand accent
|
|
19
16
|
];
|
|
20
17
|
// Status colors (Tailwind CSS classes)
|
|
21
|
-
|
|
18
|
+
export const STATUS_COLORS = {
|
|
22
19
|
SUCCESS: 'text-green-600',
|
|
23
20
|
WARNING: 'text-amber-600',
|
|
24
21
|
ERROR: 'text-red-600',
|
|
@@ -26,18 +23,18 @@ exports.STATUS_COLORS = {
|
|
|
26
23
|
NEUTRAL: 'text-gray-600',
|
|
27
24
|
};
|
|
28
25
|
// Individual status color constants for Blueberry compatibility
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
26
|
+
export const STATUS_COLOR_PENDING = 'text-warning-600';
|
|
27
|
+
export const STATUS_COLOR_AWAITING = 'text-warning-600';
|
|
28
|
+
export const STATUS_COLOR_PROCESSING = 'text-primary-600';
|
|
29
|
+
export const STATUS_COLOR_IN_PROGRESS = 'text-primary-600';
|
|
30
|
+
export const STATUS_COLOR_APPROVED = 'text-success-600';
|
|
31
|
+
export const STATUS_COLOR_COMPLETED = 'text-success-700';
|
|
32
|
+
export const STATUS_COLOR_REJECTED = 'text-error-600';
|
|
33
|
+
export const STATUS_COLOR_FAILED = 'text-error-700';
|
|
34
|
+
export const STATUS_COLOR_CANCELLED = 'text-content-subtle';
|
|
35
|
+
export const STATUS_COLOR_DEFAULT = 'text-content-subtle';
|
|
39
36
|
// Background status colors
|
|
40
|
-
|
|
37
|
+
export const STATUS_BG_COLORS = {
|
|
41
38
|
SUCCESS: 'bg-green-50',
|
|
42
39
|
WARNING: 'bg-amber-50',
|
|
43
40
|
ERROR: 'bg-red-50',
|
|
@@ -45,7 +42,7 @@ exports.STATUS_BG_COLORS = {
|
|
|
45
42
|
NEUTRAL: 'bg-gray-50',
|
|
46
43
|
};
|
|
47
44
|
// Badge colors
|
|
48
|
-
|
|
45
|
+
export const BADGE_COLORS = {
|
|
49
46
|
PRIMARY: 'bg-indigo-100 text-indigo-700',
|
|
50
47
|
SECONDARY: 'bg-gray-100 text-gray-700',
|
|
51
48
|
SUCCESS: 'bg-green-100 text-green-700',
|
|
@@ -54,42 +51,41 @@ exports.BADGE_COLORS = {
|
|
|
54
51
|
INFO: 'bg-blue-100 text-blue-700',
|
|
55
52
|
};
|
|
56
53
|
// Semantic colors
|
|
57
|
-
|
|
54
|
+
export const SEMANTIC_COLORS = {
|
|
58
55
|
POSITIVE: '#10B981', // Green for positive values
|
|
59
56
|
NEGATIVE: '#EF4444', // Red for negative values
|
|
60
57
|
NEUTRAL: '#6B7280', // Gray for neutral values
|
|
61
58
|
};
|
|
62
59
|
// Portfolio performance colors
|
|
63
|
-
|
|
64
|
-
GAIN:
|
|
65
|
-
LOSS:
|
|
66
|
-
UNCHANGED:
|
|
60
|
+
export const PERFORMANCE_COLORS = {
|
|
61
|
+
GAIN: SEMANTIC_COLORS.POSITIVE,
|
|
62
|
+
LOSS: SEMANTIC_COLORS.NEGATIVE,
|
|
63
|
+
UNCHANGED: SEMANTIC_COLORS.NEUTRAL,
|
|
67
64
|
};
|
|
68
65
|
// Trading status colors
|
|
69
|
-
|
|
66
|
+
export const TRADING_STATUS_COLORS = {
|
|
70
67
|
// Trade statuses
|
|
71
|
-
PENDING:
|
|
72
|
-
EXECUTED:
|
|
73
|
-
SETTLED:
|
|
74
|
-
CANCELLED:
|
|
75
|
-
FAILED:
|
|
76
|
-
EXPIRED:
|
|
77
|
-
REJECTED:
|
|
68
|
+
PENDING: STATUS_COLORS.WARNING,
|
|
69
|
+
EXECUTED: STATUS_COLORS.SUCCESS,
|
|
70
|
+
SETTLED: STATUS_COLORS.SUCCESS,
|
|
71
|
+
CANCELLED: STATUS_COLORS.NEUTRAL,
|
|
72
|
+
FAILED: STATUS_COLORS.ERROR,
|
|
73
|
+
EXPIRED: STATUS_COLORS.NEUTRAL,
|
|
74
|
+
REJECTED: STATUS_COLORS.ERROR,
|
|
78
75
|
// Withdrawal statuses
|
|
79
|
-
PENDING_REVIEW:
|
|
80
|
-
APPROVED:
|
|
81
|
-
COMPLETED:
|
|
82
|
-
PROCESSING:
|
|
83
|
-
ON_HOLD:
|
|
76
|
+
PENDING_REVIEW: STATUS_COLORS.WARNING,
|
|
77
|
+
APPROVED: STATUS_COLORS.SUCCESS,
|
|
78
|
+
COMPLETED: STATUS_COLORS.SUCCESS,
|
|
79
|
+
PROCESSING: STATUS_COLORS.INFO,
|
|
80
|
+
ON_HOLD: STATUS_COLORS.WARNING,
|
|
84
81
|
// Portfolio statuses
|
|
85
|
-
ACTIVE:
|
|
86
|
-
INACTIVE:
|
|
87
|
-
CLOSED:
|
|
82
|
+
ACTIVE: STATUS_COLORS.SUCCESS,
|
|
83
|
+
INACTIVE: STATUS_COLORS.WARNING,
|
|
84
|
+
CLOSED: STATUS_COLORS.NEUTRAL,
|
|
88
85
|
};
|
|
89
86
|
/**
|
|
90
87
|
* Get chart color by index (cycles through palette)
|
|
91
88
|
*/
|
|
92
|
-
const getChartColor = (index) => {
|
|
93
|
-
return
|
|
89
|
+
export const getChartColor = (index) => {
|
|
90
|
+
return CHART_COLORS[index % CHART_COLORS.length];
|
|
94
91
|
};
|
|
95
|
-
exports.getChartColor = getChartColor;
|
package/dist/ui/display.js
CHANGED
|
@@ -1,31 +1,28 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* UI display constants
|
|
4
3
|
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ICON_SIZE = exports.NOTIFICATION_TYPE = exports.TABLE_DENSITY = exports.CHART_TYPE = exports.DATE_RANGE_PRESET_LABELS = exports.DATE_RANGE_PRESET = exports.VIEW_TYPE = exports.DISPLAY_MODE = exports.LOADING_STATES = void 0;
|
|
7
4
|
// Loading states
|
|
8
|
-
|
|
5
|
+
export const LOADING_STATES = {
|
|
9
6
|
IDLE: 'idle',
|
|
10
7
|
LOADING: 'loading',
|
|
11
8
|
SUCCESS: 'success',
|
|
12
9
|
ERROR: 'error',
|
|
13
10
|
};
|
|
14
11
|
// Display modes
|
|
15
|
-
|
|
12
|
+
export const DISPLAY_MODE = {
|
|
16
13
|
TABLE: 'table',
|
|
17
14
|
GRID: 'grid',
|
|
18
15
|
LIST: 'list',
|
|
19
16
|
CHART: 'chart',
|
|
20
17
|
};
|
|
21
18
|
// View types
|
|
22
|
-
|
|
19
|
+
export const VIEW_TYPE = {
|
|
23
20
|
SUMMARY: 'summary',
|
|
24
21
|
DETAILED: 'detailed',
|
|
25
22
|
COMPACT: 'compact',
|
|
26
23
|
};
|
|
27
24
|
// Date range presets
|
|
28
|
-
|
|
25
|
+
export const DATE_RANGE_PRESET = {
|
|
29
26
|
TODAY: 'today',
|
|
30
27
|
YESTERDAY: 'yesterday',
|
|
31
28
|
LAST_7_DAYS: 'last_7_days',
|
|
@@ -38,21 +35,21 @@ exports.DATE_RANGE_PRESET = {
|
|
|
38
35
|
ALL_TIME: 'all_time',
|
|
39
36
|
CUSTOM: 'custom',
|
|
40
37
|
};
|
|
41
|
-
|
|
42
|
-
[
|
|
43
|
-
[
|
|
44
|
-
[
|
|
45
|
-
[
|
|
46
|
-
[
|
|
47
|
-
[
|
|
48
|
-
[
|
|
49
|
-
[
|
|
50
|
-
[
|
|
51
|
-
[
|
|
52
|
-
[
|
|
38
|
+
export const DATE_RANGE_PRESET_LABELS = {
|
|
39
|
+
[DATE_RANGE_PRESET.TODAY]: 'Today',
|
|
40
|
+
[DATE_RANGE_PRESET.YESTERDAY]: 'Yesterday',
|
|
41
|
+
[DATE_RANGE_PRESET.LAST_7_DAYS]: 'Last 7 Days',
|
|
42
|
+
[DATE_RANGE_PRESET.LAST_30_DAYS]: 'Last 30 Days',
|
|
43
|
+
[DATE_RANGE_PRESET.LAST_90_DAYS]: 'Last 90 Days',
|
|
44
|
+
[DATE_RANGE_PRESET.THIS_MONTH]: 'This Month',
|
|
45
|
+
[DATE_RANGE_PRESET.LAST_MONTH]: 'Last Month',
|
|
46
|
+
[DATE_RANGE_PRESET.THIS_YEAR]: 'This Year',
|
|
47
|
+
[DATE_RANGE_PRESET.LAST_YEAR]: 'Last Year',
|
|
48
|
+
[DATE_RANGE_PRESET.ALL_TIME]: 'All Time',
|
|
49
|
+
[DATE_RANGE_PRESET.CUSTOM]: 'Custom Range',
|
|
53
50
|
};
|
|
54
51
|
// Chart types
|
|
55
|
-
|
|
52
|
+
export const CHART_TYPE = {
|
|
56
53
|
LINE: 'line',
|
|
57
54
|
BAR: 'bar',
|
|
58
55
|
PIE: 'pie',
|
|
@@ -61,20 +58,20 @@ exports.CHART_TYPE = {
|
|
|
61
58
|
SCATTER: 'scatter',
|
|
62
59
|
};
|
|
63
60
|
// Table density
|
|
64
|
-
|
|
61
|
+
export const TABLE_DENSITY = {
|
|
65
62
|
COMPACT: 'compact',
|
|
66
63
|
NORMAL: 'normal',
|
|
67
64
|
COMFORTABLE: 'comfortable',
|
|
68
65
|
};
|
|
69
66
|
// Notification types
|
|
70
|
-
|
|
67
|
+
export const NOTIFICATION_TYPE = {
|
|
71
68
|
SUCCESS: 'success',
|
|
72
69
|
ERROR: 'error',
|
|
73
70
|
WARNING: 'warning',
|
|
74
71
|
INFO: 'info',
|
|
75
72
|
};
|
|
76
73
|
// Icon sizes
|
|
77
|
-
|
|
74
|
+
export const ICON_SIZE = {
|
|
78
75
|
XS: 'h-3 w-3',
|
|
79
76
|
SM: 'h-4 w-4',
|
|
80
77
|
MD: 'h-5 w-5',
|
package/dist/ui/index.js
CHANGED
|
@@ -1,22 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* UI/Display constants
|
|
4
3
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
-
}
|
|
11
|
-
Object.defineProperty(o, k2, desc);
|
|
12
|
-
}) : (function(o, m, k, k2) {
|
|
13
|
-
if (k2 === undefined) k2 = k;
|
|
14
|
-
o[k2] = m[k];
|
|
15
|
-
}));
|
|
16
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
17
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
18
|
-
};
|
|
19
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
__exportStar(require("./colors"), exports);
|
|
21
|
-
__exportStar(require("./display"), exports);
|
|
22
|
-
__exportStar(require("./labels"), exports);
|
|
4
|
+
export * from './colors';
|
|
5
|
+
export * from './display';
|
|
6
|
+
export * from './labels';
|
package/dist/ui/labels/index.js
CHANGED
|
@@ -1,57 +1,23 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* UI label constants
|
|
4
3
|
* Re-exports all label constants from business domain
|
|
5
4
|
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.DATE_RANGE_PRESET_LABELS = exports.ASSET_CLASS_LABELS = exports.INSTRUMENT_TYPE_LABELS = exports.CURRENCY_NAMES = exports.TRADE_RESTRICTION_LABELS = exports.TRADE_FEE_TYPE_LABELS = exports.EXECUTION_VENUE_LABELS = exports.VERIFICATION_METHOD_LABELS = exports.BANKING_INSTITUTION_LABELS = exports.BANK_ACCOUNT_TYPE_LABELS = exports.INVESTMENT_OBJECTIVE_LABELS = exports.INVESTMENT_EXPERIENCE_LABELS = exports.INVESTMENT_HORIZON_LABELS = exports.RISK_TOLERANCE_LABELS = exports.DOCUMENT_CATEGORY_LABELS = exports.DOCUMENT_TYPE_LABELS = exports.SOURCE_OF_FUNDS_LABELS = exports.ACCOUNT_TYPE_LABELS = exports.CASH_ACCOUNT_TRANSACTION_TYPE_LABELS = exports.PORTFOLIO_STATUS_LABELS = exports.TRADING_STATUS_LABELS = exports.INSTRUMENT_STATUS_LABELS = exports.BANK_ACCOUNT_STATUS_LABELS = exports.DOCUMENT_STATUS_LABELS = exports.TIME_IN_FORCE_LABELS = exports.ORDER_TYPE_LABELS = exports.TRADE_TYPE_LABELS = exports.TRADE_STATUS_LABELS = exports.WITHDRAWAL_METHOD_LABELS = exports.WITHDRAWAL_REASON_LABELS = exports.WITHDRAWAL_STATUS_LABELS = void 0;
|
|
8
5
|
// Re-export all status labels
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
Object.defineProperty(exports, "ORDER_TYPE_LABELS", { enumerable: true, get: function () { return trades_1.ORDER_TYPE_LABELS; } });
|
|
17
|
-
Object.defineProperty(exports, "TIME_IN_FORCE_LABELS", { enumerable: true, get: function () { return trades_1.TIME_IN_FORCE_LABELS; } });
|
|
18
|
-
var documents_1 = require("../../business/status/documents");
|
|
19
|
-
Object.defineProperty(exports, "DOCUMENT_STATUS_LABELS", { enumerable: true, get: function () { return documents_1.DOCUMENT_STATUS_LABELS; } });
|
|
20
|
-
var banks_1 = require("../../business/status/banks");
|
|
21
|
-
Object.defineProperty(exports, "BANK_ACCOUNT_STATUS_LABELS", { enumerable: true, get: function () { return banks_1.BANK_ACCOUNT_STATUS_LABELS; } });
|
|
22
|
-
var instruments_1 = require("../../business/status/instruments");
|
|
23
|
-
Object.defineProperty(exports, "INSTRUMENT_STATUS_LABELS", { enumerable: true, get: function () { return instruments_1.INSTRUMENT_STATUS_LABELS; } });
|
|
24
|
-
Object.defineProperty(exports, "TRADING_STATUS_LABELS", { enumerable: true, get: function () { return instruments_1.TRADING_STATUS_LABELS; } });
|
|
25
|
-
var portfolios_1 = require("../../business/status/portfolios");
|
|
26
|
-
Object.defineProperty(exports, "PORTFOLIO_STATUS_LABELS", { enumerable: true, get: function () { return portfolios_1.PORTFOLIO_STATUS_LABELS; } });
|
|
27
|
-
var cash_accounts_1 = require("../../business/status/cash-accounts");
|
|
28
|
-
Object.defineProperty(exports, "CASH_ACCOUNT_TRANSACTION_TYPE_LABELS", { enumerable: true, get: function () { return cash_accounts_1.CASH_ACCOUNT_TRANSACTION_TYPE_LABELS; } });
|
|
6
|
+
export { WITHDRAWAL_STATUS_LABELS, WITHDRAWAL_REASON_LABELS, WITHDRAWAL_METHOD_LABELS, } from '../../business/status/withdrawals';
|
|
7
|
+
export { TRADE_STATUS_LABELS, TRADE_TYPE_LABELS, ORDER_TYPE_LABELS, TIME_IN_FORCE_LABELS, } from '../../business/status/trades';
|
|
8
|
+
export { DOCUMENT_STATUS_LABELS } from '../../business/status/documents';
|
|
9
|
+
export { BANK_ACCOUNT_STATUS_LABELS } from '../../business/status/banks';
|
|
10
|
+
export { INSTRUMENT_STATUS_LABELS, TRADING_STATUS_LABELS } from '../../business/status/instruments';
|
|
11
|
+
export { PORTFOLIO_STATUS_LABELS } from '../../business/status/portfolios';
|
|
12
|
+
export { CASH_ACCOUNT_TRANSACTION_TYPE_LABELS } from '../../business/status/cash-accounts';
|
|
29
13
|
// Re-export business domain labels
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
Object.defineProperty(exports, "DOCUMENT_CATEGORY_LABELS", { enumerable: true, get: function () { return documents_2.DOCUMENT_CATEGORY_LABELS; } });
|
|
36
|
-
var investments_1 = require("../../business/investments");
|
|
37
|
-
Object.defineProperty(exports, "RISK_TOLERANCE_LABELS", { enumerable: true, get: function () { return investments_1.RISK_TOLERANCE_LABELS; } });
|
|
38
|
-
Object.defineProperty(exports, "INVESTMENT_HORIZON_LABELS", { enumerable: true, get: function () { return investments_1.INVESTMENT_HORIZON_LABELS; } });
|
|
39
|
-
Object.defineProperty(exports, "INVESTMENT_EXPERIENCE_LABELS", { enumerable: true, get: function () { return investments_1.INVESTMENT_EXPERIENCE_LABELS; } });
|
|
40
|
-
Object.defineProperty(exports, "INVESTMENT_OBJECTIVE_LABELS", { enumerable: true, get: function () { return investments_1.INVESTMENT_OBJECTIVE_LABELS; } });
|
|
41
|
-
var banking_1 = require("../../business/banking");
|
|
42
|
-
Object.defineProperty(exports, "BANK_ACCOUNT_TYPE_LABELS", { enumerable: true, get: function () { return banking_1.BANK_ACCOUNT_TYPE_LABELS; } });
|
|
43
|
-
Object.defineProperty(exports, "BANKING_INSTITUTION_LABELS", { enumerable: true, get: function () { return banking_1.BANKING_INSTITUTION_LABELS; } });
|
|
44
|
-
Object.defineProperty(exports, "VERIFICATION_METHOD_LABELS", { enumerable: true, get: function () { return banking_1.VERIFICATION_METHOD_LABELS; } });
|
|
45
|
-
var trading_1 = require("../../business/trading");
|
|
46
|
-
Object.defineProperty(exports, "EXECUTION_VENUE_LABELS", { enumerable: true, get: function () { return trading_1.EXECUTION_VENUE_LABELS; } });
|
|
47
|
-
Object.defineProperty(exports, "TRADE_FEE_TYPE_LABELS", { enumerable: true, get: function () { return trading_1.TRADE_FEE_TYPE_LABELS; } });
|
|
48
|
-
Object.defineProperty(exports, "TRADE_RESTRICTION_LABELS", { enumerable: true, get: function () { return trading_1.TRADE_RESTRICTION_LABELS; } });
|
|
14
|
+
export { ACCOUNT_TYPE_LABELS, SOURCE_OF_FUNDS_LABELS } from '../../business/accounts';
|
|
15
|
+
export { DOCUMENT_TYPE_LABELS, DOCUMENT_CATEGORY_LABELS } from '../../business/documents';
|
|
16
|
+
export { RISK_TOLERANCE_LABELS, INVESTMENT_HORIZON_LABELS, INVESTMENT_EXPERIENCE_LABELS, INVESTMENT_OBJECTIVE_LABELS, } from '../../business/investments';
|
|
17
|
+
export { BANK_ACCOUNT_TYPE_LABELS, BANKING_INSTITUTION_LABELS, VERIFICATION_METHOD_LABELS, } from '../../business/banking';
|
|
18
|
+
export { EXECUTION_VENUE_LABELS, TRADE_FEE_TYPE_LABELS, TRADE_RESTRICTION_LABELS } from '../../business/trading';
|
|
49
19
|
// Re-export financial labels
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
var instruments_2 = require("../../financial/instruments");
|
|
53
|
-
Object.defineProperty(exports, "INSTRUMENT_TYPE_LABELS", { enumerable: true, get: function () { return instruments_2.INSTRUMENT_TYPE_LABELS; } });
|
|
54
|
-
Object.defineProperty(exports, "ASSET_CLASS_LABELS", { enumerable: true, get: function () { return instruments_2.ASSET_CLASS_LABELS; } });
|
|
20
|
+
export { CURRENCY_NAMES } from '../../financial/currency';
|
|
21
|
+
export { INSTRUMENT_TYPE_LABELS, ASSET_CLASS_LABELS } from '../../financial/instruments';
|
|
55
22
|
// Re-export UI labels
|
|
56
|
-
|
|
57
|
-
Object.defineProperty(exports, "DATE_RANGE_PRESET_LABELS", { enumerable: true, get: function () { return display_1.DATE_RANGE_PRESET_LABELS; } });
|
|
23
|
+
export { DATE_RANGE_PRESET_LABELS } from '../display';
|
package/dist/utilities/common.js
CHANGED
|
@@ -1,48 +1,45 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Common shared constants
|
|
4
3
|
* These match the constants from Blueberry's src/constants/common.ts
|
|
5
4
|
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.DEFAULT_ERROR_MESSAGE = exports.DEFAULT_UNKNOWN_VALUE = exports.ORDER_BY_CREATED_AT = exports.QUERY_PARAM_ORDER_BY = exports.NUMBER_FORMAT_OPTIONS_CURRENCY_SIGNED = exports.NUMBER_FORMAT_OPTIONS_CURRENCY = exports.LOCALE_AUSTRALIA = exports.ERROR_TYPE_SERVER = exports.ERROR_TYPE_PERMISSION = exports.ERROR_TYPE_BUSINESS_LOGIC = exports.ERROR_TYPE = exports.QUANTITY_FORMAT_THRESHOLD_THOUSAND = exports.QUANTITY_FORMAT_THRESHOLD_MILLION = exports.QUANTITY_FORMAT_THRESHOLD = exports.DEFAULT_EMPTY_STRING = exports.DEFAULT_NUMERIC_ZERO = exports.DECIMAL_PLACES = void 0;
|
|
8
5
|
// Number formatting
|
|
9
|
-
|
|
6
|
+
export const DECIMAL_PLACES = 2;
|
|
10
7
|
// Default numeric values
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
export const DEFAULT_NUMERIC_ZERO = 0;
|
|
9
|
+
export const DEFAULT_EMPTY_STRING = '';
|
|
13
10
|
// Quantity formatting thresholds
|
|
14
|
-
|
|
11
|
+
export const QUANTITY_FORMAT_THRESHOLD = {
|
|
15
12
|
MILLION: 1000000,
|
|
16
13
|
THOUSAND: 1000,
|
|
17
14
|
};
|
|
18
15
|
// Backward compatibility: individual exports
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
export const QUANTITY_FORMAT_THRESHOLD_MILLION = QUANTITY_FORMAT_THRESHOLD.MILLION;
|
|
17
|
+
export const QUANTITY_FORMAT_THRESHOLD_THOUSAND = QUANTITY_FORMAT_THRESHOLD.THOUSAND;
|
|
21
18
|
// Error types
|
|
22
|
-
|
|
19
|
+
export const ERROR_TYPE = {
|
|
23
20
|
BUSINESS_LOGIC: 'business_logic',
|
|
24
21
|
PERMISSION: 'permission',
|
|
25
22
|
SERVER: 'server',
|
|
26
23
|
};
|
|
27
24
|
// Backward compatibility: individual exports
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
export const ERROR_TYPE_BUSINESS_LOGIC = ERROR_TYPE.BUSINESS_LOGIC;
|
|
26
|
+
export const ERROR_TYPE_PERMISSION = ERROR_TYPE.PERMISSION;
|
|
27
|
+
export const ERROR_TYPE_SERVER = ERROR_TYPE.SERVER;
|
|
31
28
|
// Locale and formatting constants
|
|
32
|
-
|
|
29
|
+
export const LOCALE_AUSTRALIA = 'en-AU';
|
|
33
30
|
// Number formatting options
|
|
34
|
-
|
|
31
|
+
export const NUMBER_FORMAT_OPTIONS_CURRENCY = {
|
|
35
32
|
style: 'currency',
|
|
36
|
-
minimumFractionDigits:
|
|
37
|
-
maximumFractionDigits:
|
|
33
|
+
minimumFractionDigits: DECIMAL_PLACES,
|
|
34
|
+
maximumFractionDigits: DECIMAL_PLACES,
|
|
38
35
|
};
|
|
39
|
-
|
|
40
|
-
...
|
|
36
|
+
export const NUMBER_FORMAT_OPTIONS_CURRENCY_SIGNED = {
|
|
37
|
+
...NUMBER_FORMAT_OPTIONS_CURRENCY,
|
|
41
38
|
signDisplay: 'always',
|
|
42
39
|
};
|
|
43
40
|
// Query parameter constants
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
export const QUERY_PARAM_ORDER_BY = 'order_by';
|
|
42
|
+
export const ORDER_BY_CREATED_AT = 'created_at';
|
|
46
43
|
// Default strings for auth
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
export const DEFAULT_UNKNOWN_VALUE = 'Unknown';
|
|
45
|
+
export const DEFAULT_ERROR_MESSAGE = 'An error occurred';
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Default values and common constants
|
|
4
3
|
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ALLOCATION_DEFAULTS = exports.DISPLAY_LIMITS = exports.THRESHOLDS = exports.PAGINATION_DEFAULTS = exports.NUMERIC_DEFAULTS = exports.DEFAULT_VALUES = void 0;
|
|
7
4
|
// Default values
|
|
8
|
-
|
|
5
|
+
export const DEFAULT_VALUES = {
|
|
9
6
|
ZERO: '0',
|
|
10
7
|
EMPTY_STRING: '',
|
|
11
8
|
UNKNOWN: 'UNKNOWN',
|
|
@@ -13,7 +10,7 @@ exports.DEFAULT_VALUES = {
|
|
|
13
10
|
NULL_UUID: '00000000-0000-0000-0000-000000000000',
|
|
14
11
|
};
|
|
15
12
|
// Numeric defaults
|
|
16
|
-
|
|
13
|
+
export const NUMERIC_DEFAULTS = {
|
|
17
14
|
MIN_AMOUNT: 0,
|
|
18
15
|
MAX_AMOUNT: 999999999.99,
|
|
19
16
|
DEFAULT_PRECISION: 2,
|
|
@@ -21,7 +18,7 @@ exports.NUMERIC_DEFAULTS = {
|
|
|
21
18
|
QUANTITY_PRECISION: 6,
|
|
22
19
|
};
|
|
23
20
|
// Pagination defaults
|
|
24
|
-
|
|
21
|
+
export const PAGINATION_DEFAULTS = {
|
|
25
22
|
PAGE: 1,
|
|
26
23
|
PAGE_SIZE: 20,
|
|
27
24
|
MIN_PAGE_SIZE: 1,
|
|
@@ -29,7 +26,7 @@ exports.PAGINATION_DEFAULTS = {
|
|
|
29
26
|
PAGE_SIZE_OPTIONS: [10, 20, 50, 100],
|
|
30
27
|
};
|
|
31
28
|
// Common thresholds
|
|
32
|
-
|
|
29
|
+
export const THRESHOLDS = {
|
|
33
30
|
MIN_PORTFOLIO_VALUE: 1000,
|
|
34
31
|
MIN_TRADE_AMOUNT: 10,
|
|
35
32
|
MIN_WITHDRAWAL_AMOUNT: 100,
|
|
@@ -37,7 +34,7 @@ exports.THRESHOLDS = {
|
|
|
37
34
|
MAX_TRADES_PER_DAY: 100,
|
|
38
35
|
};
|
|
39
36
|
// Display limits
|
|
40
|
-
|
|
37
|
+
export const DISPLAY_LIMITS = {
|
|
41
38
|
MAX_NAME_LENGTH: 100,
|
|
42
39
|
MAX_DESCRIPTION_LENGTH: 500,
|
|
43
40
|
MAX_NOTES_LENGTH: 1000,
|
|
@@ -45,7 +42,7 @@ exports.DISPLAY_LIMITS = {
|
|
|
45
42
|
MAX_FILE_NAME_LENGTH: 255,
|
|
46
43
|
};
|
|
47
44
|
// Asset allocation defaults
|
|
48
|
-
|
|
45
|
+
export const ALLOCATION_DEFAULTS = {
|
|
49
46
|
DEFAULT_PERCENTAGE: 10,
|
|
50
47
|
PERCENTAGE_PRECISION: 0.01,
|
|
51
48
|
TARGET_TOTAL: 100,
|
package/dist/utilities/index.js
CHANGED
|
@@ -1,24 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Utility constants
|
|
4
3
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
Object.defineProperty(o, k2, desc);
|
|
12
|
-
}) : (function(o, m, k, k2) {
|
|
13
|
-
if (k2 === undefined) k2 = k;
|
|
14
|
-
o[k2] = m[k];
|
|
15
|
-
}));
|
|
16
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
17
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
18
|
-
};
|
|
19
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
__exportStar(require("./time"), exports);
|
|
21
|
-
__exportStar(require("./defaults"), exports);
|
|
22
|
-
__exportStar(require("./sorting"), exports);
|
|
23
|
-
__exportStar(require("./validation"), exports);
|
|
24
|
-
__exportStar(require("./common"), exports);
|
|
4
|
+
export * from './time';
|
|
5
|
+
export * from './defaults';
|
|
6
|
+
export * from './sorting';
|
|
7
|
+
export * from './validation';
|
|
8
|
+
export * from './common';
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Sorting-related constants
|
|
4
3
|
*/
|
|
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;
|
|
7
4
|
// Sort directions
|
|
8
|
-
|
|
5
|
+
export const SORT_DIRECTION = {
|
|
9
6
|
ASC: 'asc',
|
|
10
7
|
DESC: 'desc',
|
|
11
8
|
};
|
|
12
9
|
// Common sort fields
|
|
13
|
-
|
|
10
|
+
export const SORT_FIELDS = {
|
|
14
11
|
// Time-based
|
|
15
12
|
CREATED_AT: 'created_at',
|
|
16
13
|
UPDATED_AT: 'updated_at',
|
|
@@ -31,24 +28,24 @@ exports.SORT_FIELDS = {
|
|
|
31
28
|
TYPE: 'type',
|
|
32
29
|
};
|
|
33
30
|
// Default sort configurations
|
|
34
|
-
|
|
31
|
+
export const DEFAULT_SORT_CONFIG = {
|
|
35
32
|
PORTFOLIOS: {
|
|
36
|
-
field:
|
|
37
|
-
direction:
|
|
33
|
+
field: SORT_FIELDS.UPDATED_AT,
|
|
34
|
+
direction: SORT_DIRECTION.DESC,
|
|
38
35
|
},
|
|
39
36
|
TRADES: {
|
|
40
|
-
field:
|
|
41
|
-
direction:
|
|
37
|
+
field: SORT_FIELDS.CREATED_AT,
|
|
38
|
+
direction: SORT_DIRECTION.DESC,
|
|
42
39
|
},
|
|
43
40
|
WITHDRAWALS: {
|
|
44
|
-
field:
|
|
45
|
-
direction:
|
|
41
|
+
field: SORT_FIELDS.CREATED_AT,
|
|
42
|
+
direction: SORT_DIRECTION.DESC,
|
|
46
43
|
},
|
|
47
44
|
TRANSACTIONS: {
|
|
48
|
-
field:
|
|
49
|
-
direction:
|
|
45
|
+
field: SORT_FIELDS.DATE,
|
|
46
|
+
direction: SORT_DIRECTION.DESC,
|
|
50
47
|
},
|
|
51
48
|
};
|
|
52
49
|
// Blueberry compatibility exports
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
export const SORT_DIRECTION_ASC = SORT_DIRECTION.ASC;
|
|
51
|
+
export const SORT_DIRECTION_DESC = SORT_DIRECTION.DESC;
|
package/dist/utilities/time.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Time-related constants
|
|
4
3
|
*/
|
|
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;
|
|
7
4
|
// Time conversions in milliseconds
|
|
8
|
-
|
|
5
|
+
export const MILLISECONDS = {
|
|
9
6
|
SECOND: 1000,
|
|
10
7
|
MINUTE: 60 * 1000,
|
|
11
8
|
HOUR: 60 * 60 * 1000,
|
|
@@ -13,14 +10,14 @@ exports.MILLISECONDS = {
|
|
|
13
10
|
WEEK: 7 * 24 * 60 * 60 * 1000,
|
|
14
11
|
};
|
|
15
12
|
// Time conversions in seconds
|
|
16
|
-
|
|
13
|
+
export const SECONDS = {
|
|
17
14
|
MINUTE: 60,
|
|
18
15
|
HOUR: 60 * 60,
|
|
19
16
|
DAY: 24 * 60 * 60,
|
|
20
17
|
WEEK: 7 * 24 * 60 * 60,
|
|
21
18
|
};
|
|
22
19
|
// Common date formats
|
|
23
|
-
|
|
20
|
+
export const DATE_FORMATS = {
|
|
24
21
|
// Display formats
|
|
25
22
|
DISPLAY_DATE: 'MMM dd, yyyy',
|
|
26
23
|
DISPLAY_DATE_TIME: 'MMM dd, yyyy HH:mm',
|
|
@@ -37,7 +34,7 @@ exports.DATE_FORMATS = {
|
|
|
37
34
|
TIME_WITH_SECONDS: 'HH:mm:ss',
|
|
38
35
|
};
|
|
39
36
|
// Time zones
|
|
40
|
-
|
|
37
|
+
export const TIME_ZONES = {
|
|
41
38
|
UTC: 'UTC',
|
|
42
39
|
EST: 'America/New_York',
|
|
43
40
|
PST: 'America/Los_Angeles',
|
|
@@ -45,19 +42,19 @@ exports.TIME_ZONES = {
|
|
|
45
42
|
MELBOURNE: 'Australia/Melbourne',
|
|
46
43
|
};
|
|
47
44
|
// Session durations
|
|
48
|
-
|
|
45
|
+
export const SESSION_DURATIONS = {
|
|
49
46
|
DEFAULT: 30 * 60 * 1000, // 30 minutes
|
|
50
47
|
EXTENDED: 24 * 60 * 60 * 1000, // 24 hours
|
|
51
48
|
REMEMBER_ME: 30 * 24 * 60 * 60 * 1000, // 30 days
|
|
52
49
|
};
|
|
53
50
|
// Time unit constants (matching Blueberry)
|
|
54
|
-
|
|
51
|
+
export const MILLISECONDS_PER_DAY = 24 * 60 * 60 * 1000;
|
|
55
52
|
// Default time periods
|
|
56
|
-
|
|
53
|
+
export const DEFAULT_RECENT_TRANSACTIONS_DAYS = 30;
|
|
57
54
|
// Date format patterns
|
|
58
|
-
|
|
55
|
+
export const DATE_ISO_TIME_SEPARATOR = 'T';
|
|
59
56
|
// Time range configurations with labels and day counts
|
|
60
|
-
|
|
57
|
+
export const TIME_RANGES = [
|
|
61
58
|
{ label: '1W', value: '1W', days: 7 },
|
|
62
59
|
{ label: '1M', value: '1M', days: 30 },
|
|
63
60
|
{ label: '6M', value: '6M', days: 180 },
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Validation-related constants
|
|
4
3
|
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.VALIDATION_ERRORS = exports.VALIDATION_RULES = exports.REGEX_PATTERNS = void 0;
|
|
7
4
|
// Regular expression patterns
|
|
8
|
-
|
|
5
|
+
export const REGEX_PATTERNS = {
|
|
9
6
|
EMAIL: /^[^\s@]+@[^\s@]+\.[^\s@]+$/,
|
|
10
7
|
PHONE: /^\+?[\d\s-()]+$/,
|
|
11
8
|
USERNAME: /^[a-zA-Z0-9_-]{3,30}$/,
|
|
@@ -18,7 +15,7 @@ exports.REGEX_PATTERNS = {
|
|
|
18
15
|
URL: /^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)$/,
|
|
19
16
|
};
|
|
20
17
|
// Validation rules
|
|
21
|
-
|
|
18
|
+
export const VALIDATION_RULES = {
|
|
22
19
|
// User-related
|
|
23
20
|
MIN_USERNAME_LENGTH: 3,
|
|
24
21
|
MAX_USERNAME_LENGTH: 30,
|
|
@@ -53,7 +50,7 @@ exports.VALIDATION_RULES = {
|
|
|
53
50
|
MAX_POSTAL_CODE_LENGTH: 10,
|
|
54
51
|
};
|
|
55
52
|
// Error messages
|
|
56
|
-
|
|
53
|
+
export const VALIDATION_ERRORS = {
|
|
57
54
|
REQUIRED: 'This field is required',
|
|
58
55
|
INVALID_EMAIL: 'Please enter a valid email address',
|
|
59
56
|
INVALID_PHONE: 'Please enter a valid phone number',
|