@cranberry-money/shared-constants 3.0.2 → 4.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.
- package/README.md +103 -72
- package/package.json +5 -3
- package/dist/accounts.d.ts +0 -100
- package/dist/accounts.d.ts.map +0 -1
- package/dist/accounts.js +0 -99
- package/dist/allocation.d.ts +0 -15
- package/dist/allocation.d.ts.map +0 -1
- package/dist/allocation.js +0 -17
- package/dist/common.d.ts +0 -31
- package/dist/common.d.ts.map +0 -1
- package/dist/common.js +0 -35
- package/dist/currencies.d.ts +0 -38
- package/dist/currencies.d.ts.map +0 -1
- package/dist/currencies.js +0 -37
- package/dist/currency.d.ts +0 -51
- package/dist/currency.d.ts.map +0 -1
- package/dist/currency.js +0 -55
- package/dist/http.d.ts +0 -8
- package/dist/http.d.ts.map +0 -1
- package/dist/http.js +0 -9
- package/dist/index.d.ts +0 -17
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -18
- package/dist/jobs.d.ts +0 -19
- package/dist/jobs.d.ts.map +0 -1
- package/dist/jobs.js +0 -18
- package/dist/portfolios.d.ts +0 -17
- package/dist/portfolios.d.ts.map +0 -1
- package/dist/portfolios.js +0 -16
- package/dist/time.d.ts +0 -17
- package/dist/time.d.ts.map +0 -1
- package/dist/time.js +0 -22
- package/dist/trades.d.ts +0 -34
- package/dist/trades.d.ts.map +0 -1
- package/dist/trades.js +0 -34
- package/dist/transactions.d.ts +0 -145
- package/dist/transactions.d.ts.map +0 -1
- package/dist/transactions.js +0 -154
- package/dist/ui/colors.d.ts +0 -47
- package/dist/ui/colors.d.ts.map +0 -1
- package/dist/ui/colors.js +0 -59
- package/dist/ui/index.d.ts +0 -6
- package/dist/ui/index.d.ts.map +0 -1
- package/dist/ui/index.js +0 -5
- package/dist/ui/status.d.ts +0 -41
- package/dist/ui/status.d.ts.map +0 -1
- package/dist/ui/status.js +0 -53
- package/dist/validation.d.ts +0 -53
- package/dist/validation.d.ts.map +0 -1
- package/dist/validation.js +0 -60
- package/dist/withdrawals.d.ts +0 -8
- package/dist/withdrawals.d.ts.map +0 -1
- package/dist/withdrawals.js +0 -8
package/README.md
CHANGED
|
@@ -1,101 +1,132 @@
|
|
|
1
|
-
# @
|
|
1
|
+
# @cranberry-money/shared-constants
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Part of the Cranberry monorepo, this package contains all shared constants for the MyPortfolio platform.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install @
|
|
8
|
+
npm install @cranberry-money/shared-constants
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
|
+
Constants are organized by category:
|
|
14
|
+
|
|
13
15
|
```typescript
|
|
14
16
|
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
WITHDRAWAL_STATUS,
|
|
18
|
+
CURRENCY_CODES,
|
|
19
|
+
HTTP_STATUS,
|
|
20
|
+
CHART_COLORS
|
|
21
|
+
} from '@cranberry-money/shared-constants';
|
|
22
|
+
|
|
23
|
+
// Use status constants
|
|
24
|
+
if (status === WITHDRAWAL_STATUS.APPROVED) {
|
|
25
|
+
// Handle approved withdrawal
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Use currency constants
|
|
29
|
+
const symbol = CURRENCY_SYMBOLS[CURRENCY_CODES.AUD]; // '$'
|
|
30
|
+
|
|
31
|
+
// Use chart colors
|
|
32
|
+
const color = getChartColor(0); // Returns first color in palette
|
|
33
|
+
```
|
|
21
34
|
|
|
22
|
-
|
|
23
|
-
|
|
35
|
+
## Available Categories
|
|
36
|
+
|
|
37
|
+
### API Constants (`/api`)
|
|
38
|
+
- **Endpoints**: All API endpoint definitions with factory functions
|
|
39
|
+
- `PORTFOLIO_ENDPOINTS`, `TRADE_ENDPOINTS`, etc.
|
|
40
|
+
- Factory functions: `PORTFOLIO_ENDPOINTS.DETAIL(uuid)`
|
|
41
|
+
- **HTTP**: Status codes, headers, content types, methods
|
|
42
|
+
- `HTTP_STATUS`, `HTTP_HEADERS`, `CONTENT_TYPES`
|
|
43
|
+
- **Config**: Timeouts, retries, error codes
|
|
44
|
+
- `API_CONFIG`, `API_ERROR_CODES`
|
|
45
|
+
|
|
46
|
+
### Business Constants (`/business`)
|
|
47
|
+
- **Status**: All domain status values
|
|
48
|
+
- `WITHDRAWAL_STATUS`, `TRADE_STATUS`, `DOCUMENT_STATUS`, etc.
|
|
49
|
+
- Includes corresponding label mappings
|
|
50
|
+
- **Accounts**: Account types, source of funds
|
|
51
|
+
- `ACCOUNT_TYPE`, `SOURCE_OF_FUNDS`
|
|
52
|
+
- **Documents**: Document types, categories, formats
|
|
53
|
+
- `DOCUMENT_TYPE`, `DOCUMENT_CATEGORY`
|
|
54
|
+
- **Investments**: Risk tolerance, horizons, experience levels
|
|
55
|
+
- `RISK_TOLERANCE`, `INVESTMENT_HORIZON`, `INVESTMENT_EXPERIENCE`
|
|
56
|
+
- **Banking**: Bank types, institutions, verification methods
|
|
57
|
+
- `BANK_ACCOUNT_TYPE`, `BANKING_INSTITUTION`
|
|
58
|
+
- **Trading**: Execution venues, settlement cycles, fees
|
|
59
|
+
- `EXECUTION_VENUE`, `TRADE_FEE_TYPE`
|
|
60
|
+
|
|
61
|
+
### Financial Constants (`/financial`)
|
|
62
|
+
- **Currency**: ISO codes, symbols, decimal places
|
|
63
|
+
- `CURRENCY_CODES`, `CURRENCY_SYMBOLS`, `CURRENCY_NAMES`
|
|
64
|
+
- **Instruments**: Asset types, classes, market identifiers
|
|
65
|
+
- `INSTRUMENT_TYPE`, `ASSET_CLASS`, `MARKET_IDENTIFIER`
|
|
66
|
+
- **Formatting**: Number formats, locales, thresholds
|
|
67
|
+
- `NUMBER_FORMATS`, `FORMATTING_OPTIONS`
|
|
68
|
+
|
|
69
|
+
### UI Constants (`/ui`)
|
|
70
|
+
- **Colors**: Chart palettes, status colors, semantic colors
|
|
71
|
+
- `CHART_COLORS`, `STATUS_COLORS`, `PERFORMANCE_COLORS`
|
|
72
|
+
- **Display**: Loading states, view types, date ranges
|
|
73
|
+
- `LOADING_STATES`, `DISPLAY_MODE`, `DATE_RANGE_PRESET`
|
|
74
|
+
- **Labels**: All human-readable labels (re-exported from business)
|
|
75
|
+
- All `*_LABELS` constants from business domains
|
|
76
|
+
|
|
77
|
+
### Utility Constants (`/utilities`)
|
|
78
|
+
- **Time**: Milliseconds conversions, date formats, time zones
|
|
79
|
+
- `MILLISECONDS`, `DATE_FORMATS`, `TIME_ZONES`
|
|
80
|
+
- **Defaults**: Default values, pagination, thresholds
|
|
81
|
+
- `DEFAULT_VALUES`, `PAGINATION_DEFAULTS`, `THRESHOLDS`
|
|
82
|
+
- **Sorting**: Sort directions and fields
|
|
83
|
+
- `SORT_DIRECTION`, `SORT_FIELDS`
|
|
84
|
+
- **Validation**: Regex patterns, validation rules, error messages
|
|
85
|
+
- `REGEX_PATTERNS`, `VALIDATION_RULES`, `VALIDATION_ERRORS`
|
|
86
|
+
|
|
87
|
+
## Type Safety
|
|
88
|
+
|
|
89
|
+
All constants use TypeScript's `as const` assertion for type safety and include corresponding type exports:
|
|
24
90
|
|
|
25
|
-
|
|
26
|
-
const
|
|
91
|
+
```typescript
|
|
92
|
+
export const TRADE_STATUS = {
|
|
93
|
+
PENDING: 'PENDING',
|
|
94
|
+
EXECUTED: 'EXECUTED',
|
|
95
|
+
// ...
|
|
96
|
+
} as const;
|
|
27
97
|
|
|
28
|
-
|
|
29
|
-
const availableRanges = TIME_RANGES; // [{ label: '1W', value: '1W', days: 7 }, ...]
|
|
98
|
+
export type TradeStatus = typeof TRADE_STATUS[keyof typeof TRADE_STATUS];
|
|
30
99
|
```
|
|
31
100
|
|
|
32
|
-
##
|
|
101
|
+
## Form Options
|
|
33
102
|
|
|
34
|
-
|
|
35
|
-
- Number formatting: `DECIMAL_PLACES`, quantity thresholds
|
|
36
|
-
- Error types: `ERROR_TYPE_BUSINESS_LOGIC`, `ERROR_TYPE_PERMISSION`, etc.
|
|
37
|
-
- Sort directions: `SORT_DIRECTION_ASC`, `SORT_DIRECTION_DESC`
|
|
38
|
-
- Locale settings: `LOCALE_AUSTRALIA`
|
|
103
|
+
Many constants include pre-built options arrays for form dropdowns:
|
|
39
104
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
- Default currency: `DEFAULT_CURRENCY`
|
|
43
|
-
- Currency info: `CURRENCIES` array with symbols and names
|
|
44
|
-
- Helper: `getCurrencyInfo(code)` function
|
|
105
|
+
```typescript
|
|
106
|
+
import { RISK_TOLERANCE_OPTIONS } from '@cranberry-money/shared-constants';
|
|
45
107
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
108
|
+
// Use directly in select/dropdown components
|
|
109
|
+
<Select options={RISK_TOLERANCE_OPTIONS} />
|
|
110
|
+
```
|
|
49
111
|
|
|
50
|
-
|
|
51
|
-
- Time calculations: `MILLISECONDS_PER_DAY`
|
|
52
|
-
- Default periods: `DEFAULT_RECENT_TRANSACTIONS_DAYS`
|
|
53
|
-
- Time ranges: `TIME_RANGES` array with configurations
|
|
54
|
-
- Types: `TimeRange`, `TimeRangeConfig`
|
|
112
|
+
## Synchronization with Backend
|
|
55
113
|
|
|
56
|
-
|
|
57
|
-
- Chart color palette: `CHART_COLORS` array
|
|
58
|
-
- Dynamic color selection: `getChartColor(index)` function
|
|
114
|
+
Many constants are synchronized with the backend (bilberry). Comments indicate which constants must match backend values:
|
|
59
115
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
116
|
+
```typescript
|
|
117
|
+
/**
|
|
118
|
+
* Trade status constants
|
|
119
|
+
* These constants should match the backend constants in bilberry/trades/constants.py
|
|
120
|
+
*/
|
|
121
|
+
```
|
|
64
122
|
|
|
65
123
|
## Platform Compatibility
|
|
66
124
|
|
|
67
125
|
This package is designed to work across:
|
|
68
|
-
- Web applications (React)
|
|
69
|
-
- Mobile applications (React Native)
|
|
70
|
-
- Node.js environments
|
|
71
|
-
|
|
72
|
-
### Platform-Specific Adaptations
|
|
73
|
-
|
|
74
|
-
#### Web (Tailwind CSS)
|
|
75
|
-
```typescript
|
|
76
|
-
import { STATUS_COLORS } from '@myportfolio/shared-constants';
|
|
77
|
-
|
|
78
|
-
// Adapt hex colors to Tailwind classes
|
|
79
|
-
const statusClasses = {
|
|
80
|
-
pending: 'text-warning-600',
|
|
81
|
-
success: 'text-success-600',
|
|
82
|
-
// ... map STATUS_COLORS to your design system
|
|
83
|
-
};
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
#### Mobile (React Native)
|
|
87
|
-
```typescript
|
|
88
|
-
import { STATUS_COLORS, CHART_COLORS } from '@myportfolio/shared-constants';
|
|
89
|
-
|
|
90
|
-
const styles = StyleSheet.create({
|
|
91
|
-
pendingStatus: {
|
|
92
|
-
color: STATUS_COLORS.pending, // Direct hex usage
|
|
93
|
-
},
|
|
94
|
-
chartData: {
|
|
95
|
-
backgroundColor: CHART_COLORS[0], // Direct hex usage
|
|
96
|
-
},
|
|
97
|
-
});
|
|
98
|
-
```
|
|
126
|
+
- Web applications (React/Vue/Angular)
|
|
127
|
+
- Mobile applications (React Native)
|
|
128
|
+
- Node.js environments
|
|
129
|
+
- TypeScript and JavaScript projects
|
|
99
130
|
|
|
100
131
|
## Development
|
|
101
132
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cranberry-money/shared-constants",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "Shared constants for MyPortfolio platform",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -18,7 +18,9 @@
|
|
|
18
18
|
"build": "tsc",
|
|
19
19
|
"clean": "rm -rf dist",
|
|
20
20
|
"typecheck": "tsc --noEmit",
|
|
21
|
-
"dev": "tsc --watch"
|
|
21
|
+
"dev": "tsc --watch",
|
|
22
|
+
"validate": "npm run build && node scripts/validate.js",
|
|
23
|
+
"prepublishOnly": "npm run clean && npm run build"
|
|
22
24
|
},
|
|
23
25
|
"devDependencies": {
|
|
24
26
|
"typescript": "^5.0.0"
|
|
@@ -43,4 +45,4 @@
|
|
|
43
45
|
"url": "git+https://github.com/your-org/cranberry.git",
|
|
44
46
|
"directory": "packages/shared-constants"
|
|
45
47
|
}
|
|
46
|
-
}
|
|
48
|
+
}
|
package/dist/accounts.d.ts
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Account-related constants sourced from backend Django constants
|
|
3
|
-
*
|
|
4
|
-
* Backend source: bilberry/accounts/constants.py
|
|
5
|
-
*/
|
|
6
|
-
export declare const ACCOUNT_TYPE: {
|
|
7
|
-
readonly INDIVIDUAL: "individual";
|
|
8
|
-
readonly JOINT: "joint";
|
|
9
|
-
};
|
|
10
|
-
export declare const ACCOUNT_TYPE_LABELS: {
|
|
11
|
-
readonly individual: "Individual";
|
|
12
|
-
readonly joint: "Joint";
|
|
13
|
-
};
|
|
14
|
-
export type AccountType = typeof ACCOUNT_TYPE[keyof typeof ACCOUNT_TYPE];
|
|
15
|
-
export declare const BANK_ACCOUNT_TYPE: {
|
|
16
|
-
readonly SAVINGS: "savings";
|
|
17
|
-
readonly CHECKING: "checking";
|
|
18
|
-
readonly TRANSACTION: "transaction";
|
|
19
|
-
readonly TERM_DEPOSIT: "term_deposit";
|
|
20
|
-
readonly OFFSET: "offset";
|
|
21
|
-
};
|
|
22
|
-
export declare const BANK_ACCOUNT_TYPE_LABELS: {
|
|
23
|
-
readonly savings: "Savings Account";
|
|
24
|
-
readonly checking: "Checking Account";
|
|
25
|
-
readonly transaction: "Transaction Account";
|
|
26
|
-
readonly term_deposit: "Term Deposit";
|
|
27
|
-
readonly offset: "Offset Account";
|
|
28
|
-
};
|
|
29
|
-
export type BankAccountType = typeof BANK_ACCOUNT_TYPE[keyof typeof BANK_ACCOUNT_TYPE];
|
|
30
|
-
export declare const INVESTMENT_HORIZON: {
|
|
31
|
-
readonly SHORT: "short";
|
|
32
|
-
readonly MEDIUM: "medium";
|
|
33
|
-
readonly LONG: "long";
|
|
34
|
-
};
|
|
35
|
-
export declare const INVESTMENT_HORIZON_LABELS: {
|
|
36
|
-
readonly short: "Short-term (0–3 yrs)";
|
|
37
|
-
readonly medium: "Medium-term (3–7 yrs)";
|
|
38
|
-
readonly long: "Long-term (7+ yrs)";
|
|
39
|
-
};
|
|
40
|
-
export type InvestmentHorizon = typeof INVESTMENT_HORIZON[keyof typeof INVESTMENT_HORIZON];
|
|
41
|
-
export declare const RISK_TOLERANCE: {
|
|
42
|
-
readonly LOW: "low";
|
|
43
|
-
readonly MEDIUM: "medium";
|
|
44
|
-
readonly HIGH: "high";
|
|
45
|
-
};
|
|
46
|
-
export declare const RISK_TOLERANCE_LABELS: {
|
|
47
|
-
readonly low: "Low";
|
|
48
|
-
readonly medium: "Medium";
|
|
49
|
-
readonly high: "High";
|
|
50
|
-
};
|
|
51
|
-
export type RiskTolerance = typeof RISK_TOLERANCE[keyof typeof RISK_TOLERANCE];
|
|
52
|
-
export declare const INVESTMENT_EXPERIENCE: {
|
|
53
|
-
readonly NONE: "none";
|
|
54
|
-
readonly SOME: "some";
|
|
55
|
-
readonly EXTENSIVE: "extensive";
|
|
56
|
-
};
|
|
57
|
-
export declare const INVESTMENT_EXPERIENCE_LABELS: {
|
|
58
|
-
readonly none: "No experience";
|
|
59
|
-
readonly some: "Some experience";
|
|
60
|
-
readonly extensive: "Extensive";
|
|
61
|
-
};
|
|
62
|
-
export type InvestmentExperience = typeof INVESTMENT_EXPERIENCE[keyof typeof INVESTMENT_EXPERIENCE];
|
|
63
|
-
export declare const SOURCE_OF_FUNDS: {
|
|
64
|
-
readonly SALARY: "salary";
|
|
65
|
-
readonly SAVINGS: "savings";
|
|
66
|
-
readonly INHERITANCE: "inheritance";
|
|
67
|
-
readonly GIFT: "gift";
|
|
68
|
-
readonly OTHER: "other";
|
|
69
|
-
};
|
|
70
|
-
export declare const SOURCE_OF_FUNDS_LABELS: {
|
|
71
|
-
readonly salary: "Salary";
|
|
72
|
-
readonly savings: "Savings";
|
|
73
|
-
readonly inheritance: "Inheritance";
|
|
74
|
-
readonly gift: "Gift";
|
|
75
|
-
readonly other: "Other";
|
|
76
|
-
};
|
|
77
|
-
export type SourceOfFunds = typeof SOURCE_OF_FUNDS[keyof typeof SOURCE_OF_FUNDS];
|
|
78
|
-
export declare const PERSONAL_DOCUMENT_TYPE: {
|
|
79
|
-
readonly PASSPORT: "passport";
|
|
80
|
-
readonly DRIVERS_LICENSE: "drivers_license";
|
|
81
|
-
readonly MEDICARE: "medicare";
|
|
82
|
-
};
|
|
83
|
-
export declare const PERSONAL_DOCUMENT_TYPE_LABELS: {
|
|
84
|
-
readonly passport: "Passport";
|
|
85
|
-
readonly drivers_license: "Driver's License";
|
|
86
|
-
readonly medicare: "Medicare";
|
|
87
|
-
};
|
|
88
|
-
export type PersonalDocumentType = typeof PERSONAL_DOCUMENT_TYPE[keyof typeof PERSONAL_DOCUMENT_TYPE];
|
|
89
|
-
export declare const ACCOUNT_DOCUMENT_TYPE: {
|
|
90
|
-
readonly MDA: "mda";
|
|
91
|
-
readonly SOA: "soa";
|
|
92
|
-
readonly AGREEMENT: "agreement";
|
|
93
|
-
};
|
|
94
|
-
export declare const ACCOUNT_DOCUMENT_TYPE_LABELS: {
|
|
95
|
-
readonly mda: "Managed Discretionary Account";
|
|
96
|
-
readonly soa: "Statement of Advice";
|
|
97
|
-
readonly agreement: "Client Agreement";
|
|
98
|
-
};
|
|
99
|
-
export type AccountDocumentType = typeof ACCOUNT_DOCUMENT_TYPE[keyof typeof ACCOUNT_DOCUMENT_TYPE];
|
|
100
|
-
//# sourceMappingURL=accounts.d.ts.map
|
package/dist/accounts.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../src/accounts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,eAAO,MAAM,YAAY;;;CAGf,CAAC;AAEX,eAAO,MAAM,mBAAmB;;;CAGtB,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,OAAO,YAAY,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAGzE,eAAO,MAAM,iBAAiB;;;;;;CAMpB,CAAC;AAEX,eAAO,MAAM,wBAAwB;;;;;;CAM3B,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,OAAO,iBAAiB,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAC;AAGvF,eAAO,MAAM,kBAAkB;;;;CAIrB,CAAC;AAEX,eAAO,MAAM,yBAAyB;;;;CAI5B,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,OAAO,kBAAkB,CAAC,MAAM,OAAO,kBAAkB,CAAC,CAAC;AAG3F,eAAO,MAAM,cAAc;;;;CAIjB,CAAC;AAEX,eAAO,MAAM,qBAAqB;;;;CAIxB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,OAAO,cAAc,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;AAG/E,eAAO,MAAM,qBAAqB;;;;CAIxB,CAAC;AAEX,eAAO,MAAM,4BAA4B;;;;CAI/B,CAAC;AAEX,MAAM,MAAM,oBAAoB,GAAG,OAAO,qBAAqB,CAAC,MAAM,OAAO,qBAAqB,CAAC,CAAC;AAGpG,eAAO,MAAM,eAAe;;;;;;CAMlB,CAAC;AAEX,eAAO,MAAM,sBAAsB;;;;;;CAMzB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,OAAO,eAAe,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;AAGjF,eAAO,MAAM,sBAAsB;;;;CAIzB,CAAC;AAEX,eAAO,MAAM,6BAA6B;;;;CAIhC,CAAC;AAEX,MAAM,MAAM,oBAAoB,GAAG,OAAO,sBAAsB,CAAC,MAAM,OAAO,sBAAsB,CAAC,CAAC;AAGtG,eAAO,MAAM,qBAAqB;;;;CAIxB,CAAC;AAEX,eAAO,MAAM,4BAA4B;;;;CAI/B,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAAG,OAAO,qBAAqB,CAAC,MAAM,OAAO,qBAAqB,CAAC,CAAC"}
|
package/dist/accounts.js
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Account-related constants sourced from backend Django constants
|
|
3
|
-
*
|
|
4
|
-
* Backend source: bilberry/accounts/constants.py
|
|
5
|
-
*/
|
|
6
|
-
// ===== ACCOUNT TYPES =====
|
|
7
|
-
export const ACCOUNT_TYPE = {
|
|
8
|
-
INDIVIDUAL: 'individual',
|
|
9
|
-
JOINT: 'joint',
|
|
10
|
-
};
|
|
11
|
-
export const ACCOUNT_TYPE_LABELS = {
|
|
12
|
-
individual: 'Individual',
|
|
13
|
-
joint: 'Joint',
|
|
14
|
-
};
|
|
15
|
-
// ===== BANK ACCOUNT TYPES =====
|
|
16
|
-
export const BANK_ACCOUNT_TYPE = {
|
|
17
|
-
SAVINGS: 'savings',
|
|
18
|
-
CHECKING: 'checking',
|
|
19
|
-
TRANSACTION: 'transaction',
|
|
20
|
-
TERM_DEPOSIT: 'term_deposit',
|
|
21
|
-
OFFSET: 'offset',
|
|
22
|
-
};
|
|
23
|
-
export const BANK_ACCOUNT_TYPE_LABELS = {
|
|
24
|
-
savings: 'Savings Account',
|
|
25
|
-
checking: 'Checking Account',
|
|
26
|
-
transaction: 'Transaction Account',
|
|
27
|
-
term_deposit: 'Term Deposit',
|
|
28
|
-
offset: 'Offset Account',
|
|
29
|
-
};
|
|
30
|
-
// ===== INVESTMENT HORIZONS =====
|
|
31
|
-
export const INVESTMENT_HORIZON = {
|
|
32
|
-
SHORT: 'short',
|
|
33
|
-
MEDIUM: 'medium',
|
|
34
|
-
LONG: 'long',
|
|
35
|
-
};
|
|
36
|
-
export const INVESTMENT_HORIZON_LABELS = {
|
|
37
|
-
short: 'Short-term (0–3 yrs)',
|
|
38
|
-
medium: 'Medium-term (3–7 yrs)',
|
|
39
|
-
long: 'Long-term (7+ yrs)',
|
|
40
|
-
};
|
|
41
|
-
// ===== RISK TOLERANCE =====
|
|
42
|
-
export const RISK_TOLERANCE = {
|
|
43
|
-
LOW: 'low',
|
|
44
|
-
MEDIUM: 'medium',
|
|
45
|
-
HIGH: 'high',
|
|
46
|
-
};
|
|
47
|
-
export const RISK_TOLERANCE_LABELS = {
|
|
48
|
-
low: 'Low',
|
|
49
|
-
medium: 'Medium',
|
|
50
|
-
high: 'High',
|
|
51
|
-
};
|
|
52
|
-
// ===== INVESTMENT EXPERIENCE =====
|
|
53
|
-
export const INVESTMENT_EXPERIENCE = {
|
|
54
|
-
NONE: 'none',
|
|
55
|
-
SOME: 'some',
|
|
56
|
-
EXTENSIVE: 'extensive',
|
|
57
|
-
};
|
|
58
|
-
export const INVESTMENT_EXPERIENCE_LABELS = {
|
|
59
|
-
none: 'No experience',
|
|
60
|
-
some: 'Some experience',
|
|
61
|
-
extensive: 'Extensive',
|
|
62
|
-
};
|
|
63
|
-
// ===== SOURCE OF FUNDS =====
|
|
64
|
-
export const SOURCE_OF_FUNDS = {
|
|
65
|
-
SALARY: 'salary',
|
|
66
|
-
SAVINGS: 'savings',
|
|
67
|
-
INHERITANCE: 'inheritance',
|
|
68
|
-
GIFT: 'gift',
|
|
69
|
-
OTHER: 'other',
|
|
70
|
-
};
|
|
71
|
-
export const SOURCE_OF_FUNDS_LABELS = {
|
|
72
|
-
salary: 'Salary',
|
|
73
|
-
savings: 'Savings',
|
|
74
|
-
inheritance: 'Inheritance',
|
|
75
|
-
gift: 'Gift',
|
|
76
|
-
other: 'Other',
|
|
77
|
-
};
|
|
78
|
-
// ===== PERSONAL DOCUMENT TYPES =====
|
|
79
|
-
export const PERSONAL_DOCUMENT_TYPE = {
|
|
80
|
-
PASSPORT: 'passport',
|
|
81
|
-
DRIVERS_LICENSE: 'drivers_license',
|
|
82
|
-
MEDICARE: 'medicare',
|
|
83
|
-
};
|
|
84
|
-
export const PERSONAL_DOCUMENT_TYPE_LABELS = {
|
|
85
|
-
passport: 'Passport',
|
|
86
|
-
drivers_license: 'Driver\'s License',
|
|
87
|
-
medicare: 'Medicare',
|
|
88
|
-
};
|
|
89
|
-
// ===== ACCOUNT DOCUMENT TYPES =====
|
|
90
|
-
export const ACCOUNT_DOCUMENT_TYPE = {
|
|
91
|
-
MDA: 'mda',
|
|
92
|
-
SOA: 'soa',
|
|
93
|
-
AGREEMENT: 'agreement',
|
|
94
|
-
};
|
|
95
|
-
export const ACCOUNT_DOCUMENT_TYPE_LABELS = {
|
|
96
|
-
mda: 'Managed Discretionary Account',
|
|
97
|
-
soa: 'Statement of Advice',
|
|
98
|
-
agreement: 'Client Agreement',
|
|
99
|
-
};
|
package/dist/allocation.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Asset allocation-related constants for the MyPortfolio platform.
|
|
3
|
-
*
|
|
4
|
-
* These constants define rules and defaults used in portfolio asset allocation
|
|
5
|
-
* across web and mobile applications.
|
|
6
|
-
*/
|
|
7
|
-
export declare const DEFAULT_ALLOCATION_PERCENTAGE = 10;
|
|
8
|
-
export declare const PERCENTAGE_PRECISION = 0.01;
|
|
9
|
-
export declare const TARGET_ALLOCATION_TOTAL = 100;
|
|
10
|
-
export declare const MIN_ALLOCATION_PERCENTAGE = 0.01;
|
|
11
|
-
export declare const MAX_ALLOCATION_PERCENTAGE = 100;
|
|
12
|
-
export declare const MAX_ALLOCATIONS_PER_PORTFOLIO = 20;
|
|
13
|
-
export declare const ALLOCATION_STEP_PERCENTAGE = 1;
|
|
14
|
-
export declare const ALLOCATION_QUICK_STEPS: readonly [5, 10, 15, 20, 25];
|
|
15
|
-
//# sourceMappingURL=allocation.d.ts.map
|
package/dist/allocation.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"allocation.d.ts","sourceRoot":"","sources":["../src/allocation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,eAAO,MAAM,6BAA6B,KAAK,CAAC;AAChD,eAAO,MAAM,oBAAoB,OAAO,CAAC;AACzC,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAG3C,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAC9C,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAC7C,eAAO,MAAM,6BAA6B,KAAK,CAAC;AAGhD,eAAO,MAAM,0BAA0B,IAAI,CAAC;AAC5C,eAAO,MAAM,sBAAsB,8BAA+B,CAAC"}
|
package/dist/allocation.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Asset allocation-related constants for the MyPortfolio platform.
|
|
3
|
-
*
|
|
4
|
-
* These constants define rules and defaults used in portfolio asset allocation
|
|
5
|
-
* across web and mobile applications.
|
|
6
|
-
*/
|
|
7
|
-
// Asset allocation defaults
|
|
8
|
-
export const DEFAULT_ALLOCATION_PERCENTAGE = 10;
|
|
9
|
-
export const PERCENTAGE_PRECISION = 0.01;
|
|
10
|
-
export const TARGET_ALLOCATION_TOTAL = 100;
|
|
11
|
-
// Allocation limits
|
|
12
|
-
export const MIN_ALLOCATION_PERCENTAGE = 0.01;
|
|
13
|
-
export const MAX_ALLOCATION_PERCENTAGE = 100;
|
|
14
|
-
export const MAX_ALLOCATIONS_PER_PORTFOLIO = 20;
|
|
15
|
-
// Allocation adjustment
|
|
16
|
-
export const ALLOCATION_STEP_PERCENTAGE = 1;
|
|
17
|
-
export const ALLOCATION_QUICK_STEPS = [5, 10, 15, 20, 25];
|
package/dist/common.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Common shared constants for the MyPortfolio platform.
|
|
3
|
-
*
|
|
4
|
-
* Contains truly universal constants that don't fit into specific domains.
|
|
5
|
-
*/
|
|
6
|
-
export declare const DECIMAL_PLACES = 2;
|
|
7
|
-
export declare const DEFAULT_NUMERIC_ZERO = 0;
|
|
8
|
-
export declare const DEFAULT_EMPTY_STRING = "";
|
|
9
|
-
export declare const QUANTITY_FORMAT_THRESHOLD_MILLION = 1000000;
|
|
10
|
-
export declare const QUANTITY_FORMAT_THRESHOLD_THOUSAND = 1000;
|
|
11
|
-
export declare const ERROR_TYPE_BUSINESS_LOGIC = "business_logic";
|
|
12
|
-
export declare const ERROR_TYPE_PERMISSION = "permission";
|
|
13
|
-
export declare const ERROR_TYPE_SERVER = "server";
|
|
14
|
-
export declare const SORT_DIRECTION_ASC = "asc";
|
|
15
|
-
export declare const SORT_DIRECTION_DESC = "desc";
|
|
16
|
-
export type SortDirection = typeof SORT_DIRECTION_ASC | typeof SORT_DIRECTION_DESC;
|
|
17
|
-
export declare const LOCALE_AUSTRALIA = "en-AU";
|
|
18
|
-
export declare const NUMBER_FORMAT_OPTIONS_CURRENCY: {
|
|
19
|
-
readonly style: "currency";
|
|
20
|
-
readonly minimumFractionDigits: 2;
|
|
21
|
-
readonly maximumFractionDigits: 2;
|
|
22
|
-
};
|
|
23
|
-
export declare const NUMBER_FORMAT_OPTIONS_CURRENCY_SIGNED: {
|
|
24
|
-
readonly signDisplay: "always";
|
|
25
|
-
readonly style: "currency";
|
|
26
|
-
readonly minimumFractionDigits: 2;
|
|
27
|
-
readonly maximumFractionDigits: 2;
|
|
28
|
-
};
|
|
29
|
-
export declare const QUERY_PARAM_ORDER_BY = "order_by";
|
|
30
|
-
export declare const ORDER_BY_CREATED_AT = "created_at";
|
|
31
|
-
//# sourceMappingURL=common.d.ts.map
|
package/dist/common.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,eAAO,MAAM,cAAc,IAAI,CAAC;AAGhC,eAAO,MAAM,oBAAoB,IAAI,CAAC;AACtC,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAGvC,eAAO,MAAM,iCAAiC,UAAU,CAAC;AACzD,eAAO,MAAM,kCAAkC,OAAO,CAAC;AAGvD,eAAO,MAAM,yBAAyB,mBAAmB,CAAC;AAC1D,eAAO,MAAM,qBAAqB,eAAe,CAAC;AAClD,eAAO,MAAM,iBAAiB,WAAW,CAAC;AAG1C,eAAO,MAAM,kBAAkB,QAAQ,CAAC;AACxC,eAAO,MAAM,mBAAmB,SAAS,CAAC;AAE1C,MAAM,MAAM,aAAa,GAAG,OAAO,kBAAkB,GAAG,OAAO,mBAAmB,CAAC;AAGnF,eAAO,MAAM,gBAAgB,UAAU,CAAC;AAGxC,eAAO,MAAM,8BAA8B;;;;CAIjC,CAAC;AAEX,eAAO,MAAM,qCAAqC;;;;;CAGxC,CAAC;AAGX,eAAO,MAAM,oBAAoB,aAAa,CAAC;AAC/C,eAAO,MAAM,mBAAmB,eAAe,CAAC"}
|
package/dist/common.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Common shared constants for the MyPortfolio platform.
|
|
3
|
-
*
|
|
4
|
-
* Contains truly universal constants that don't fit into specific domains.
|
|
5
|
-
*/
|
|
6
|
-
// Number formatting
|
|
7
|
-
export const DECIMAL_PLACES = 2;
|
|
8
|
-
// Default numeric values
|
|
9
|
-
export const DEFAULT_NUMERIC_ZERO = 0;
|
|
10
|
-
export const DEFAULT_EMPTY_STRING = '';
|
|
11
|
-
// Quantity formatting thresholds
|
|
12
|
-
export const QUANTITY_FORMAT_THRESHOLD_MILLION = 1000000;
|
|
13
|
-
export const QUANTITY_FORMAT_THRESHOLD_THOUSAND = 1000;
|
|
14
|
-
// Error types
|
|
15
|
-
export const ERROR_TYPE_BUSINESS_LOGIC = 'business_logic';
|
|
16
|
-
export const ERROR_TYPE_PERMISSION = 'permission';
|
|
17
|
-
export const ERROR_TYPE_SERVER = 'server';
|
|
18
|
-
// Sort directions
|
|
19
|
-
export const SORT_DIRECTION_ASC = 'asc';
|
|
20
|
-
export const SORT_DIRECTION_DESC = 'desc';
|
|
21
|
-
// Locale and formatting constants
|
|
22
|
-
export const LOCALE_AUSTRALIA = 'en-AU';
|
|
23
|
-
// Number formatting options
|
|
24
|
-
export const NUMBER_FORMAT_OPTIONS_CURRENCY = {
|
|
25
|
-
style: 'currency',
|
|
26
|
-
minimumFractionDigits: DECIMAL_PLACES,
|
|
27
|
-
maximumFractionDigits: DECIMAL_PLACES,
|
|
28
|
-
};
|
|
29
|
-
export const NUMBER_FORMAT_OPTIONS_CURRENCY_SIGNED = {
|
|
30
|
-
...NUMBER_FORMAT_OPTIONS_CURRENCY,
|
|
31
|
-
signDisplay: 'always',
|
|
32
|
-
};
|
|
33
|
-
// Query parameter constants
|
|
34
|
-
export const QUERY_PARAM_ORDER_BY = 'order_by';
|
|
35
|
-
export const ORDER_BY_CREATED_AT = 'created_at';
|
package/dist/currencies.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Currency constants sourced from backend Django constants
|
|
3
|
-
*
|
|
4
|
-
* Backend source: bilberry/shared/constants.py
|
|
5
|
-
*/
|
|
6
|
-
export declare const CURRENCY: {
|
|
7
|
-
readonly AUD: "AUD";
|
|
8
|
-
readonly USD: "USD";
|
|
9
|
-
readonly EUR: "EUR";
|
|
10
|
-
readonly GBP: "GBP";
|
|
11
|
-
readonly CAD: "CAD";
|
|
12
|
-
readonly JPY: "JPY";
|
|
13
|
-
readonly NZD: "NZD";
|
|
14
|
-
readonly SGD: "SGD";
|
|
15
|
-
};
|
|
16
|
-
export declare const CURRENCY_LABELS: {
|
|
17
|
-
readonly AUD: "Australian Dollar";
|
|
18
|
-
readonly USD: "US Dollar";
|
|
19
|
-
readonly EUR: "Euro";
|
|
20
|
-
readonly GBP: "British Pound";
|
|
21
|
-
readonly CAD: "Canadian Dollar";
|
|
22
|
-
readonly JPY: "Japanese Yen";
|
|
23
|
-
readonly NZD: "New Zealand Dollar";
|
|
24
|
-
readonly SGD: "Singapore Dollar";
|
|
25
|
-
};
|
|
26
|
-
export declare const CURRENCY_SYMBOLS: {
|
|
27
|
-
readonly AUD: "A$";
|
|
28
|
-
readonly USD: "$";
|
|
29
|
-
readonly EUR: "€";
|
|
30
|
-
readonly GBP: "£";
|
|
31
|
-
readonly CAD: "C$";
|
|
32
|
-
readonly JPY: "¥";
|
|
33
|
-
readonly NZD: "NZ$";
|
|
34
|
-
readonly SGD: "S$";
|
|
35
|
-
};
|
|
36
|
-
export declare const DEFAULT_CURRENCY: "AUD";
|
|
37
|
-
export type Currency = typeof CURRENCY[keyof typeof CURRENCY];
|
|
38
|
-
//# sourceMappingURL=currencies.d.ts.map
|
package/dist/currencies.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"currencies.d.ts","sourceRoot":"","sources":["../src/currencies.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,eAAO,MAAM,QAAQ;;;;;;;;;CASX,CAAC;AAEX,eAAO,MAAM,eAAe;;;;;;;;;CASlB,CAAC;AAEX,eAAO,MAAM,gBAAgB;;;;;;;;;CASnB,CAAC;AAEX,eAAO,MAAM,gBAAgB,OAAe,CAAC;AAE7C,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAC,MAAM,OAAO,QAAQ,CAAC,CAAC"}
|
package/dist/currencies.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Currency constants sourced from backend Django constants
|
|
3
|
-
*
|
|
4
|
-
* Backend source: bilberry/shared/constants.py
|
|
5
|
-
*/
|
|
6
|
-
// ===== CURRENCY CODES (ISO 4217) =====
|
|
7
|
-
export const CURRENCY = {
|
|
8
|
-
AUD: 'AUD',
|
|
9
|
-
USD: 'USD',
|
|
10
|
-
EUR: 'EUR',
|
|
11
|
-
GBP: 'GBP',
|
|
12
|
-
CAD: 'CAD',
|
|
13
|
-
JPY: 'JPY',
|
|
14
|
-
NZD: 'NZD',
|
|
15
|
-
SGD: 'SGD',
|
|
16
|
-
};
|
|
17
|
-
export const CURRENCY_LABELS = {
|
|
18
|
-
AUD: 'Australian Dollar',
|
|
19
|
-
USD: 'US Dollar',
|
|
20
|
-
EUR: 'Euro',
|
|
21
|
-
GBP: 'British Pound',
|
|
22
|
-
CAD: 'Canadian Dollar',
|
|
23
|
-
JPY: 'Japanese Yen',
|
|
24
|
-
NZD: 'New Zealand Dollar',
|
|
25
|
-
SGD: 'Singapore Dollar',
|
|
26
|
-
};
|
|
27
|
-
export const CURRENCY_SYMBOLS = {
|
|
28
|
-
AUD: 'A$',
|
|
29
|
-
USD: '$',
|
|
30
|
-
EUR: '€',
|
|
31
|
-
GBP: '£',
|
|
32
|
-
CAD: 'C$',
|
|
33
|
-
JPY: '¥',
|
|
34
|
-
NZD: 'NZ$',
|
|
35
|
-
SGD: 'S$',
|
|
36
|
-
};
|
|
37
|
-
export const DEFAULT_CURRENCY = CURRENCY.AUD;
|
package/dist/currency.d.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Currency-related constants sourced from backend Django constants
|
|
3
|
-
*
|
|
4
|
-
* Backend source: bilberry/shared/constants.py
|
|
5
|
-
* These constants serve as the single source of truth for currencies.
|
|
6
|
-
*/
|
|
7
|
-
export declare const CURRENCY: {
|
|
8
|
-
readonly AUD: "AUD";
|
|
9
|
-
readonly USD: "USD";
|
|
10
|
-
readonly EUR: "EUR";
|
|
11
|
-
readonly GBP: "GBP";
|
|
12
|
-
readonly CAD: "CAD";
|
|
13
|
-
readonly JPY: "JPY";
|
|
14
|
-
readonly NZD: "NZD";
|
|
15
|
-
readonly SGD: "SGD";
|
|
16
|
-
};
|
|
17
|
-
export declare const CURRENCY_LABELS: {
|
|
18
|
-
readonly AUD: "Australian Dollar";
|
|
19
|
-
readonly USD: "US Dollar";
|
|
20
|
-
readonly EUR: "Euro";
|
|
21
|
-
readonly GBP: "British Pound";
|
|
22
|
-
readonly CAD: "Canadian Dollar";
|
|
23
|
-
readonly JPY: "Japanese Yen";
|
|
24
|
-
readonly NZD: "New Zealand Dollar";
|
|
25
|
-
readonly SGD: "Singapore Dollar";
|
|
26
|
-
};
|
|
27
|
-
export declare const CURRENCY_SYMBOLS: {
|
|
28
|
-
readonly AUD: "A$";
|
|
29
|
-
readonly USD: "$";
|
|
30
|
-
readonly EUR: "€";
|
|
31
|
-
readonly GBP: "£";
|
|
32
|
-
readonly CAD: "C$";
|
|
33
|
-
readonly JPY: "¥";
|
|
34
|
-
readonly NZD: "NZ$";
|
|
35
|
-
readonly SGD: "S$";
|
|
36
|
-
};
|
|
37
|
-
export declare const DEFAULT_CURRENCY: "AUD";
|
|
38
|
-
export type Currency = typeof CURRENCY[keyof typeof CURRENCY];
|
|
39
|
-
export type CurrencyCode = Currency;
|
|
40
|
-
export declare const CURRENCY_AUD: "AUD";
|
|
41
|
-
export declare const CURRENCY_USD: "USD";
|
|
42
|
-
export declare const CURRENCY_LABEL_AUD: "Australian Dollar";
|
|
43
|
-
export declare const CURRENCY_LABEL_USD: "US Dollar";
|
|
44
|
-
export interface CurrencyInfo {
|
|
45
|
-
code: Currency;
|
|
46
|
-
name: string;
|
|
47
|
-
symbol: string;
|
|
48
|
-
}
|
|
49
|
-
export declare const CURRENCIES: CurrencyInfo[];
|
|
50
|
-
export declare const getCurrencyInfo: (code: Currency) => CurrencyInfo | undefined;
|
|
51
|
-
//# sourceMappingURL=currency.d.ts.map
|