@cranberry-money/shared-constants 3.0.0 → 3.0.2

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.
@@ -0,0 +1,100 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,99 @@
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
+ };
@@ -0,0 +1,15 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,17 @@
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];
@@ -0,0 +1,38 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,37 @@
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;
@@ -1,19 +1,51 @@
1
1
  /**
2
- * Currency-related constants for the MyPortfolio platform.
2
+ * Currency-related constants sourced from backend Django constants
3
3
  *
4
- * These constants should match backend constants where applicable.
4
+ * Backend source: bilberry/shared/constants.py
5
+ * These constants serve as the single source of truth for currencies.
5
6
  */
6
- export declare const CURRENCY_AUD = "AUD";
7
- export declare const CURRENCY_USD = "USD";
8
- export declare const DEFAULT_CURRENCY = "AUD";
9
- export declare const CURRENCY_LABEL_AUD = "Australian Dollar";
10
- export declare const CURRENCY_LABEL_USD = "US Dollar";
11
- export type CurrencyCode = typeof CURRENCY_AUD | typeof CURRENCY_USD;
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";
12
44
  export interface CurrencyInfo {
13
- code: CurrencyCode;
45
+ code: Currency;
14
46
  name: string;
15
47
  symbol: string;
16
48
  }
17
49
  export declare const CURRENCIES: CurrencyInfo[];
18
- export declare const getCurrencyInfo: (code: CurrencyCode) => CurrencyInfo | undefined;
50
+ export declare const getCurrencyInfo: (code: Currency) => CurrencyInfo | undefined;
19
51
  //# sourceMappingURL=currency.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"currency.d.ts","sourceRoot":"","sources":["../src/currency.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,eAAO,MAAM,YAAY,QAAQ,CAAC;AAClC,eAAO,MAAM,YAAY,QAAQ,CAAC;AAGlC,eAAO,MAAM,gBAAgB,QAAe,CAAC;AAG7C,eAAO,MAAM,kBAAkB,sBAAsB,CAAC;AACtD,eAAO,MAAM,kBAAkB,cAAc,CAAC;AAG9C,MAAM,MAAM,YAAY,GAAG,OAAO,YAAY,GAAG,OAAO,YAAY,CAAC;AAGrE,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,YAAY,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAGD,eAAO,MAAM,UAAU,EAAE,YAAY,EAGpC,CAAC;AAGF,eAAO,MAAM,eAAe,GAAI,MAAM,YAAY,KAAG,YAAY,GAAG,SAEnE,CAAC"}
