@cranberry-money/shared-services 4.0.0 → 8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/package.json +4 -3
  2. package/dist/api/functional-client.d.ts +0 -66
  3. package/dist/api/functional-client.d.ts.map +0 -1
  4. package/dist/api/functional-client.js +0 -165
  5. package/dist/auth/functional/auth-operations.d.ts +0 -116
  6. package/dist/auth/functional/auth-operations.d.ts.map +0 -1
  7. package/dist/auth/functional/auth-operations.js +0 -246
  8. package/dist/auth/functional/auth-state.d.ts +0 -38
  9. package/dist/auth/functional/auth-state.d.ts.map +0 -1
  10. package/dist/auth/functional/auth-state.js +0 -87
  11. package/dist/auth/functional/token-storage.d.ts +0 -44
  12. package/dist/auth/functional/token-storage.d.ts.map +0 -1
  13. package/dist/auth/functional/token-storage.js +0 -178
  14. package/dist/auth/react/AuthProvider.d.ts +0 -92
  15. package/dist/auth/react/AuthProvider.d.ts.map +0 -1
  16. package/dist/auth/react/AuthProvider.js +0 -207
  17. package/dist/integration/blueberry-integration.d.ts +0 -21
  18. package/dist/integration/blueberry-integration.d.ts.map +0 -1
  19. package/dist/integration/blueberry-integration.js +0 -109
  20. package/dist/integration/index.d.ts +0 -8
  21. package/dist/integration/index.d.ts.map +0 -1
  22. package/dist/integration/index.js +0 -18
  23. package/dist/services/accounts.d.ts +0 -220
  24. package/dist/services/accounts.d.ts.map +0 -1
  25. package/dist/services/accounts.js +0 -175
  26. package/dist/services/banks.d.ts +0 -123
  27. package/dist/services/banks.d.ts.map +0 -1
  28. package/dist/services/banks.js +0 -151
  29. package/dist/services/cash-accounts.d.ts +0 -112
  30. package/dist/services/cash-accounts.d.ts.map +0 -1
  31. package/dist/services/cash-accounts.js +0 -222
  32. package/dist/services/documents.d.ts +0 -143
  33. package/dist/services/documents.d.ts.map +0 -1
  34. package/dist/services/documents.js +0 -253
  35. package/dist/services/factories/account-factory.d.ts +0 -16
  36. package/dist/services/factories/account-factory.d.ts.map +0 -1
  37. package/dist/services/factories/account-factory.js +0 -79
  38. package/dist/services/factories/auth-factory.d.ts +0 -23
  39. package/dist/services/factories/auth-factory.d.ts.map +0 -1
  40. package/dist/services/factories/auth-factory.js +0 -75
  41. package/dist/services/factories/bank-factory.d.ts +0 -16
  42. package/dist/services/factories/bank-factory.d.ts.map +0 -1
  43. package/dist/services/factories/bank-factory.js +0 -72
  44. package/dist/services/factories/cash-account-factory.d.ts +0 -16
  45. package/dist/services/factories/cash-account-factory.d.ts.map +0 -1
  46. package/dist/services/factories/cash-account-factory.js +0 -74
  47. package/dist/services/factories/document-factory.d.ts +0 -16
  48. package/dist/services/factories/document-factory.d.ts.map +0 -1
  49. package/dist/services/factories/document-factory.js +0 -85
  50. package/dist/services/factories/index.d.ts +0 -21
  51. package/dist/services/factories/index.d.ts.map +0 -1
  52. package/dist/services/factories/index.js +0 -40
  53. package/dist/services/factories/instrument-factory.d.ts +0 -16
  54. package/dist/services/factories/instrument-factory.d.ts.map +0 -1
  55. package/dist/services/factories/instrument-factory.js +0 -68
  56. package/dist/services/factories/master-factory.d.ts +0 -74
  57. package/dist/services/factories/master-factory.d.ts.map +0 -1
  58. package/dist/services/factories/master-factory.js +0 -183
  59. package/dist/services/factories/portfolio-factory.d.ts +0 -16
  60. package/dist/services/factories/portfolio-factory.d.ts.map +0 -1
  61. package/dist/services/factories/portfolio-factory.js +0 -74
  62. package/dist/services/factories/portfolio-template-factory.d.ts +0 -16
  63. package/dist/services/factories/portfolio-template-factory.d.ts.map +0 -1
  64. package/dist/services/factories/portfolio-template-factory.js +0 -76
  65. package/dist/services/factories/reference-data-factory.d.ts +0 -16
  66. package/dist/services/factories/reference-data-factory.d.ts.map +0 -1
  67. package/dist/services/factories/reference-data-factory.js +0 -86
  68. package/dist/services/factories/tax-residency-factory.d.ts +0 -16
  69. package/dist/services/factories/tax-residency-factory.d.ts.map +0 -1
  70. package/dist/services/factories/tax-residency-factory.js +0 -73
  71. package/dist/services/factories/trade-factory.d.ts +0 -16
  72. package/dist/services/factories/trade-factory.d.ts.map +0 -1
  73. package/dist/services/factories/trade-factory.js +0 -79
  74. package/dist/services/factories/types.d.ts +0 -250
  75. package/dist/services/factories/types.d.ts.map +0 -1
  76. package/dist/services/factories/types.js +0 -32
  77. package/dist/services/factories/withdrawal-factory.d.ts +0 -16
  78. package/dist/services/factories/withdrawal-factory.d.ts.map +0 -1
  79. package/dist/services/factories/withdrawal-factory.js +0 -78
  80. package/dist/services/instruments.d.ts +0 -138
  81. package/dist/services/instruments.d.ts.map +0 -1
  82. package/dist/services/instruments.js +0 -178
  83. package/dist/services/portfolio-templates.d.ts +0 -142
  84. package/dist/services/portfolio-templates.d.ts.map +0 -1
  85. package/dist/services/portfolio-templates.js +0 -201
  86. package/dist/services/portfolios.d.ts +0 -157
  87. package/dist/services/portfolios.d.ts.map +0 -1
  88. package/dist/services/portfolios.js +0 -144
  89. package/dist/services/reference-data.d.ts +0 -185
  90. package/dist/services/reference-data.d.ts.map +0 -1
  91. package/dist/services/reference-data.js +0 -245
  92. package/dist/services/tax-residencies.d.ts +0 -83
  93. package/dist/services/tax-residencies.d.ts.map +0 -1
  94. package/dist/services/tax-residencies.js +0 -179
  95. package/dist/services/trades.d.ts +0 -190
  96. package/dist/services/trades.d.ts.map +0 -1
  97. package/dist/services/trades.js +0 -207
  98. package/dist/services/withdrawals.d.ts +0 -236
  99. package/dist/services/withdrawals.d.ts.map +0 -1
  100. package/dist/services/withdrawals.js +0 -345
@@ -1,109 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getMigrationProgress = exports.enableFunctionalPortfolios = exports.BlueberryApp = exports.BlueberryDashboard = exports.BlueberryAuthProvider = exports.setupBlueberryServices = void 0;
7
- const jsx_runtime_1 = require("react/jsx-runtime");
8
- /**
9
- * Blueberry Dashboard Integration Example
10
- *
11
- * Demonstrates how to integrate the functional architecture with the Blueberry React dashboard.
12
- * Clean, simple setup with pure functional services.
13
- */
14
- const react_1 = __importDefault(require("react"));
15
- const index_1 = require("../index");
16
- // Example of how to set up services in a real application
17
- const setupBlueberryServices = () => {
18
- // Create functional services with explicit configuration
19
- const services = (0, index_1.createWebServiceFactory)('https://api.cranberry.com', {
20
- apiTimeout: 10000,
21
- enableCredentials: true,
22
- });
23
- return {
24
- services,
25
- };
26
- };
27
- exports.setupBlueberryServices = setupBlueberryServices;
28
- // Example React component using the new architecture
29
- const BlueberryAuthProvider = ({ children }) => {
30
- const authState = (0, index_1.useAuthState)();
31
- const authActions = (0, index_1.useAuthActions)();
32
- return ((0, jsx_runtime_1.jsx)("div", { children: authState.isAuthenticated ? ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("p", { children: ["Welcome, ", authState.user?.firstName, "!"] }), (0, jsx_runtime_1.jsx)("button", { onClick: authActions.signout, children: "Sign Out" }), children] })) : ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("p", { children: "Please sign in to continue" }) })) }));
33
- };
34
- exports.BlueberryAuthProvider = BlueberryAuthProvider;
35
- // Example dashboard component showing comprehensive service usage
36
- const BlueberryDashboard = () => {
37
- const authState = (0, index_1.useAuthState)();
38
- const [portfolios, setPortfolios] = react_1.default.useState([]);
39
- const [countries, setCountries] = react_1.default.useState([]);
40
- const [instruments, setInstruments] = react_1.default.useState([]);
41
- const [cashAccounts, setCashAccounts] = react_1.default.useState([]);
42
- const [trades, setTrades] = react_1.default.useState([]);
43
- react_1.default.useEffect(() => {
44
- if (authState.isAuthenticated) {
45
- // Example of how Blueberry would use the comprehensive services
46
- const services = (0, exports.setupBlueberryServices)();
47
- // Load portfolios with advanced features
48
- services.services.portfolio.getPortfolios({
49
- isActive: true,
50
- sortBy: 'totalValue',
51
- sortOrder: 'desc'
52
- }).then(result => {
53
- setPortfolios(result.results);
54
- }).catch(error => {
55
- console.error('Failed to load portfolios:', error);
56
- });
57
- // Load reference data
58
- services.services.referenceData.getAvailableCountries().then((result) => {
59
- setCountries(result.results || []);
60
- }).catch((error) => {
61
- console.error('Failed to load countries:', error);
62
- });
63
- // Search for popular ETFs
64
- services.services.instrument.getETFs({
65
- page_size: 10,
66
- ordering: '-current_price'
67
- }).then((result) => {
68
- setInstruments(result.results);
69
- }).catch((error) => {
70
- console.error('Failed to load ETFs:', error);
71
- });
72
- // Load cash accounts
73
- services.services.cashAccount.getCashAccounts().then((result) => {
74
- setCashAccounts(result.results);
75
- }).catch((error) => {
76
- console.error('Failed to load cash accounts:', error);
77
- });
78
- // Load recent trades
79
- services.services.trade.getTrades({
80
- status: 'EXECUTED'
81
- }).then((result) => {
82
- setTrades(result.results);
83
- }).catch((error) => {
84
- console.error('Failed to load trades:', error);
85
- });
86
- }
87
- }, [authState.isAuthenticated]);
88
- if (!authState.isAuthenticated) {
89
- return (0, jsx_runtime_1.jsx)("div", { children: "Access denied. Please sign in." });
90
- }
91
- return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h1", { children: "Portfolio Dashboard" }), (0, jsx_runtime_1.jsxs)("p", { children: ["Welcome to your portfolio, ", authState.user?.firstName, "!"] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("h2", { children: ["Your Portfolios (", portfolios.length, ")"] }), portfolios.map(portfolio => ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h3", { children: portfolio.name }), (0, jsx_runtime_1.jsxs)("p", { children: ["Value: $", portfolio.totalValue || portfolio.marketValue] })] }, portfolio.id || portfolio.uuid)))] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("h2", { children: ["Cash Accounts (", cashAccounts.length, ")"] }), cashAccounts.slice(0, 3).map(account => ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)("p", { children: [account.currency, ": $", account.balance] }) }, account.uuid)))] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("h2", { children: ["Popular ETFs (", instruments.length, ")"] }), instruments.slice(0, 5).map(instrument => ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("p", { children: [instrument.symbol, " - ", instrument.name] }), (0, jsx_runtime_1.jsxs)("p", { children: ["Price: $", instrument.currentPrice] })] }, instrument.uuid)))] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("h2", { children: ["Recent Trades (", trades.length, ")"] }), trades.map(trade => ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)("p", { children: [trade.type, ": ", trade.quantity, " shares @ $", trade.price] }) }, trade.id)))] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("h2", { children: ["Available Countries (", countries.length, ")"] }), countries.slice(0, 5).map(country => ((0, jsx_runtime_1.jsxs)("div", { children: [country.name, " (", country.code, ")"] }, country.id)))] })] }));
92
- };
93
- exports.BlueberryDashboard = BlueberryDashboard;
94
- // Main app component showing complete integration
95
- const BlueberryApp = () => {
96
- const services = (0, exports.setupBlueberryServices)();
97
- const AuthProvider = services.services.auth.createAuthProvider();
98
- return ((0, jsx_runtime_1.jsx)(AuthProvider, { children: (0, jsx_runtime_1.jsx)(exports.BlueberryAuthProvider, { children: (0, jsx_runtime_1.jsx)(exports.BlueberryDashboard, {}) }) }));
99
- };
100
- exports.BlueberryApp = BlueberryApp;
101
- // Simple functions for demonstration
102
- const enableFunctionalPortfolios = () => {
103
- console.log('Functional portfolios enabled');
104
- };
105
- exports.enableFunctionalPortfolios = enableFunctionalPortfolios;
106
- const getMigrationProgress = () => {
107
- return { progress: 100, status: 'Complete - pure functional architecture' };
108
- };
109
- exports.getMigrationProgress = getMigrationProgress;
@@ -1,8 +0,0 @@
1
- /**
2
- * Integration Utilities Export
3
- *
4
- * Provides integration examples and tools for connecting the functional architecture
5
- * with existing applications like Blueberry dashboard.
6
- */
7
- export { BlueberryApp, BlueberryAuthProvider, BlueberryDashboard, setupBlueberryServices, enableFunctionalPortfolios, getMigrationProgress, } from './blueberry-integration';
8
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/integration/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,YAAY,EACZ,qBAAqB,EACrB,kBAAkB,EAClB,sBAAsB,EACtB,0BAA0B,EAC1B,oBAAoB,GACrB,MAAM,yBAAyB,CAAC"}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- /**
3
- * Integration Utilities Export
4
- *
5
- * Provides integration examples and tools for connecting the functional architecture
6
- * with existing applications like Blueberry dashboard.
7
- */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.getMigrationProgress = exports.enableFunctionalPortfolios = exports.setupBlueberryServices = exports.BlueberryDashboard = exports.BlueberryAuthProvider = exports.BlueberryApp = void 0;
10
- // Blueberry integration
11
- var blueberry_integration_1 = require("./blueberry-integration");
12
- Object.defineProperty(exports, "BlueberryApp", { enumerable: true, get: function () { return blueberry_integration_1.BlueberryApp; } });
13
- Object.defineProperty(exports, "BlueberryAuthProvider", { enumerable: true, get: function () { return blueberry_integration_1.BlueberryAuthProvider; } });
14
- Object.defineProperty(exports, "BlueberryDashboard", { enumerable: true, get: function () { return blueberry_integration_1.BlueberryDashboard; } });
15
- Object.defineProperty(exports, "setupBlueberryServices", { enumerable: true, get: function () { return blueberry_integration_1.setupBlueberryServices; } });
16
- Object.defineProperty(exports, "enableFunctionalPortfolios", { enumerable: true, get: function () { return blueberry_integration_1.enableFunctionalPortfolios; } });
17
- Object.defineProperty(exports, "getMigrationProgress", { enumerable: true, get: function () { return blueberry_integration_1.getMigrationProgress; } });
18
- // Performance benchmarking removed for simplicity
@@ -1,220 +0,0 @@
1
- /**
2
- * Account Services - Pure Functional Implementation
3
- *
4
- * User account, profile, and investment preferences operations as pure functions.
5
- * No global state, no side effects - everything is explicit and testable.
6
- */
7
- import type { ApiClient } from '../api/functional-client';
8
- export interface User {
9
- readonly id: string;
10
- readonly email: string;
11
- readonly firstName: string;
12
- readonly lastName: string;
13
- readonly isVerified: boolean;
14
- readonly isSignupCompleted: boolean;
15
- readonly createdAt: string;
16
- readonly updatedAt: string;
17
- }
18
- export interface UserProfile {
19
- readonly uuid: string;
20
- readonly user: string;
21
- readonly firstName: string;
22
- readonly lastName: string;
23
- readonly dateOfBirth?: string;
24
- readonly phoneNumber?: string;
25
- readonly address?: string;
26
- readonly city?: string;
27
- readonly state?: string;
28
- readonly postalCode?: string;
29
- readonly country?: string;
30
- readonly isProfileComplete: boolean;
31
- readonly createdAt: string;
32
- readonly updatedAt: string;
33
- }
34
- export interface UpdateProfilePayload {
35
- readonly firstName?: string;
36
- readonly lastName?: string;
37
- readonly email?: string;
38
- readonly dateOfBirth?: string;
39
- readonly phoneNumber?: string;
40
- readonly address?: string;
41
- readonly city?: string;
42
- readonly state?: string;
43
- readonly postalCode?: string;
44
- readonly country?: string;
45
- }
46
- export interface UserProfileCompletionPayload {
47
- readonly dateOfBirth: string;
48
- readonly phoneNumber: string;
49
- readonly address: string;
50
- readonly city: string;
51
- readonly state: string;
52
- readonly postalCode: string;
53
- readonly country: string;
54
- }
55
- export interface Account {
56
- readonly uuid: string;
57
- readonly accountNumber?: string;
58
- readonly accountType: string;
59
- readonly activationDate?: string;
60
- readonly name?: string;
61
- readonly userProfile?: string;
62
- readonly isActive: boolean;
63
- readonly createdAt: string;
64
- readonly updatedAt: string;
65
- }
66
- export interface CreateAccountPayload {
67
- readonly accountType: string;
68
- readonly name: string;
69
- readonly userProfile: string;
70
- }
71
- export interface UpdateAccountPayload {
72
- readonly accountType?: string;
73
- readonly name?: string;
74
- readonly isActive?: boolean;
75
- }
76
- export type InvestmentHorizon = 'SHORT_TERM' | 'MEDIUM_TERM' | 'LONG_TERM';
77
- export type RiskTolerance = 'CONSERVATIVE' | 'MODERATE' | 'AGGRESSIVE';
78
- export type InvestmentExperience = 'NONE' | 'LIMITED' | 'GOOD' | 'EXTENSIVE';
79
- export interface InvestmentPreference {
80
- readonly uuid: string;
81
- readonly userProfile: string;
82
- readonly investmentHorizon: InvestmentHorizon;
83
- readonly riskTolerance: RiskTolerance;
84
- readonly investmentExperience: InvestmentExperience;
85
- readonly investmentAmount: string;
86
- readonly sourceOfFunds: string[];
87
- readonly createdAt: string;
88
- readonly updatedAt: string;
89
- }
90
- export interface CreateInvestmentPreferencePayload {
91
- readonly userProfile: string;
92
- readonly investmentHorizon: InvestmentHorizon;
93
- readonly riskTolerance: RiskTolerance;
94
- readonly investmentExperience: InvestmentExperience;
95
- readonly investmentAmount: number | string;
96
- readonly sourceOfFunds: string[];
97
- }
98
- export interface UpdateInvestmentPreferencePayload {
99
- readonly investmentHorizon?: InvestmentHorizon;
100
- readonly riskTolerance?: RiskTolerance;
101
- readonly investmentExperience?: InvestmentExperience;
102
- readonly investmentAmount?: number | string;
103
- readonly sourceOfFunds?: string[];
104
- }
105
- export interface PaginatedUserProfiles {
106
- readonly results: UserProfile[];
107
- readonly count: number;
108
- readonly next: string | null;
109
- readonly previous: string | null;
110
- }
111
- export interface PaginatedAccounts {
112
- readonly results: Account[];
113
- readonly count: number;
114
- readonly next: string | null;
115
- readonly previous: string | null;
116
- }
117
- export interface PaginatedInvestmentPreferences {
118
- readonly results: InvestmentPreference[];
119
- readonly count: number;
120
- readonly next: string | null;
121
- readonly previous: string | null;
122
- }
123
- export declare const getUserProfile: ({ apiClient }: {
124
- apiClient: ApiClient;
125
- }) => Promise<User>;
126
- export declare const updateUserProfile: ({ apiClient }: {
127
- apiClient: ApiClient;
128
- }, data: UpdateProfilePayload) => Promise<User>;
129
- export declare const deleteUserAccount: ({ apiClient }: {
130
- apiClient: ApiClient;
131
- }) => Promise<void>;
132
- export declare const getUserProfiles: ({ apiClient }: {
133
- apiClient: ApiClient;
134
- }) => Promise<PaginatedUserProfiles>;
135
- export declare const createUserProfile: ({ apiClient }: {
136
- apiClient: ApiClient;
137
- }, data: UpdateProfilePayload) => Promise<UserProfile>;
138
- export declare const updateUserProfileById: ({ apiClient }: {
139
- apiClient: ApiClient;
140
- }, uuid: string, data: UpdateProfilePayload) => Promise<UserProfile>;
141
- export declare const updateUserProfileCompletion: ({ apiClient }: {
142
- apiClient: ApiClient;
143
- }, uuid: string, data: UserProfileCompletionPayload) => Promise<UserProfile>;
144
- export declare const getAccounts: ({ apiClient }: {
145
- apiClient: ApiClient;
146
- }) => Promise<PaginatedAccounts>;
147
- export declare const getUserAccounts: ({ apiClient }: {
148
- apiClient: ApiClient;
149
- }) => Promise<Account[]>;
150
- export declare const getAccount: ({ apiClient }: {
151
- apiClient: ApiClient;
152
- }, uuid: string) => Promise<Account>;
153
- export declare const createAccount: ({ apiClient }: {
154
- apiClient: ApiClient;
155
- }, data: CreateAccountPayload) => Promise<Account>;
156
- export declare const updateAccount: ({ apiClient }: {
157
- apiClient: ApiClient;
158
- }, uuid: string, data: UpdateAccountPayload) => Promise<Account>;
159
- export declare const getInvestmentPreferences: ({ apiClient }: {
160
- apiClient: ApiClient;
161
- }) => Promise<PaginatedInvestmentPreferences>;
162
- export declare const getInvestmentPreference: ({ apiClient }: {
163
- apiClient: ApiClient;
164
- }, uuid: string) => Promise<InvestmentPreference>;
165
- export declare const createInvestmentPreference: ({ apiClient }: {
166
- apiClient: ApiClient;
167
- }, data: CreateInvestmentPreferencePayload) => Promise<InvestmentPreference>;
168
- export declare const updateInvestmentPreference: ({ apiClient }: {
169
- apiClient: ApiClient;
170
- }, uuid: string, data: UpdateInvestmentPreferencePayload) => Promise<InvestmentPreference>;
171
- export declare const deleteInvestmentPreference: ({ apiClient }: {
172
- apiClient: ApiClient;
173
- }, uuid: string) => Promise<void>;
174
- export declare const SOURCE_OF_FUNDS: {
175
- readonly SALARY: "salary";
176
- readonly SAVINGS: "savings";
177
- readonly INHERITANCE: "inheritance";
178
- readonly GIFT: "gift";
179
- readonly OTHER: "other";
180
- };
181
- export declare const SOURCE_OF_FUNDS_LABELS: {
182
- readonly salary: "Salary";
183
- readonly savings: "Savings";
184
- readonly inheritance: "Inheritance";
185
- readonly gift: "Gift";
186
- readonly other: "Other";
187
- };
188
- export declare const SOURCE_OF_FUNDS_OPTIONS: ({
189
- value: "salary";
190
- label: "Salary";
191
- } | {
192
- value: "savings";
193
- label: "Savings";
194
- } | {
195
- value: "inheritance";
196
- label: "Inheritance";
197
- } | {
198
- value: "gift";
199
- label: "Gift";
200
- } | {
201
- value: "other";
202
- label: "Other";
203
- })[];
204
- export declare const INVESTMENT_HORIZON_LABELS: {
205
- readonly SHORT_TERM: "Short Term (0-2 years)";
206
- readonly MEDIUM_TERM: "Medium Term (3-5 years)";
207
- readonly LONG_TERM: "Long Term (5+ years)";
208
- };
209
- export declare const RISK_TOLERANCE_LABELS: {
210
- readonly CONSERVATIVE: "Conservative";
211
- readonly MODERATE: "Moderate";
212
- readonly AGGRESSIVE: "Aggressive";
213
- };
214
- export declare const INVESTMENT_EXPERIENCE_LABELS: {
215
- readonly NONE: "No Experience";
216
- readonly LIMITED: "Limited Experience";
217
- readonly GOOD: "Good Experience";
218
- readonly EXTENSIVE: "Extensive Experience";
219
- };
220
- //# sourceMappingURL=accounts.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../src/services/accounts.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAG1D,MAAM,WAAW,IAAI;IACnB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,OAAO,CAA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C,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAClC,eAAe;IAAE,SAAS,EAAE,SAAS,CAAA;CAAE,EACvC,MAAM,MAAM,KACX,OAAO,CAAC,oBAAoB,CAK9B,CAAC;AAEF,eAAO,MAAM,0BAA0B,GACrC,eAAe;IAAE,SAAS,EAAE,SAAS,CAAA;CAAE,EACvC,MAAM,iCAAiC,KACtC,OAAO,CAAC,oBAAoB,CAwB9B,CAAC;AAEF,eAAO,MAAM,0BAA0B,GACrC,eAAe;IAAE,SAAS,EAAE,SAAS,CAAA;CAAE,EACvC,MAAM,MAAM,EACZ,MAAM,iCAAiC,KACtC,OAAO,CAAC,oBAAoB,CAW9B,CAAC;AAEF,eAAO,MAAM,0BAA0B,GACrC,eAAe;IAAE,SAAS,EAAE,SAAS,CAAA;CAAE,EACvC,MAAM,MAAM,KACX,OAAO,CAAC,IAAI,CAKd,CAAC;AAGF,eAAO,MAAM,eAAe;;;;;;CAMlB,CAAC;AAEX,eAAO,MAAM,sBAAsB;;;;;;CAMzB,CAAC;AAEX,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;IAMnC,CAAC;AAEF,eAAO,MAAM,yBAAyB;;;;CAI5B,CAAC;AAEX,eAAO,MAAM,qBAAqB;;;;CAIxB,CAAC;AAEX,eAAO,MAAM,4BAA4B;;;;;CAK/B,CAAC"}
@@ -1,175 +0,0 @@
1
- "use strict";
2
- /**
3
- * Account Services - Pure Functional Implementation
4
- *
5
- * User account, profile, and investment preferences operations as pure functions.
6
- * No global state, no side effects - everything is explicit and testable.
7
- */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.INVESTMENT_EXPERIENCE_LABELS = exports.RISK_TOLERANCE_LABELS = exports.INVESTMENT_HORIZON_LABELS = exports.SOURCE_OF_FUNDS_OPTIONS = exports.SOURCE_OF_FUNDS_LABELS = exports.SOURCE_OF_FUNDS = exports.deleteInvestmentPreference = exports.updateInvestmentPreference = exports.createInvestmentPreference = exports.getInvestmentPreference = exports.getInvestmentPreferences = exports.updateAccount = exports.createAccount = exports.getAccount = exports.getUserAccounts = exports.getAccounts = exports.updateUserProfileCompletion = exports.updateUserProfileById = exports.createUserProfile = exports.getUserProfiles = exports.deleteUserAccount = exports.updateUserProfile = exports.getUserProfile = void 0;
10
- // User operations with explicit dependencies
11
- const getUserProfile = async ({ apiClient }) => {
12
- return apiClient.get('/api/users/profile/');
13
- };
14
- exports.getUserProfile = getUserProfile;
15
- const updateUserProfile = async ({ apiClient }, data) => {
16
- return apiClient.patch('/api/users/profile/', data);
17
- };
18
- exports.updateUserProfile = updateUserProfile;
19
- const deleteUserAccount = async ({ apiClient }) => {
20
- await apiClient.delete('/api/users/profile/');
21
- };
22
- exports.deleteUserAccount = deleteUserAccount;
23
- // User profile operations
24
- const getUserProfiles = async ({ apiClient }) => {
25
- return apiClient.get('/api/user-profiles/');
26
- };
27
- exports.getUserProfiles = getUserProfiles;
28
- const createUserProfile = async ({ apiClient }, data) => {
29
- return apiClient.post('/api/user-profiles/', data);
30
- };
31
- exports.createUserProfile = createUserProfile;
32
- const updateUserProfileById = async ({ apiClient }, uuid, data) => {
33
- if (!uuid?.trim()) {
34
- throw new Error('User profile UUID is required');
35
- }
36
- return apiClient.patch(`/api/user-profiles/${uuid}/`, data);
37
- };
38
- exports.updateUserProfileById = updateUserProfileById;
39
- const updateUserProfileCompletion = async ({ apiClient }, uuid, data) => {
40
- if (!uuid?.trim()) {
41
- throw new Error('User profile UUID is required');
42
- }
43
- return apiClient.patch(`/api/user-profiles/${uuid}/`, data);
44
- };
45
- exports.updateUserProfileCompletion = updateUserProfileCompletion;
46
- // Account operations with explicit dependencies
47
- const getAccounts = async ({ apiClient }) => {
48
- return apiClient.get('/api/accounts/');
49
- };
50
- exports.getAccounts = getAccounts;
51
- const getUserAccounts = async ({ apiClient }) => {
52
- const response = await (0, exports.getAccounts)({ apiClient });
53
- return response.results;
54
- };
55
- exports.getUserAccounts = getUserAccounts;
56
- const getAccount = async ({ apiClient }, uuid) => {
57
- if (!uuid?.trim()) {
58
- throw new Error('Account UUID is required');
59
- }
60
- return apiClient.get(`/api/accounts/${uuid}/`);
61
- };
62
- exports.getAccount = getAccount;
63
- const createAccount = async ({ apiClient }, data) => {
64
- // Validation
65
- if (!data.accountType?.trim()) {
66
- throw new Error('Account type is required');
67
- }
68
- if (!data.name?.trim()) {
69
- throw new Error('Account name is required');
70
- }
71
- if (!data.userProfile?.trim()) {
72
- throw new Error('User profile UUID is required');
73
- }
74
- return apiClient.post('/api/accounts/', data);
75
- };
76
- exports.createAccount = createAccount;
77
- const updateAccount = async ({ apiClient }, uuid, data) => {
78
- if (!uuid?.trim()) {
79
- throw new Error('Account UUID is required');
80
- }
81
- return apiClient.patch(`/api/accounts/${uuid}/`, data);
82
- };
83
- exports.updateAccount = updateAccount;
84
- // Investment preferences operations
85
- const getInvestmentPreferences = async ({ apiClient }) => {
86
- return apiClient.get('/api/investment-preferences/');
87
- };
88
- exports.getInvestmentPreferences = getInvestmentPreferences;
89
- const getInvestmentPreference = async ({ apiClient }, uuid) => {
90
- if (!uuid?.trim()) {
91
- throw new Error('Investment preference UUID is required');
92
- }
93
- return apiClient.get(`/api/investment-preferences/${uuid}/`);
94
- };
95
- exports.getInvestmentPreference = getInvestmentPreference;
96
- const createInvestmentPreference = async ({ apiClient }, data) => {
97
- // Validation
98
- if (!data.userProfile?.trim()) {
99
- throw new Error('User profile UUID is required');
100
- }
101
- if (!data.investmentHorizon) {
102
- throw new Error('Investment horizon is required');
103
- }
104
- if (!data.riskTolerance) {
105
- throw new Error('Risk tolerance is required');
106
- }
107
- if (!data.investmentExperience) {
108
- throw new Error('Investment experience is required');
109
- }
110
- if (!data.sourceOfFunds?.length) {
111
- throw new Error('At least one source of funds is required');
112
- }
113
- const payload = {
114
- ...data,
115
- investmentAmount: String(data.investmentAmount),
116
- };
117
- return apiClient.post('/api/investment-preferences/', payload);
118
- };
119
- exports.createInvestmentPreference = createInvestmentPreference;
120
- const updateInvestmentPreference = async ({ apiClient }, uuid, data) => {
121
- if (!uuid?.trim()) {
122
- throw new Error('Investment preference UUID is required');
123
- }
124
- const payload = { ...data };
125
- if (data.investmentAmount !== undefined) {
126
- payload.investmentAmount = String(data.investmentAmount);
127
- }
128
- return apiClient.patch(`/api/investment-preferences/${uuid}/`, payload);
129
- };
130
- exports.updateInvestmentPreference = updateInvestmentPreference;
131
- const deleteInvestmentPreference = async ({ apiClient }, uuid) => {
132
- if (!uuid?.trim()) {
133
- throw new Error('Investment preference UUID is required');
134
- }
135
- await apiClient.delete(`/api/investment-preferences/${uuid}/`);
136
- };
137
- exports.deleteInvestmentPreference = deleteInvestmentPreference;
138
- // Constants
139
- exports.SOURCE_OF_FUNDS = {
140
- SALARY: 'salary',
141
- SAVINGS: 'savings',
142
- INHERITANCE: 'inheritance',
143
- GIFT: 'gift',
144
- OTHER: 'other',
145
- };
146
- exports.SOURCE_OF_FUNDS_LABELS = {
147
- salary: 'Salary',
148
- savings: 'Savings',
149
- inheritance: 'Inheritance',
150
- gift: 'Gift',
151
- other: 'Other',
152
- };
153
- exports.SOURCE_OF_FUNDS_OPTIONS = [
154
- { value: exports.SOURCE_OF_FUNDS.SALARY, label: exports.SOURCE_OF_FUNDS_LABELS.salary },
155
- { value: exports.SOURCE_OF_FUNDS.SAVINGS, label: exports.SOURCE_OF_FUNDS_LABELS.savings },
156
- { value: exports.SOURCE_OF_FUNDS.INHERITANCE, label: exports.SOURCE_OF_FUNDS_LABELS.inheritance },
157
- { value: exports.SOURCE_OF_FUNDS.GIFT, label: exports.SOURCE_OF_FUNDS_LABELS.gift },
158
- { value: exports.SOURCE_OF_FUNDS.OTHER, label: exports.SOURCE_OF_FUNDS_LABELS.other },
159
- ];
160
- exports.INVESTMENT_HORIZON_LABELS = {
161
- SHORT_TERM: 'Short Term (0-2 years)',
162
- MEDIUM_TERM: 'Medium Term (3-5 years)',
163
- LONG_TERM: 'Long Term (5+ years)',
164
- };
165
- exports.RISK_TOLERANCE_LABELS = {
166
- CONSERVATIVE: 'Conservative',
167
- MODERATE: 'Moderate',
168
- AGGRESSIVE: 'Aggressive',
169
- };
170
- exports.INVESTMENT_EXPERIENCE_LABELS = {
171
- NONE: 'No Experience',
172
- LIMITED: 'Limited Experience',
173
- GOOD: 'Good Experience',
174
- EXTENSIVE: 'Extensive Experience',
175
- };
@@ -1,123 +0,0 @@
1
- /**
2
- * Bank Services - Pure Functional Implementation
3
- *
4
- * Bank account management operations as pure functions with explicit dependencies.
5
- * No global state, no side effects - everything is explicit and testable.
6
- */
7
- import type { ApiClient } from '../api/functional-client';
8
- export type CurrencyCode = 'AUD' | 'USD';
9
- export type AccountType = 'SAVINGS' | 'CHECKING' | 'BUSINESS';
10
- export interface BankAccount {
11
- readonly uuid: string;
12
- readonly account: string;
13
- readonly bankName: string;
14
- readonly branchName?: string;
15
- readonly accountNumber: string;
16
- readonly bsb: string;
17
- readonly accountName: string;
18
- readonly accountType: AccountType;
19
- readonly currency: CurrencyCode;
20
- readonly swiftCode?: string;
21
- readonly iban?: string;
22
- readonly isVerified: boolean;
23
- readonly verificationDate?: string;
24
- readonly isPrimary: boolean;
25
- readonly isActive: boolean;
26
- readonly notes?: string;
27
- readonly createdAt: string;
28
- readonly updatedAt: string;
29
- }
30
- export interface CreateBankAccountPayload {
31
- readonly account: string;
32
- readonly bankName: string;
33
- readonly branchName?: string;
34
- readonly accountNumber: string;
35
- readonly bsb: string;
36
- readonly accountName: string;
37
- readonly accountType: AccountType;
38
- readonly currency: CurrencyCode;
39
- readonly swiftCode?: string;
40
- readonly iban?: string;
41
- readonly notes?: string;
42
- }
43
- export interface UpdateBankAccountPayload {
44
- readonly bankName?: string;
45
- readonly branchName?: string;
46
- readonly accountName?: string;
47
- readonly accountType?: AccountType;
48
- readonly currency?: CurrencyCode;
49
- readonly swiftCode?: string;
50
- readonly iban?: string;
51
- readonly isPrimary?: boolean;
52
- readonly isActive?: boolean;
53
- readonly notes?: string;
54
- }
55
- export interface BankAccountFilters {
56
- readonly account?: string;
57
- readonly userProfile?: string;
58
- readonly bankName?: string;
59
- readonly accountType?: AccountType;
60
- readonly currency?: CurrencyCode;
61
- readonly isVerified?: boolean;
62
- readonly isPrimary?: boolean;
63
- readonly isActive?: boolean;
64
- readonly ordering?: string;
65
- }
66
- export interface PaginatedBankAccounts {
67
- readonly results: BankAccount[];
68
- readonly count: number;
69
- readonly next: string | null;
70
- readonly previous: string | null;
71
- }
72
- export declare const getUserBankAccounts: ({ apiClient }: {
73
- apiClient: ApiClient;
74
- }, userProfileUuid: string) => Promise<PaginatedBankAccounts>;
75
- export declare const getBankAccounts: ({ apiClient }: {
76
- apiClient: ApiClient;
77
- }, filters?: BankAccountFilters) => Promise<PaginatedBankAccounts>;
78
- export declare const getBankAccount: ({ apiClient }: {
79
- apiClient: ApiClient;
80
- }, uuid: string) => Promise<BankAccount>;
81
- export declare const createBankAccount: ({ apiClient }: {
82
- apiClient: ApiClient;
83
- }, data: CreateBankAccountPayload) => Promise<BankAccount>;
84
- export declare const updateBankAccount: ({ apiClient }: {
85
- apiClient: ApiClient;
86
- }, uuid: string, data: UpdateBankAccountPayload) => Promise<BankAccount>;
87
- export declare const deleteBankAccount: ({ apiClient }: {
88
- apiClient: ApiClient;
89
- }, uuid: string) => Promise<void>;
90
- export declare const verifyBankAccount: ({ apiClient }: {
91
- apiClient: ApiClient;
92
- }, uuid: string) => Promise<BankAccount>;
93
- export declare const setPrimaryBankAccount: ({ apiClient }: {
94
- apiClient: ApiClient;
95
- }, uuid: string) => Promise<BankAccount>;
96
- export declare const getActiveBankAccounts: ({ apiClient }: {
97
- apiClient: ApiClient;
98
- }, accountUuid?: string) => Promise<PaginatedBankAccounts>;
99
- export declare const getPrimaryBankAccount: ({ apiClient }: {
100
- apiClient: ApiClient;
101
- }, accountUuid: string) => Promise<BankAccount | null>;
102
- export declare const getVerifiedBankAccounts: ({ apiClient }: {
103
- apiClient: ApiClient;
104
- }, accountUuid?: string) => Promise<PaginatedBankAccounts>;
105
- export declare const ACCOUNT_TYPES: {
106
- readonly SAVINGS: "SAVINGS";
107
- readonly CHECKING: "CHECKING";
108
- readonly BUSINESS: "BUSINESS";
109
- };
110
- export declare const ACCOUNT_TYPE_LABELS: {
111
- readonly SAVINGS: "Savings Account";
112
- readonly CHECKING: "Checking Account";
113
- readonly BUSINESS: "Business Account";
114
- };
115
- export declare const SUPPORTED_CURRENCIES: {
116
- readonly AUD: "AUD";
117
- readonly USD: "USD";
118
- };
119
- export declare const CURRENCY_LABELS: {
120
- readonly AUD: "Australian Dollar";
121
- readonly USD: "United States Dollar";
122
- };
123
- //# sourceMappingURL=banks.d.ts.map