1
+ {"version":3,"file":"currency.d.ts","sourceRoot":"","sources":["../src/currency.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,eAAO,MAAM,QAAQ;;;;;;;;;CASX,CAAC;AAEX,eAAO,MAAM,eAAe;;;;;;;;;CASlB,CAAC;AAEX,eAAO,MAAM,gBAAgB;;;;;;;;;CASnB,CAAC;AAGX,eAAO,MAAM,gBAAgB,OAAe,CAAC;AAG7C,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAC,MAAM,OAAO,QAAQ,CAAC,CAAC;AAC9D,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC;AAGpC,eAAO,MAAM,YAAY,OAAe,CAAC;AACzC,eAAO,MAAM,YAAY,OAAe,CAAC;AAGzC,eAAO,MAAM,kBAAkB,qBAAsB,CAAC;AACtD,eAAO,MAAM,kBAAkB,aAAsB,CAAC;AAGtD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAGD,eAAO,MAAM,UAAU,EAAE,YAAY,EAIlC,CAAC;AAGJ,eAAO,MAAM,eAAe,GAAI,MAAM,QAAQ,KAAG,YAAY,GAAG,SAE/D,CAAC"}
package/dist/currency.js CHANGED
@@ -1,21 +1,54 @@
1
1
  /**
2
- * Currency-related constants for the MyPortfolio platform.
2
+ * Currency-related constants sourced from backend Django constants
3
3
  *
4
- * These constants should match backend constants where applicable.
4
+ * Backend source: bilberry/shared/constants.py
5
+ * These constants serve as the single source of truth for currencies.
5
6
  */
6
- // Currency constants - ISO 4217 codes
7
- export const CURRENCY_AUD = 'AUD';
8
- export const CURRENCY_USD = 'USD';
7
+ // ===== CURRENCY CODES (ISO 4217) =====
8
+ export const CURRENCY = {
9
+ AUD: 'AUD',
10
+ USD: 'USD',
11
+ EUR: 'EUR',
12
+ GBP: 'GBP',
13
+ CAD: 'CAD',
14
+ JPY: 'JPY',
15
+ NZD: 'NZD',
16
+ SGD: 'SGD',
17
+ };
18
+ export const CURRENCY_LABELS = {
19
+ AUD: 'Australian Dollar',
20
+ USD: 'US Dollar',
21
+ EUR: 'Euro',
22
+ GBP: 'British Pound',
23
+ CAD: 'Canadian Dollar',
24
+ JPY: 'Japanese Yen',
25
+ NZD: 'New Zealand Dollar',
26
+ SGD: 'Singapore Dollar',
27
+ };
28
+ export const CURRENCY_SYMBOLS = {
29
+ AUD: 'A$',
30
+ USD: '$',
31
+ EUR: '€',
32
+ GBP: '£',
33
+ CAD: 'C$',
34
+ JPY: '¥',
35
+ NZD: 'NZ$',
36
+ SGD: 'S$',
37
+ };
9
38
  // Default currency
10
- export const DEFAULT_CURRENCY = CURRENCY_AUD;
11
- // Currency label constants
12
- export const CURRENCY_LABEL_AUD = 'Australian Dollar';
13
- export const CURRENCY_LABEL_USD = 'US Dollar';
39
+ export const DEFAULT_CURRENCY = CURRENCY.AUD;
40
+ // Legacy single currency exports for backward compatibility
41
+ export const CURRENCY_AUD = CURRENCY.AUD;
42
+ export const CURRENCY_USD = CURRENCY.USD;
43
+ // Legacy labels for backward compatibility
44
+ export const CURRENCY_LABEL_AUD = CURRENCY_LABELS.AUD;
45
+ export const CURRENCY_LABEL_USD = CURRENCY_LABELS.USD;
14
46
  // Available currencies with display information
15
- export const CURRENCIES = [
16
- { code: CURRENCY_AUD, name: CURRENCY_LABEL_AUD, symbol: 'A$' },
17
- { code: CURRENCY_USD, name: CURRENCY_LABEL_USD, symbol: '$' },
18
- ];
47
+ export const CURRENCIES = Object.entries(CURRENCY).map(([_, code]) => ({
48
+ code,
49
+ name: CURRENCY_LABELS[code],
50
+ symbol: CURRENCY_SYMBOLS[code],
51
+ }));
19
52
  // Helper function to get currency info by code
20
53
  export const getCurrencyInfo = (code) => {
21
54
  return CURRENCIES.find((currency) => currency.code === code);
package/dist/index.d.ts CHANGED
@@ -5,5 +5,13 @@ export * from './common';
5
5
  export * from './time';
6
6
  export * from './currency';
7
7
  export * from './http';
8
+ export * from './validation';
9
+ export * from './allocation';
10
+ export * from './transactions';
11
+ export * from './accounts';
12
+ export * from './portfolios';
13
+ export * from './jobs';
14
+ export * from './trades';
15
+ export * from './withdrawals';
8
16
  export * from './ui';
9
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AAGvB,cAAc,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAG9B,cAAc,MAAM,CAAC"}
package/dist/index.js CHANGED
@@ -6,5 +6,13 @@ export * from './common';
6
6
  export * from './time';
7
7
  export * from './currency';
8
8
  export * from './http';
9
+ export * from './validation';
10
+ export * from './allocation';
11
+ export * from './transactions';
12
+ export * from './accounts';
13
+ export * from './portfolios';
14
+ export * from './jobs';
15
+ export * from './trades';
16
+ export * from './withdrawals';
9
17
  // Re-export UI constants
10
18
  export * from './ui';
package/dist/jobs.d.ts ADDED
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Job and Task status constants sourced from backend Django constants
3
+ *
4
+ * Backend source: bilberry/shared/constants.py
5
+ */
6
+ export declare const JOB_STATUS: {
7
+ readonly SCHEDULED: "scheduled";
8
+ readonly RUNNING: "running";
9
+ readonly COMPLETED: "completed";
10
+ readonly FAILED: "failed";
11
+ };
12
+ export declare const JOB_STATUS_LABELS: {
13
+ readonly scheduled: "Scheduled";
14
+ readonly running: "Running";
15
+ readonly completed: "Completed";
16
+ readonly failed: "Failed";
17
+ };
18
+ export type JobStatus = typeof JOB_STATUS[keyof typeof JOB_STATUS];
19
+ //# sourceMappingURL=jobs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jobs.d.ts","sourceRoot":"","sources":["../src/jobs.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,eAAO,MAAM,UAAU;;;;;CAKb,CAAC;AAEX,eAAO,MAAM,iBAAiB;;;;;CAKpB,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,OAAO,UAAU,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC"}
package/dist/jobs.js ADDED
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Job and Task status constants sourced from backend Django constants
3
+ *
4
+ * Backend source: bilberry/shared/constants.py
5
+ */
6
+ // ===== JOB/TASK STATUSES =====
7
+ export const JOB_STATUS = {
8
+ SCHEDULED: 'scheduled',
9
+ RUNNING: 'running',
10
+ COMPLETED: 'completed',
11
+ FAILED: 'failed',
12
+ };
13
+ export const JOB_STATUS_LABELS = {
14
+ scheduled: 'Scheduled',
15
+ running: 'Running',
16
+ completed: 'Completed',
17
+ failed: 'Failed',
18
+ };
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Portfolio-related constants sourced from backend Django constants
3
+ *
4
+ * Backend source: bilberry/portfolios/constants.py
5
+ */
6
+ export declare const PORTFOLIO_RISK_LEVEL: {
7
+ readonly LOW: "LOW";
8
+ readonly MEDIUM: "MEDIUM";
9
+ readonly HIGH: "HIGH";
10
+ };
11
+ export declare const PORTFOLIO_RISK_LEVEL_LABELS: {
12
+ readonly LOW: "Low Risk";
13
+ readonly MEDIUM: "Medium Risk";
14
+ readonly HIGH: "High Risk";
15
+ };
16
+ export type PortfolioRiskLevel = typeof PORTFOLIO_RISK_LEVEL[keyof typeof PORTFOLIO_RISK_LEVEL];
17
+ //# sourceMappingURL=portfolios.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"portfolios.d.ts","sourceRoot":"","sources":["../src/portfolios.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,eAAO,MAAM,oBAAoB;;;;CAIvB,CAAC;AAEX,eAAO,MAAM,2BAA2B;;;;CAI9B,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAAG,OAAO,oBAAoB,CAAC,MAAM,OAAO,oBAAoB,CAAC,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Portfolio-related constants sourced from backend Django constants
3
+ *
4
+ * Backend source: bilberry/portfolios/constants.py
5
+ */
6
+ // ===== PORTFOLIO RISK LEVELS =====
7
+ export const PORTFOLIO_RISK_LEVEL = {
8
+ LOW: 'LOW',
9
+ MEDIUM: 'MEDIUM',
10
+ HIGH: 'HIGH',
11
+ };
12
+ export const PORTFOLIO_RISK_LEVEL_LABELS = {
13
+ LOW: 'Low Risk',
14
+ MEDIUM: 'Medium Risk',
15
+ HIGH: 'High Risk',
16
+ };
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Trade-related constants sourced from backend Django constants
3
+ *
4
+ * Backend source: bilberry/trades/constants.py
5
+ *
6
+ * Note: Trade status and action constants are already included in transactions.ts
7
+ * This file contains additional trade-specific constants for trade sheets.
8
+ */
9
+ export declare const TARGET_TRADE_SHEET_STATUS: {
10
+ readonly DRAFT: "DRAFT";
11
+ readonly APPROVED: "APPROVED";
12
+ readonly SUBMITTED: "SUBMITTED";
13
+ readonly CANCELLED: "CANCELLED";
14
+ };
15
+ export declare const TARGET_TRADE_SHEET_STATUS_LABELS: {
16
+ readonly DRAFT: "Draft";
17
+ readonly APPROVED: "Approved";
18
+ readonly SUBMITTED: "Submitted to Broker";
19
+ readonly CANCELLED: "Cancelled";
20
+ };
21
+ export type TargetTradeSheetStatus = typeof TARGET_TRADE_SHEET_STATUS[keyof typeof TARGET_TRADE_SHEET_STATUS];
22
+ export declare const TRADE_SHEET_SETTLEMENT_STATUS: {
23
+ readonly PENDING: "PENDING";
24
+ readonly SETTLED: "SETTLED";
25
+ readonly FAILED: "FAILED";
26
+ };
27
+ export declare const TRADE_SHEET_SETTLEMENT_STATUS_LABELS: {
28
+ readonly PENDING: "Pending Settlement";
29
+ readonly SETTLED: "Settled";
30
+ readonly FAILED: "Settlement Failed";
31
+ };
32
+ export type TradeSheetSettlementStatus = typeof TRADE_SHEET_SETTLEMENT_STATUS[keyof typeof TRADE_SHEET_SETTLEMENT_STATUS];
33
+ export { TRADE_STATUS, TRADE_STATUS_LABELS, TARGET_TRADE_STATUS, TARGET_TRADE_STATUS_LABELS, TRADE_ACTION, TRADE_ACTION_LABELS, type TradeStatus, type TargetTradeStatus, type TradeAction, } from './transactions';
34
+ //# sourceMappingURL=trades.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trades.d.ts","sourceRoot":"","sources":["../src/trades.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,eAAO,MAAM,yBAAyB;;;;;CAK5B,CAAC;AAEX,eAAO,MAAM,gCAAgC;;;;;CAKnC,CAAC;AAEX,MAAM,MAAM,sBAAsB,GAAG,OAAO,yBAAyB,CAAC,MAAM,OAAO,yBAAyB,CAAC,CAAC;AAG9G,eAAO,MAAM,6BAA6B;;;;CAIhC,CAAC;AAEX,eAAO,MAAM,oCAAoC;;;;CAIvC,CAAC;AAEX,MAAM,MAAM,0BAA0B,GAAG,OAAO,6BAA6B,CAAC,MAAM,OAAO,6BAA6B,CAAC,CAAC;AAG1H,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,0BAA0B,EAC1B,YAAY,EACZ,mBAAmB,EACnB,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,WAAW,GACjB,MAAM,gBAAgB,CAAC"}
package/dist/trades.js ADDED
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Trade-related constants sourced from backend Django constants
3
+ *
4
+ * Backend source: bilberry/trades/constants.py
5
+ *
6
+ * Note: Trade status and action constants are already included in transactions.ts
7
+ * This file contains additional trade-specific constants for trade sheets.
8
+ */
9
+ // ===== TARGET TRADE SHEET STATUSES =====
10
+ export const TARGET_TRADE_SHEET_STATUS = {
11
+ DRAFT: 'DRAFT',
12
+ APPROVED: 'APPROVED',
13
+ SUBMITTED: 'SUBMITTED',
14
+ CANCELLED: 'CANCELLED',
15
+ };
16
+ export const TARGET_TRADE_SHEET_STATUS_LABELS = {
17
+ DRAFT: 'Draft',
18
+ APPROVED: 'Approved',
19
+ SUBMITTED: 'Submitted to Broker',
20
+ CANCELLED: 'Cancelled',
21
+ };
22
+ // ===== TRADE SHEET SETTLEMENT STATUSES =====
23
+ export const TRADE_SHEET_SETTLEMENT_STATUS = {
24
+ PENDING: 'PENDING',
25
+ SETTLED: 'SETTLED',
26
+ FAILED: 'FAILED',
27
+ };
28
+ export const TRADE_SHEET_SETTLEMENT_STATUS_LABELS = {
29
+ PENDING: 'Pending Settlement',
30
+ SETTLED: 'Settled',
31
+ FAILED: 'Settlement Failed',
32
+ };
33
+ // Re-export trade constants from transactions.ts for convenience
34
+ export { TRADE_STATUS, TRADE_STATUS_LABELS, TARGET_TRADE_STATUS, TARGET_TRADE_STATUS_LABELS, TRADE_ACTION, TRADE_ACTION_LABELS, } from './transactions';
@@ -0,0 +1,145 @@
1
+ /**
2
+ * Transaction constants sourced from backend Django constants
3
+ *
4
+ * These constants maintain consistency between frontend and backend
5
+ * and serve as the single source of truth for transaction-related values.
6
+ *
7
+ * Backend sources:
8
+ * - bilberry/accounts/constants.py (Cash Account Transaction types)
9
+ * - bilberry/withdrawals/constants.py (Withdrawal statuses)
10
+ * - bilberry/trades/constants.py (Trade statuses)
11
+ */
12
+ export declare const CASH_ACCOUNT_TRN_TYPE: {
13
+ readonly DEPOSIT: "DEPOSIT";
14
+ readonly WITHDRAWAL: "WITHDRAWAL";
15
+ readonly TRADE_SETTLEMENT: "TRADE_SETTLEMENT";
16
+ readonly DISTRIBUTION: "DISTRIBUTION";
17
+ readonly FEE: "FEE";
18
+ readonly INTEREST: "INTEREST";
19
+ readonly OTHER: "OTHER";
20
+ };
21
+ export declare const CASH_ACCOUNT_TRN_TYPE_LABELS: {
22
+ readonly DEPOSIT: "Deposit";
23
+ readonly WITHDRAWAL: "Withdrawal";
24
+ readonly TRADE_SETTLEMENT: "Trade Settlement";
25
+ readonly DISTRIBUTION: "Distribution";
26
+ readonly FEE: "Fee";
27
+ readonly INTEREST: "Interest";
28
+ readonly OTHER: "Adjustment";
29
+ };
30
+ export declare const CASH_TRANSACTION_TYPE: {
31
+ readonly DEPOSIT: "DEPOSIT";
32
+ readonly WITHDRAWAL: "WITHDRAWAL";
33
+ readonly TRANSFER: "TRANSFER";
34
+ readonly FEE: "FEE";
35
+ readonly DIVIDEND: "DIVIDEND";
36
+ readonly INTEREST: "INTEREST";
37
+ };
38
+ export declare const CASH_TRANSACTION_TYPE_LABELS: {
39
+ readonly DEPOSIT: "Deposit";
40
+ readonly WITHDRAWAL: "Withdrawal";
41
+ readonly TRANSFER: "Transfer";
42
+ readonly FEE: "Fee";
43
+ readonly DIVIDEND: "Dividend";
44
+ readonly INTEREST: "Interest";
45
+ };
46
+ export type CashAccountTrnType = typeof CASH_ACCOUNT_TRN_TYPE[keyof typeof CASH_ACCOUNT_TRN_TYPE];
47
+ export type CashTransactionType = typeof CASH_TRANSACTION_TYPE[keyof typeof CASH_TRANSACTION_TYPE];
48
+ export declare const WITHDRAWAL_STATUS: {
49
+ readonly PENDING_REVIEW: "PENDING_REVIEW";
50
+ readonly APPROVED: "APPROVED";
51
+ readonly REJECTED: "REJECTED";
52
+ readonly PROCESSING: "PROCESSING";
53
+ readonly AWAITING_LIQUIDATION: "AWAITING_LIQUIDATION";
54
+ readonly LIQUIDATION_IN_PROGRESS: "LIQUIDATION_IN_PROGRESS";
55
+ readonly COMPLETED: "COMPLETED";
56
+ readonly CANCELLED: "CANCELLED";
57
+ readonly FAILED: "FAILED";
58
+ };
59
+ export declare const WITHDRAWAL_STATUS_LABELS: {
60
+ readonly PENDING_REVIEW: "Pending Review";
61
+ readonly APPROVED: "Approved";
62
+ readonly REJECTED: "Rejected";
63
+ readonly PROCESSING: "Processing";
64
+ readonly AWAITING_LIQUIDATION: "Awaiting Asset Liquidation";
65
+ readonly LIQUIDATION_IN_PROGRESS: "Liquidation in Progress";
66
+ readonly COMPLETED: "Completed";
67
+ readonly CANCELLED: "Cancelled";
68
+ readonly FAILED: "Failed";
69
+ };
70
+ export type WithdrawalStatus = typeof WITHDRAWAL_STATUS[keyof typeof WITHDRAWAL_STATUS];
71
+ export declare const WITHDRAWAL_TYPE: {
72
+ readonly FULL_CASH: "FULL_CASH";
73
+ readonly PARTIAL_CASH: "PARTIAL_CASH";
74
+ };
75
+ export declare const WITHDRAWAL_TYPE_LABELS: {
76
+ readonly FULL_CASH: "Full Cash Withdrawal";
77
+ readonly PARTIAL_CASH: "Partial Cash Withdrawal";
78
+ };
79
+ export type WithdrawalType = typeof WITHDRAWAL_TYPE[keyof typeof WITHDRAWAL_TYPE];
80
+ export declare const WITHDRAWAL_REASON: {
81
+ readonly INVESTMENT_STRATEGY: "INVESTMENT_STRATEGY";
82
+ readonly PERSONAL_EXPENSES: "PERSONAL_EXPENSES";
83
+ readonly EMERGENCY: "EMERGENCY";
84
+ readonly OTHER: "OTHER";
85
+ };
86
+ export declare const WITHDRAWAL_REASON_LABELS: {
87
+ readonly INVESTMENT_STRATEGY: "Investment Strategy Change";
88
+ readonly PERSONAL_EXPENSES: "Personal Expenses";
89
+ readonly EMERGENCY: "Emergency";
90
+ readonly OTHER: "Other";
91
+ };
92
+ export type WithdrawalReason = typeof WITHDRAWAL_REASON[keyof typeof WITHDRAWAL_REASON];
93
+ export declare const LIQUIDATION_STATUS: {
94
+ readonly PENDING: "PENDING";
95
+ readonly TRADES_CREATED: "TRADES_CREATED";
96
+ readonly EXECUTED: "EXECUTED";
97
+ readonly SETTLED: "SETTLED";
98
+ readonly FAILED: "FAILED";
99
+ };
100
+ export declare const LIQUIDATION_STATUS_LABELS: {
101
+ readonly PENDING: "Pending";
102
+ readonly TRADES_CREATED: "Trades Created";
103
+ readonly EXECUTED: "Executed";
104
+ readonly SETTLED: "Settled";
105
+ readonly FAILED: "Failed";
106
+ };
107
+ export type LiquidationStatus = typeof LIQUIDATION_STATUS[keyof typeof LIQUIDATION_STATUS];
108
+ export declare const TRADE_STATUS: {
109
+ readonly EXECUTED: "EXECUTED";
110
+ readonly SETTLED: "SETTLED";
111
+ readonly CANCELLED: "CANCELLED";
112
+ readonly FAILED: "FAILED";
113
+ };
114
+ export declare const TRADE_STATUS_LABELS: {
115
+ readonly EXECUTED: "Executed";
116
+ readonly SETTLED: "Settled";
117
+ readonly CANCELLED: "Cancelled";
118
+ readonly FAILED: "Failed";
119
+ };
120
+ export type TradeStatus = typeof TRADE_STATUS[keyof typeof TRADE_STATUS];
121
+ export declare const TARGET_TRADE_STATUS: {
122
+ readonly PENDING: "PENDING";
123
+ readonly APPROVED: "APPROVED";
124
+ readonly SUBMITTED: "SUBMITTED";
125
+ readonly CANCELLED: "CANCELLED";
126
+ readonly EXPIRED: "EXPIRED";
127
+ };
128
+ export declare const TARGET_TRADE_STATUS_LABELS: {
129
+ readonly PENDING: "Pending Submission";
130
+ readonly APPROVED: "Approved";
131
+ readonly SUBMITTED: "Submitted to Broker";
132
+ readonly CANCELLED: "Cancelled";
133
+ readonly EXPIRED: "Expired";
134
+ };
135
+ export type TargetTradeStatus = typeof TARGET_TRADE_STATUS[keyof typeof TARGET_TRADE_STATUS];
136
+ export declare const TRADE_ACTION: {
137
+ readonly BUY: "BUY";
138
+ readonly SELL: "SELL";
139
+ };
140
+ export declare const TRADE_ACTION_LABELS: {
141
+ readonly BUY: "Buy";
142
+ readonly SELL: "Sell";
143
+ };
144
+ export type TradeAction = typeof TRADE_ACTION[keyof typeof TRADE_ACTION];
145
+ //# sourceMappingURL=transactions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transactions.d.ts","sourceRoot":"","sources":["../src/transactions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAOH,eAAO,MAAM,qBAAqB;;;;;;;;CAQxB,CAAC;AAEX,eAAO,MAAM,4BAA4B;;;;;;;;CAQ/B,CAAC;AAGX,eAAO,MAAM,qBAAqB;;;;;;;CAOxB,CAAC;AAEX,eAAO,MAAM,4BAA4B;;;;;;;CAO/B,CAAC;AAGX,MAAM,MAAM,kBAAkB,GAAG,OAAO,qBAAqB,CAAC,MAAM,OAAO,qBAAqB,CAAC,CAAC;AAClG,MAAM,MAAM,mBAAmB,GAAG,OAAO,qBAAqB,CAAC,MAAM,OAAO,qBAAqB,CAAC,CAAC;AAKnG,eAAO,MAAM,iBAAiB;;;;;;;;;;CAUpB,CAAC;AAEX,eAAO,MAAM,wBAAwB;;;;;;;;;;CAU3B,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,OAAO,iBAAiB,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAC;AAKxF,eAAO,MAAM,eAAe;;;CAGlB,CAAC;AAEX,eAAO,MAAM,sBAAsB;;;CAGzB,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,OAAO,eAAe,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;AAKlF,eAAO,MAAM,iBAAiB;;;;;CAKpB,CAAC;AAEX,eAAO,MAAM,wBAAwB;;;;;CAK3B,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,OAAO,iBAAiB,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAC;AAKxF,eAAO,MAAM,kBAAkB;;;;;;CAMrB,CAAC;AAEX,eAAO,MAAM,yBAAyB;;;;;;CAM5B,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,OAAO,kBAAkB,CAAC,MAAM,OAAO,kBAAkB,CAAC,CAAC;AAK3F,eAAO,MAAM,YAAY;;;;;CAKf,CAAC;AAEX,eAAO,MAAM,mBAAmB;;;;;CAKtB,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,OAAO,YAAY,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAKzE,eAAO,MAAM,mBAAmB;;;;;;CAMtB,CAAC;AAEX,eAAO,MAAM,0BAA0B;;;;;;CAM7B,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,OAAO,mBAAmB,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC;AAK7F,eAAO,MAAM,YAAY;;;CAGf,CAAC;AAEX,eAAO,MAAM,mBAAmB;;;CAGtB,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,OAAO,YAAY,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC"}
@@ -0,0 +1,154 @@
1
+ /**
2
+ * Transaction constants sourced from backend Django constants
3
+ *
4
+ * These constants maintain consistency between frontend and backend
5
+ * and serve as the single source of truth for transaction-related values.
6
+ *
7
+ * Backend sources:
8
+ * - bilberry/accounts/constants.py (Cash Account Transaction types)
9
+ * - bilberry/withdrawals/constants.py (Withdrawal statuses)
10
+ * - bilberry/trades/constants.py (Trade statuses)
11
+ */
12
+ // ===== CASH ACCOUNT TRANSACTION TYPES =====
13
+ // Source: bilberry/accounts/constants.py
14
+ // Note: Frontend v3.0.0 API uses a subset of these types
15
+ // Full backend cash account transaction types
16
+ export const CASH_ACCOUNT_TRN_TYPE = {
17
+ DEPOSIT: 'DEPOSIT',
18
+ WITHDRAWAL: 'WITHDRAWAL',
19
+ TRADE_SETTLEMENT: 'TRADE_SETTLEMENT',
20
+ DISTRIBUTION: 'DISTRIBUTION',
21
+ FEE: 'FEE',
22
+ INTEREST: 'INTEREST',
23
+ OTHER: 'OTHER',
24
+ };
25
+ export const CASH_ACCOUNT_TRN_TYPE_LABELS = {
26
+ DEPOSIT: 'Deposit',
27
+ WITHDRAWAL: 'Withdrawal',
28
+ TRADE_SETTLEMENT: 'Trade Settlement',
29
+ DISTRIBUTION: 'Distribution',
30
+ FEE: 'Fee',
31
+ INTEREST: 'Interest',
32
+ OTHER: 'Adjustment',
33
+ };
34
+ // Frontend v3.0.0 API subset (CashTransaction interface)
35
+ export const CASH_TRANSACTION_TYPE = {
36
+ DEPOSIT: 'DEPOSIT',
37
+ WITHDRAWAL: 'WITHDRAWAL',
38
+ TRANSFER: 'TRANSFER',
39
+ FEE: 'FEE',
40
+ DIVIDEND: 'DIVIDEND',
41
+ INTEREST: 'INTEREST',
42
+ };
43
+ export const CASH_TRANSACTION_TYPE_LABELS = {
44
+ DEPOSIT: 'Deposit',
45
+ WITHDRAWAL: 'Withdrawal',
46
+ TRANSFER: 'Transfer',
47
+ FEE: 'Fee',
48
+ DIVIDEND: 'Dividend',
49
+ INTEREST: 'Interest',
50
+ };
51
+ // ===== WITHDRAWAL STATUSES =====
52
+ // Source: bilberry/withdrawals/constants.py
53
+ export const WITHDRAWAL_STATUS = {
54
+ PENDING_REVIEW: 'PENDING_REVIEW',
55
+ APPROVED: 'APPROVED',
56
+ REJECTED: 'REJECTED',
57
+ PROCESSING: 'PROCESSING',
58
+ AWAITING_LIQUIDATION: 'AWAITING_LIQUIDATION',
59
+ LIQUIDATION_IN_PROGRESS: 'LIQUIDATION_IN_PROGRESS',
60
+ COMPLETED: 'COMPLETED',
61
+ CANCELLED: 'CANCELLED',
62
+ FAILED: 'FAILED',
63
+ };
64
+ export const WITHDRAWAL_STATUS_LABELS = {
65
+ PENDING_REVIEW: 'Pending Review',
66
+ APPROVED: 'Approved',
67
+ REJECTED: 'Rejected',
68
+ PROCESSING: 'Processing',
69
+ AWAITING_LIQUIDATION: 'Awaiting Asset Liquidation',
70
+ LIQUIDATION_IN_PROGRESS: 'Liquidation in Progress',
71
+ COMPLETED: 'Completed',
72
+ CANCELLED: 'Cancelled',
73
+ FAILED: 'Failed',
74
+ };
75
+ // ===== WITHDRAWAL TYPES =====
76
+ // Source: bilberry/withdrawals/constants.py
77
+ export const WITHDRAWAL_TYPE = {
78
+ FULL_CASH: 'FULL_CASH',
79
+ PARTIAL_CASH: 'PARTIAL_CASH',
80
+ };
81
+ export const WITHDRAWAL_TYPE_LABELS = {
82
+ FULL_CASH: 'Full Cash Withdrawal',
83
+ PARTIAL_CASH: 'Partial Cash Withdrawal',
84
+ };
85
+ // ===== WITHDRAWAL REASONS =====
86
+ // Source: bilberry/withdrawals/constants.py
87
+ export const WITHDRAWAL_REASON = {
88
+ INVESTMENT_STRATEGY: 'INVESTMENT_STRATEGY',
89
+ PERSONAL_EXPENSES: 'PERSONAL_EXPENSES',
90
+ EMERGENCY: 'EMERGENCY',
91
+ OTHER: 'OTHER',
92
+ };
93
+ export const WITHDRAWAL_REASON_LABELS = {
94
+ INVESTMENT_STRATEGY: 'Investment Strategy Change',
95
+ PERSONAL_EXPENSES: 'Personal Expenses',
96
+ EMERGENCY: 'Emergency',
97
+ OTHER: 'Other',
98
+ };
99
+ // ===== LIQUIDATION STATUSES =====
100
+ // Source: bilberry/withdrawals/constants.py
101
+ export const LIQUIDATION_STATUS = {
102
+ PENDING: 'PENDING',
103
+ TRADES_CREATED: 'TRADES_CREATED',
104
+ EXECUTED: 'EXECUTED',
105
+ SETTLED: 'SETTLED',
106
+ FAILED: 'FAILED',
107
+ };
108
+ export const LIQUIDATION_STATUS_LABELS = {
109
+ PENDING: 'Pending',
110
+ TRADES_CREATED: 'Trades Created',
111
+ EXECUTED: 'Executed',
112
+ SETTLED: 'Settled',
113
+ FAILED: 'Failed',
114
+ };
115
+ // ===== TRADE STATUSES =====
116
+ // Source: bilberry/trades/constants.py
117
+ export const TRADE_STATUS = {
118
+ EXECUTED: 'EXECUTED',
119
+ SETTLED: 'SETTLED',
120
+ CANCELLED: 'CANCELLED',
121
+ FAILED: 'FAILED',
122
+ };
123
+ export const TRADE_STATUS_LABELS = {
124
+ EXECUTED: 'Executed',
125
+ SETTLED: 'Settled',
126
+ CANCELLED: 'Cancelled',
127
+ FAILED: 'Failed',
128
+ };
129
+ // ===== TARGET TRADE STATUSES =====
130
+ // Source: bilberry/trades/constants.py
131
+ export const TARGET_TRADE_STATUS = {
132
+ PENDING: 'PENDING',
133
+ APPROVED: 'APPROVED',
134
+ SUBMITTED: 'SUBMITTED',
135
+ CANCELLED: 'CANCELLED',
136
+ EXPIRED: 'EXPIRED',
137
+ };
138
+ export const TARGET_TRADE_STATUS_LABELS = {
139
+ PENDING: 'Pending Submission',
140
+ APPROVED: 'Approved',
141
+ SUBMITTED: 'Submitted to Broker',
142
+ CANCELLED: 'Cancelled',
143
+ EXPIRED: 'Expired',
144
+ };
145
+ // ===== TRADE ACTIONS =====
146
+ // Source: bilberry/trades/constants.py
147
+ export const TRADE_ACTION = {
148
+ BUY: 'BUY',
149
+ SELL: 'SELL',
150
+ };
151
+ export const TRADE_ACTION_LABELS = {
152
+ BUY: 'Buy',
153
+ SELL: 'Sell',
154
+ };
@@ -28,4 +28,14 @@ export declare const STATUS_COLORS: {
28
28
  readonly error: "#EF4444";
29
29
  readonly neutral: "#6B7280";
30
30
  };
31
+ export declare const STATUS_COLOR_PENDING = "text-warning-600";
32
+ export declare const STATUS_COLOR_AWAITING = "text-warning-600";
33
+ export declare const STATUS_COLOR_PROCESSING = "text-primary-600";
34
+ export declare const STATUS_COLOR_IN_PROGRESS = "text-primary-600";
35
+ export declare const STATUS_COLOR_APPROVED = "text-success-600";
36
+ export declare const STATUS_COLOR_COMPLETED = "text-success-700";
37
+ export declare const STATUS_COLOR_REJECTED = "text-error-600";
38
+ export declare const STATUS_COLOR_FAILED = "text-error-700";
39
+ export declare const STATUS_COLOR_CANCELLED = "text-content-subtle";
40
+ export declare const STATUS_COLOR_DEFAULT = "text-content-subtle";
31
41
  //# sourceMappingURL=status.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/ui/status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;AAGpF,eAAO,MAAM,aAAa;;;;;;;;;;;CAoBhB,CAAC;AAGX,eAAO,MAAM,aAAa;;;;;;CAMhB,CAAC"}
1
+ {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/ui/status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;AAGpF,eAAO,MAAM,aAAa;;;;;;;;;;;CAoBhB,CAAC;AAGX,eAAO,MAAM,aAAa;;;;;;CAMhB,CAAC;AAKX,eAAO,MAAM,oBAAoB,qBAAqB,CAAC;AACvD,eAAO,MAAM,qBAAqB,qBAAqB,CAAC;AAGxD,eAAO,MAAM,uBAAuB,qBAAqB,CAAC;AAC1D,eAAO,MAAM,wBAAwB,qBAAqB,CAAC;AAG3D,eAAO,MAAM,qBAAqB,qBAAqB,CAAC;AACxD,eAAO,MAAM,sBAAsB,qBAAqB,CAAC;AAGzD,eAAO,MAAM,qBAAqB,mBAAmB,CAAC;AACtD,eAAO,MAAM,mBAAmB,mBAAmB,CAAC;AAGpD,eAAO,MAAM,sBAAsB,wBAAwB,CAAC;AAC5D,eAAO,MAAM,oBAAoB,wBAAwB,CAAC"}
package/dist/ui/status.js CHANGED
@@ -34,3 +34,20 @@ export const STATUS_COLORS = {
34
34
  error: '#EF4444', // Red/Error
35
35
  neutral: '#6B7280', // Gray/Neutral
36
36
  };
37
+ // Web-specific Tailwind class mappings
38
+ // These are for Blueberry web application use
39
+ // Pending/Waiting states
40
+ export const STATUS_COLOR_PENDING = 'text-warning-600';
41
+ export const STATUS_COLOR_AWAITING = 'text-warning-600';
42
+ // Active/Processing states
43
+ export const STATUS_COLOR_PROCESSING = 'text-primary-600';
44
+ export const STATUS_COLOR_IN_PROGRESS = 'text-primary-600';
45
+ // Success states
46
+ export const STATUS_COLOR_APPROVED = 'text-success-600';
47
+ export const STATUS_COLOR_COMPLETED = 'text-success-700';
48
+ // Error states
49
+ export const STATUS_COLOR_REJECTED = 'text-error-600';
50
+ export const STATUS_COLOR_FAILED = 'text-error-700';
51
+ // Neutral states
52
+ export const STATUS_COLOR_CANCELLED = 'text-content-subtle';
53
+ export const STATUS_COLOR_DEFAULT = 'text-content-subtle';
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Validation-related constants for the MyPortfolio platform.
3
+ *
4
+ * These constants define validation rules and limits used across
5
+ * web and mobile applications.
6
+ */
7
+ export declare const PASSWORD_MIN_LENGTH = 8;
8
+ export declare const PASSWORD_MAX_LENGTH = 128;
9
+ export declare const TOKEN_MIN_LENGTH = 6;
10
+ export declare const TOKEN_MAX_LENGTH = 20;
11
+ export declare const EMAIL_MAX_LENGTH = 254;
12
+ export declare const NAME_MIN_LENGTH = 1;
13
+ export declare const NAME_MAX_LENGTH = 50;
14
+ export declare const FULL_NAME_MAX_LENGTH = 100;
15
+ export declare const PHONE_MIN_LENGTH = 10;
16
+ export declare const PHONE_MAX_LENGTH = 15;
17
+ export declare const ADDRESS_MIN_LENGTH = 5;
18
+ export declare const ADDRESS_MAX_LENGTH = 200;
19
+ export declare const POSTAL_CODE_MAX_LENGTH = 10;
20
+ export declare const AMOUNT_MIN_VALUE = 0.01;
21
+ export declare const AMOUNT_MAX_VALUE = 999999999.99;
22
+ export declare const PERCENTAGE_MIN_VALUE = 0;
23
+ export declare const PERCENTAGE_MAX_VALUE = 100;
24
+ export declare const TEXT_SHORT_MAX_LENGTH = 50;
25
+ export declare const TEXT_MEDIUM_MAX_LENGTH = 200;
26
+ export declare const TEXT_LONG_MAX_LENGTH = 1000;
27
+ /**
28
+ * Consolidated validation rules object for convenience
29
+ * @deprecated Use individual constants instead for better tree-shaking
30
+ */
31
+ export declare const VALIDATION_RULES: {
32
+ readonly PASSWORD_MIN_LENGTH: 8;
33
+ readonly PASSWORD_MAX_LENGTH: 128;
34
+ readonly TOKEN_MIN_LENGTH: 6;
35
+ readonly TOKEN_MAX_LENGTH: 20;
36
+ readonly EMAIL_MAX_LENGTH: 254;
37
+ readonly NAME_MIN_LENGTH: 1;
38
+ readonly NAME_MAX_LENGTH: 50;
39
+ readonly FULL_NAME_MAX_LENGTH: 100;
40
+ readonly PHONE_MIN_LENGTH: 10;
41
+ readonly PHONE_MAX_LENGTH: 15;
42
+ readonly ADDRESS_MIN_LENGTH: 5;
43
+ readonly ADDRESS_MAX_LENGTH: 200;
44
+ readonly POSTAL_CODE_MAX_LENGTH: 10;
45
+ readonly AMOUNT_MIN_VALUE: 0.01;
46
+ readonly AMOUNT_MAX_VALUE: 999999999.99;
47
+ readonly PERCENTAGE_MIN_VALUE: 0;
48
+ readonly PERCENTAGE_MAX_VALUE: 100;
49
+ readonly TEXT_SHORT_MAX_LENGTH: 50;
50
+ readonly TEXT_MEDIUM_MAX_LENGTH: 200;
51
+ readonly TEXT_LONG_MAX_LENGTH: 1000;
52
+ };
53
+ //# sourceMappingURL=validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,eAAO,MAAM,mBAAmB,IAAI,CAAC;AACrC,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAGvC,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAGnC,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAGpC,eAAO,MAAM,eAAe,IAAI,CAAC;AACjC,eAAO,MAAM,eAAe,KAAK,CAAC;AAClC,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAGxC,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAGnC,eAAO,MAAM,kBAAkB,IAAI,CAAC;AACpC,eAAO,MAAM,kBAAkB,MAAM,CAAC;AACtC,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAGzC,eAAO,MAAM,gBAAgB,OAAO,CAAC;AACrC,eAAO,MAAM,gBAAgB,eAAe,CAAC;AAC7C,eAAO,MAAM,oBAAoB,IAAI,CAAC;AACtC,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAGxC,eAAO,MAAM,qBAAqB,KAAK,CAAC;AACxC,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAC1C,eAAO,MAAM,oBAAoB,OAAO,CAAC;AAEzC;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;CAqBnB,CAAC"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Validation-related constants for the MyPortfolio platform.
3
+ *
4
+ * These constants define validation rules and limits used across
5
+ * web and mobile applications.
6
+ */
7
+ // Password validation rules
8
+ export const PASSWORD_MIN_LENGTH = 8;
9
+ export const PASSWORD_MAX_LENGTH = 128;
10
+ // Token validation rules
11
+ export const TOKEN_MIN_LENGTH = 6;
12
+ export const TOKEN_MAX_LENGTH = 20;
13
+ // Email validation
14
+ export const EMAIL_MAX_LENGTH = 254; // RFC 5321
15
+ // Name validation
16
+ export const NAME_MIN_LENGTH = 1;
17
+ export const NAME_MAX_LENGTH = 50;
18
+ export const FULL_NAME_MAX_LENGTH = 100;
19
+ // Phone validation
20
+ export const PHONE_MIN_LENGTH = 10;
21
+ export const PHONE_MAX_LENGTH = 15;
22
+ // Address validation
23
+ export const ADDRESS_MIN_LENGTH = 5;
24
+ export const ADDRESS_MAX_LENGTH = 200;
25
+ export const POSTAL_CODE_MAX_LENGTH = 10;
26
+ // Financial validation
27
+ export const AMOUNT_MIN_VALUE = 0.01;
28
+ export const AMOUNT_MAX_VALUE = 999999999.99;
29
+ export const PERCENTAGE_MIN_VALUE = 0;
30
+ export const PERCENTAGE_MAX_VALUE = 100;
31
+ // Generic text validation
32
+ export const TEXT_SHORT_MAX_LENGTH = 50;
33
+ export const TEXT_MEDIUM_MAX_LENGTH = 200;
34
+ export const TEXT_LONG_MAX_LENGTH = 1000;
35
+ /**
36
+ * Consolidated validation rules object for convenience
37
+ * @deprecated Use individual constants instead for better tree-shaking
38
+ */
39
+ export const VALIDATION_RULES = {
40
+ PASSWORD_MIN_LENGTH,
41
+ PASSWORD_MAX_LENGTH,
42
+ TOKEN_MIN_LENGTH,
43
+ TOKEN_MAX_LENGTH,
44
+ EMAIL_MAX_LENGTH,
45
+ NAME_MIN_LENGTH,
46
+ NAME_MAX_LENGTH,
47
+ FULL_NAME_MAX_LENGTH,
48
+ PHONE_MIN_LENGTH,
49
+ PHONE_MAX_LENGTH,
50
+ ADDRESS_MIN_LENGTH,
51
+ ADDRESS_MAX_LENGTH,
52
+ POSTAL_CODE_MAX_LENGTH,
53
+ AMOUNT_MIN_VALUE,
54
+ AMOUNT_MAX_VALUE,
55
+ PERCENTAGE_MIN_VALUE,
56
+ PERCENTAGE_MAX_VALUE,
57
+ TEXT_SHORT_MAX_LENGTH,
58
+ TEXT_MEDIUM_MAX_LENGTH,
59
+ TEXT_LONG_MAX_LENGTH,
60
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Withdrawal-related constants re-exported from transactions.ts
3
+ *
4
+ * This file provides a convenient import path for withdrawal-specific constants
5
+ * that are defined in transactions.ts alongside other transaction types.
6
+ */
7
+ export { WITHDRAWAL_STATUS, WITHDRAWAL_STATUS_LABELS, WITHDRAWAL_TYPE, WITHDRAWAL_TYPE_LABELS, WITHDRAWAL_REASON, WITHDRAWAL_REASON_LABELS, LIQUIDATION_STATUS, LIQUIDATION_STATUS_LABELS, type WithdrawalStatus, type WithdrawalType, type WithdrawalReason, type LiquidationStatus, } from './transactions';
8
+ //# sourceMappingURL=withdrawals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withdrawals.d.ts","sourceRoot":"","sources":["../src/withdrawals.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,eAAe,EACf,sBAAsB,EACtB,iBAAiB,EACjB,wBAAwB,EACxB,kBAAkB,EAClB,yBAAyB,EACzB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,GACvB,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Withdrawal-related constants re-exported from transactions.ts
3
+ *
4
+ * This file provides a convenient import path for withdrawal-specific constants
5
+ * that are defined in transactions.ts alongside other transaction types.
6
+ */
7
+ // Re-export withdrawal constants from transactions.ts
8
+ export { WITHDRAWAL_STATUS, WITHDRAWAL_STATUS_LABELS, WITHDRAWAL_TYPE, WITHDRAWAL_TYPE_LABELS, WITHDRAWAL_REASON, WITHDRAWAL_REASON_LABELS, LIQUIDATION_STATUS, LIQUIDATION_STATUS_LABELS, } from './transactions';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cranberry-money/shared-constants",
3
- "version": "3.0.0",
3
+ "version": "3.0.2",
4
4
  "description": "Shared constants for MyPortfolio platform",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",