@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.
- package/package.json +4 -3
- package/dist/api/functional-client.d.ts +0 -66
- package/dist/api/functional-client.d.ts.map +0 -1
- package/dist/api/functional-client.js +0 -165
- package/dist/auth/functional/auth-operations.d.ts +0 -116
- package/dist/auth/functional/auth-operations.d.ts.map +0 -1
- package/dist/auth/functional/auth-operations.js +0 -246
- package/dist/auth/functional/auth-state.d.ts +0 -38
- package/dist/auth/functional/auth-state.d.ts.map +0 -1
- package/dist/auth/functional/auth-state.js +0 -87
- package/dist/auth/functional/token-storage.d.ts +0 -44
- package/dist/auth/functional/token-storage.d.ts.map +0 -1
- package/dist/auth/functional/token-storage.js +0 -178
- package/dist/auth/react/AuthProvider.d.ts +0 -92
- package/dist/auth/react/AuthProvider.d.ts.map +0 -1
- package/dist/auth/react/AuthProvider.js +0 -207
- package/dist/integration/blueberry-integration.d.ts +0 -21
- package/dist/integration/blueberry-integration.d.ts.map +0 -1
- package/dist/integration/blueberry-integration.js +0 -109
- package/dist/integration/index.d.ts +0 -8
- package/dist/integration/index.d.ts.map +0 -1
- package/dist/integration/index.js +0 -18
- package/dist/services/accounts.d.ts +0 -220
- package/dist/services/accounts.d.ts.map +0 -1
- package/dist/services/accounts.js +0 -175
- package/dist/services/banks.d.ts +0 -123
- package/dist/services/banks.d.ts.map +0 -1
- package/dist/services/banks.js +0 -151
- package/dist/services/cash-accounts.d.ts +0 -112
- package/dist/services/cash-accounts.d.ts.map +0 -1
- package/dist/services/cash-accounts.js +0 -222
- package/dist/services/documents.d.ts +0 -143
- package/dist/services/documents.d.ts.map +0 -1
- package/dist/services/documents.js +0 -253
- package/dist/services/factories/account-factory.d.ts +0 -16
- package/dist/services/factories/account-factory.d.ts.map +0 -1
- package/dist/services/factories/account-factory.js +0 -79
- package/dist/services/factories/auth-factory.d.ts +0 -23
- package/dist/services/factories/auth-factory.d.ts.map +0 -1
- package/dist/services/factories/auth-factory.js +0 -75
- package/dist/services/factories/bank-factory.d.ts +0 -16
- package/dist/services/factories/bank-factory.d.ts.map +0 -1
- package/dist/services/factories/bank-factory.js +0 -72
- package/dist/services/factories/cash-account-factory.d.ts +0 -16
- package/dist/services/factories/cash-account-factory.d.ts.map +0 -1
- package/dist/services/factories/cash-account-factory.js +0 -74
- package/dist/services/factories/document-factory.d.ts +0 -16
- package/dist/services/factories/document-factory.d.ts.map +0 -1
- package/dist/services/factories/document-factory.js +0 -85
- package/dist/services/factories/index.d.ts +0 -21
- package/dist/services/factories/index.d.ts.map +0 -1
- package/dist/services/factories/index.js +0 -40
- package/dist/services/factories/instrument-factory.d.ts +0 -16
- package/dist/services/factories/instrument-factory.d.ts.map +0 -1
- package/dist/services/factories/instrument-factory.js +0 -68
- package/dist/services/factories/master-factory.d.ts +0 -74
- package/dist/services/factories/master-factory.d.ts.map +0 -1
- package/dist/services/factories/master-factory.js +0 -183
- package/dist/services/factories/portfolio-factory.d.ts +0 -16
- package/dist/services/factories/portfolio-factory.d.ts.map +0 -1
- package/dist/services/factories/portfolio-factory.js +0 -74
- package/dist/services/factories/portfolio-template-factory.d.ts +0 -16
- package/dist/services/factories/portfolio-template-factory.d.ts.map +0 -1
- package/dist/services/factories/portfolio-template-factory.js +0 -76
- package/dist/services/factories/reference-data-factory.d.ts +0 -16
- package/dist/services/factories/reference-data-factory.d.ts.map +0 -1
- package/dist/services/factories/reference-data-factory.js +0 -86
- package/dist/services/factories/tax-residency-factory.d.ts +0 -16
- package/dist/services/factories/tax-residency-factory.d.ts.map +0 -1
- package/dist/services/factories/tax-residency-factory.js +0 -73
- package/dist/services/factories/trade-factory.d.ts +0 -16
- package/dist/services/factories/trade-factory.d.ts.map +0 -1
- package/dist/services/factories/trade-factory.js +0 -79
- package/dist/services/factories/types.d.ts +0 -250
- package/dist/services/factories/types.d.ts.map +0 -1
- package/dist/services/factories/types.js +0 -32
- package/dist/services/factories/withdrawal-factory.d.ts +0 -16
- package/dist/services/factories/withdrawal-factory.d.ts.map +0 -1
- package/dist/services/factories/withdrawal-factory.js +0 -78
- package/dist/services/instruments.d.ts +0 -138
- package/dist/services/instruments.d.ts.map +0 -1
- package/dist/services/instruments.js +0 -178
- package/dist/services/portfolio-templates.d.ts +0 -142
- package/dist/services/portfolio-templates.d.ts.map +0 -1
- package/dist/services/portfolio-templates.js +0 -201
- package/dist/services/portfolios.d.ts +0 -157
- package/dist/services/portfolios.d.ts.map +0 -1
- package/dist/services/portfolios.js +0 -144
- package/dist/services/reference-data.d.ts +0 -185
- package/dist/services/reference-data.d.ts.map +0 -1
- package/dist/services/reference-data.js +0 -245
- package/dist/services/tax-residencies.d.ts +0 -83
- package/dist/services/tax-residencies.d.ts.map +0 -1
- package/dist/services/tax-residencies.js +0 -179
- package/dist/services/trades.d.ts +0 -190
- package/dist/services/trades.d.ts.map +0 -1
- package/dist/services/trades.js +0 -207
- package/dist/services/withdrawals.d.ts +0 -236
- package/dist/services/withdrawals.d.ts.map +0 -1
- package/dist/services/withdrawals.js +0 -345
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Reference Data Services - Pure Functional Implementation
|
|
3
|
-
*
|
|
4
|
-
* Static reference data (countries, industries, sectors, etc.) 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 Country {
|
|
9
|
-
readonly uuid: string;
|
|
10
|
-
readonly name: string;
|
|
11
|
-
readonly code: string;
|
|
12
|
-
readonly code3?: string;
|
|
13
|
-
readonly numericCode?: string;
|
|
14
|
-
readonly isAvailable: boolean;
|
|
15
|
-
readonly createdAt: string;
|
|
16
|
-
readonly updatedAt: string;
|
|
17
|
-
}
|
|
18
|
-
export interface Industry {
|
|
19
|
-
readonly uuid: string;
|
|
20
|
-
readonly name: string;
|
|
21
|
-
readonly description?: string;
|
|
22
|
-
readonly code?: string;
|
|
23
|
-
readonly isActive: boolean;
|
|
24
|
-
readonly createdAt: string;
|
|
25
|
-
readonly updatedAt: string;
|
|
26
|
-
}
|
|
27
|
-
export interface Sector {
|
|
28
|
-
readonly uuid: string;
|
|
29
|
-
readonly name: string;
|
|
30
|
-
readonly industry: string;
|
|
31
|
-
readonly industryName?: string;
|
|
32
|
-
readonly description?: string;
|
|
33
|
-
readonly code?: string;
|
|
34
|
-
readonly isActive: boolean;
|
|
35
|
-
readonly createdAt: string;
|
|
36
|
-
readonly updatedAt: string;
|
|
37
|
-
}
|
|
38
|
-
export interface StockExchange {
|
|
39
|
-
readonly uuid: string;
|
|
40
|
-
readonly name: string;
|
|
41
|
-
readonly code: string;
|
|
42
|
-
readonly mic?: string;
|
|
43
|
-
readonly country: string;
|
|
44
|
-
readonly countryName?: string;
|
|
45
|
-
readonly timezone?: string;
|
|
46
|
-
readonly isActive: boolean;
|
|
47
|
-
readonly createdAt: string;
|
|
48
|
-
readonly updatedAt: string;
|
|
49
|
-
}
|
|
50
|
-
export interface PaginatedCountries {
|
|
51
|
-
readonly results: Country[];
|
|
52
|
-
readonly count: number;
|
|
53
|
-
readonly next: string | null;
|
|
54
|
-
readonly previous: string | null;
|
|
55
|
-
}
|
|
56
|
-
export interface PaginatedIndustries {
|
|
57
|
-
readonly results: Industry[];
|
|
58
|
-
readonly count: number;
|
|
59
|
-
readonly next: string | null;
|
|
60
|
-
readonly previous: string | null;
|
|
61
|
-
}
|
|
62
|
-
export interface PaginatedSectors {
|
|
63
|
-
readonly results: Sector[];
|
|
64
|
-
readonly count: number;
|
|
65
|
-
readonly next: string | null;
|
|
66
|
-
readonly previous: string | null;
|
|
67
|
-
}
|
|
68
|
-
export interface PaginatedStockExchanges {
|
|
69
|
-
readonly results: StockExchange[];
|
|
70
|
-
readonly count: number;
|
|
71
|
-
readonly next: string | null;
|
|
72
|
-
readonly previous: string | null;
|
|
73
|
-
}
|
|
74
|
-
export interface CountryFilters {
|
|
75
|
-
readonly name?: string;
|
|
76
|
-
readonly code?: string;
|
|
77
|
-
readonly isAvailable?: boolean;
|
|
78
|
-
readonly search?: string;
|
|
79
|
-
readonly ordering?: string;
|
|
80
|
-
readonly page?: number;
|
|
81
|
-
readonly pageSize?: number;
|
|
82
|
-
}
|
|
83
|
-
export interface IndustryFilters {
|
|
84
|
-
readonly name?: string;
|
|
85
|
-
readonly code?: string;
|
|
86
|
-
readonly isActive?: boolean;
|
|
87
|
-
readonly search?: string;
|
|
88
|
-
readonly ordering?: string;
|
|
89
|
-
readonly page?: number;
|
|
90
|
-
readonly pageSize?: number;
|
|
91
|
-
}
|
|
92
|
-
export interface SectorFilters {
|
|
93
|
-
readonly name?: string;
|
|
94
|
-
readonly code?: string;
|
|
95
|
-
readonly industry?: string;
|
|
96
|
-
readonly isActive?: boolean;
|
|
97
|
-
readonly search?: string;
|
|
98
|
-
readonly ordering?: string;
|
|
99
|
-
readonly page?: number;
|
|
100
|
-
readonly pageSize?: number;
|
|
101
|
-
}
|
|
102
|
-
export interface StockExchangeFilters {
|
|
103
|
-
readonly name?: string;
|
|
104
|
-
readonly code?: string;
|
|
105
|
-
readonly country?: string;
|
|
106
|
-
readonly isActive?: boolean;
|
|
107
|
-
readonly search?: string;
|
|
108
|
-
readonly ordering?: string;
|
|
109
|
-
readonly page?: number;
|
|
110
|
-
readonly pageSize?: number;
|
|
111
|
-
}
|
|
112
|
-
export declare const getCountries: ({ apiClient }: {
|
|
113
|
-
apiClient: ApiClient;
|
|
114
|
-
}, filters?: CountryFilters) => Promise<PaginatedCountries>;
|
|
115
|
-
export declare const getCountry: ({ apiClient }: {
|
|
116
|
-
apiClient: ApiClient;
|
|
117
|
-
}, uuid: string) => Promise<Country>;
|
|
118
|
-
export declare const getAvailableCountries: ({ apiClient }: {
|
|
119
|
-
apiClient: ApiClient;
|
|
120
|
-
}, filters?: Omit<CountryFilters, "isAvailable">) => Promise<PaginatedCountries>;
|
|
121
|
-
export declare const searchCountries: ({ apiClient }: {
|
|
122
|
-
apiClient: ApiClient;
|
|
123
|
-
}, searchTerm: string, filters?: Omit<CountryFilters, "search">) => Promise<PaginatedCountries>;
|
|
124
|
-
export declare const getCountryByCode: ({ apiClient }: {
|
|
125
|
-
apiClient: ApiClient;
|
|
126
|
-
}, code: string) => Promise<Country | null>;
|
|
127
|
-
export declare const getIndustries: ({ apiClient }: {
|
|
128
|
-
apiClient: ApiClient;
|
|
129
|
-
}, filters?: IndustryFilters) => Promise<PaginatedIndustries>;
|
|
130
|
-
export declare const getIndustry: ({ apiClient }: {
|
|
131
|
-
apiClient: ApiClient;
|
|
132
|
-
}, uuid: string) => Promise<Industry>;
|
|
133
|
-
export declare const getActiveIndustries: ({ apiClient }: {
|
|
134
|
-
apiClient: ApiClient;
|
|
135
|
-
}, filters?: Omit<IndustryFilters, "isActive">) => Promise<PaginatedIndustries>;
|
|
136
|
-
export declare const searchIndustries: ({ apiClient }: {
|
|
137
|
-
apiClient: ApiClient;
|
|
138
|
-
}, searchTerm: string, filters?: Omit<IndustryFilters, "search">) => Promise<PaginatedIndustries>;
|
|
139
|
-
export declare const getSectors: ({ apiClient }: {
|
|
140
|
-
apiClient: ApiClient;
|
|
141
|
-
}, filters?: SectorFilters) => Promise<PaginatedSectors>;
|
|
142
|
-
export declare const getSector: ({ apiClient }: {
|
|
143
|
-
apiClient: ApiClient;
|
|
144
|
-
}, uuid: string) => Promise<Sector>;
|
|
145
|
-
export declare const getSectorsByIndustry: ({ apiClient }: {
|
|
146
|
-
apiClient: ApiClient;
|
|
147
|
-
}, industryUuid: string, filters?: Omit<SectorFilters, "industry">) => Promise<PaginatedSectors>;
|
|
148
|
-
export declare const getActiveSectors: ({ apiClient }: {
|
|
149
|
-
apiClient: ApiClient;
|
|
150
|
-
}, filters?: Omit<SectorFilters, "isActive">) => Promise<PaginatedSectors>;
|
|
151
|
-
export declare const searchSectors: ({ apiClient }: {
|
|
152
|
-
apiClient: ApiClient;
|
|
153
|
-
}, searchTerm: string, filters?: Omit<SectorFilters, "search">) => Promise<PaginatedSectors>;
|
|
154
|
-
export declare const getStockExchanges: ({ apiClient }: {
|
|
155
|
-
apiClient: ApiClient;
|
|
156
|
-
}, filters?: StockExchangeFilters) => Promise<PaginatedStockExchanges>;
|
|
157
|
-
export declare const getStockExchange: ({ apiClient }: {
|
|
158
|
-
apiClient: ApiClient;
|
|
159
|
-
}, uuid: string) => Promise<StockExchange>;
|
|
160
|
-
export declare const getStockExchangesByCountry: ({ apiClient }: {
|
|
161
|
-
apiClient: ApiClient;
|
|
162
|
-
}, countryUuid: string, filters?: Omit<StockExchangeFilters, "country">) => Promise<PaginatedStockExchanges>;
|
|
163
|
-
export declare const getActiveStockExchanges: ({ apiClient }: {
|
|
164
|
-
apiClient: ApiClient;
|
|
165
|
-
}, filters?: Omit<StockExchangeFilters, "isActive">) => Promise<PaginatedStockExchanges>;
|
|
166
|
-
export declare const searchStockExchanges: ({ apiClient }: {
|
|
167
|
-
apiClient: ApiClient;
|
|
168
|
-
}, searchTerm: string, filters?: Omit<StockExchangeFilters, "search">) => Promise<PaginatedStockExchanges>;
|
|
169
|
-
export declare const getStockExchangeByCode: ({ apiClient }: {
|
|
170
|
-
apiClient: ApiClient;
|
|
171
|
-
}, code: string) => Promise<StockExchange | null>;
|
|
172
|
-
export declare const getAllActiveReferenceData: ({ apiClient }: {
|
|
173
|
-
apiClient: ApiClient;
|
|
174
|
-
}) => Promise<{
|
|
175
|
-
countries: Country[];
|
|
176
|
-
industries: Industry[];
|
|
177
|
-
sectors: Sector[];
|
|
178
|
-
stockExchanges: StockExchange[];
|
|
179
|
-
}>;
|
|
180
|
-
export declare const formatCountryName: (country: Country) => string;
|
|
181
|
-
export declare const formatStockExchangeName: (exchange: StockExchange) => string;
|
|
182
|
-
export declare const getSectorsGroupedByIndustry: ({ apiClient }: {
|
|
183
|
-
apiClient: ApiClient;
|
|
184
|
-
}) => Promise<Map<string, Sector[]>>;
|
|
185
|
-
//# sourceMappingURL=reference-data.d.ts.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F,eAAO,MAAM,sBAAsB,GACjC,eAAe;IAAE,SAAS,EAAE,SAAS,CAAA;CAAE,EACvC,MAAM,MAAM,KACX,OAAO,CAAC,aAAa,GAAG,IAAI,CAM9B,CAAC;AAOF,eAAO,MAAM,yBAAyB,GACpC,eAAe;IAAE,SAAS,EAAE,SAAS,CAAA;CAAE,KACtC,OAAO,CAAC;IACT,SAAS,EAAE,OAAO,EAAE,CAAC;IACrB,UAAU,EAAE,QAAQ,EAAE,CAAC;IACvB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,cAAc,EAAE,aAAa,EAAE,CAAC;CACjC,CASA,CAAC;AAGF,eAAO,MAAM,iBAAiB,GAAI,SAAS,OAAO,KAAG,MAEpD,CAAC;AAGF,eAAO,MAAM,uBAAuB,GAAI,UAAU,aAAa,KAAG,MAEjE,CAAC;AAGF,eAAO,MAAM,2BAA2B,GACtC,eAAe;IAAE,SAAS,EAAE,SAAS,CAAA;CAAE,KACtC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAmB/B,CAAC"}
|
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Reference Data Services - Pure Functional Implementation
|
|
4
|
-
*
|
|
5
|
-
* Static reference data (countries, industries, sectors, etc.) 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.getSectorsGroupedByIndustry = exports.formatStockExchangeName = exports.formatCountryName = exports.getAllActiveReferenceData = exports.getStockExchangeByCode = exports.searchStockExchanges = exports.getActiveStockExchanges = exports.getStockExchangesByCountry = exports.getStockExchange = exports.getStockExchanges = exports.searchSectors = exports.getActiveSectors = exports.getSectorsByIndustry = exports.getSector = exports.getSectors = exports.searchIndustries = exports.getActiveIndustries = exports.getIndustry = exports.getIndustries = exports.getCountryByCode = exports.searchCountries = exports.getAvailableCountries = exports.getCountry = exports.getCountries = void 0;
|
|
10
|
-
// =============================
|
|
11
|
-
// COUNTRY OPERATIONS
|
|
12
|
-
// =============================
|
|
13
|
-
const getCountries = async ({ apiClient }, filters) => {
|
|
14
|
-
const params = {};
|
|
15
|
-
if (filters?.name)
|
|
16
|
-
params.name = filters.name;
|
|
17
|
-
if (filters?.code)
|
|
18
|
-
params.code = filters.code;
|
|
19
|
-
if (filters?.isAvailable !== undefined)
|
|
20
|
-
params.is_available = String(filters.isAvailable);
|
|
21
|
-
if (filters?.search)
|
|
22
|
-
params.search = filters.search;
|
|
23
|
-
if (filters?.ordering)
|
|
24
|
-
params.ordering = filters.ordering;
|
|
25
|
-
if (filters?.page)
|
|
26
|
-
params.page = String(filters.page);
|
|
27
|
-
if (filters?.pageSize)
|
|
28
|
-
params.page_size = String(filters.pageSize);
|
|
29
|
-
return apiClient.get('/api/countries/', { params });
|
|
30
|
-
};
|
|
31
|
-
exports.getCountries = getCountries;
|
|
32
|
-
const getCountry = async ({ apiClient }, uuid) => {
|
|
33
|
-
if (!uuid?.trim()) {
|
|
34
|
-
throw new Error('Country UUID is required');
|
|
35
|
-
}
|
|
36
|
-
return apiClient.get(`/api/countries/${uuid}/`);
|
|
37
|
-
};
|
|
38
|
-
exports.getCountry = getCountry;
|
|
39
|
-
const getAvailableCountries = async ({ apiClient }, filters) => {
|
|
40
|
-
return (0, exports.getCountries)({ apiClient }, { ...filters, isAvailable: true });
|
|
41
|
-
};
|
|
42
|
-
exports.getAvailableCountries = getAvailableCountries;
|
|
43
|
-
const searchCountries = async ({ apiClient }, searchTerm, filters) => {
|
|
44
|
-
if (!searchTerm?.trim()) {
|
|
45
|
-
throw new Error('Search term is required');
|
|
46
|
-
}
|
|
47
|
-
return (0, exports.getCountries)({ apiClient }, { ...filters, search: searchTerm });
|
|
48
|
-
};
|
|
49
|
-
exports.searchCountries = searchCountries;
|
|
50
|
-
const getCountryByCode = async ({ apiClient }, code) => {
|
|
51
|
-
if (!code?.trim()) {
|
|
52
|
-
throw new Error('Country code is required');
|
|
53
|
-
}
|
|
54
|
-
const response = await (0, exports.getCountries)({ apiClient }, { code: code.toUpperCase() });
|
|
55
|
-
return response.results[0] || null;
|
|
56
|
-
};
|
|
57
|
-
exports.getCountryByCode = getCountryByCode;
|
|
58
|
-
// =============================
|
|
59
|
-
// INDUSTRY OPERATIONS
|
|
60
|
-
// =============================
|
|
61
|
-
const getIndustries = async ({ apiClient }, filters) => {
|
|
62
|
-
const params = {};
|
|
63
|
-
if (filters?.name)
|
|
64
|
-
params.name = filters.name;
|
|
65
|
-
if (filters?.code)
|
|
66
|
-
params.code = filters.code;
|
|
67
|
-
if (filters?.isActive !== undefined)
|
|
68
|
-
params.is_active = String(filters.isActive);
|
|
69
|
-
if (filters?.search)
|
|
70
|
-
params.search = filters.search;
|
|
71
|
-
if (filters?.ordering)
|
|
72
|
-
params.ordering = filters.ordering;
|
|
73
|
-
if (filters?.page)
|
|
74
|
-
params.page = String(filters.page);
|
|
75
|
-
if (filters?.pageSize)
|
|
76
|
-
params.page_size = String(filters.pageSize);
|
|
77
|
-
return apiClient.get('/api/industries/', { params });
|
|
78
|
-
};
|
|
79
|
-
exports.getIndustries = getIndustries;
|
|
80
|
-
const getIndustry = async ({ apiClient }, uuid) => {
|
|
81
|
-
if (!uuid?.trim()) {
|
|
82
|
-
throw new Error('Industry UUID is required');
|
|
83
|
-
}
|
|
84
|
-
return apiClient.get(`/api/industries/${uuid}/`);
|
|
85
|
-
};
|
|
86
|
-
exports.getIndustry = getIndustry;
|
|
87
|
-
const getActiveIndustries = async ({ apiClient }, filters) => {
|
|
88
|
-
return (0, exports.getIndustries)({ apiClient }, { ...filters, isActive: true });
|
|
89
|
-
};
|
|
90
|
-
exports.getActiveIndustries = getActiveIndustries;
|
|
91
|
-
const searchIndustries = async ({ apiClient }, searchTerm, filters) => {
|
|
92
|
-
if (!searchTerm?.trim()) {
|
|
93
|
-
throw new Error('Search term is required');
|
|
94
|
-
}
|
|
95
|
-
return (0, exports.getIndustries)({ apiClient }, { ...filters, search: searchTerm });
|
|
96
|
-
};
|
|
97
|
-
exports.searchIndustries = searchIndustries;
|
|
98
|
-
// =============================
|
|
99
|
-
// SECTOR OPERATIONS
|
|
100
|
-
// =============================
|
|
101
|
-
const getSectors = async ({ apiClient }, filters) => {
|
|
102
|
-
const params = {};
|
|
103
|
-
if (filters?.name)
|
|
104
|
-
params.name = filters.name;
|
|
105
|
-
if (filters?.code)
|
|
106
|
-
params.code = filters.code;
|
|
107
|
-
if (filters?.industry)
|
|
108
|
-
params.industry = filters.industry;
|
|
109
|
-
if (filters?.isActive !== undefined)
|
|
110
|
-
params.is_active = String(filters.isActive);
|
|
111
|
-
if (filters?.search)
|
|
112
|
-
params.search = filters.search;
|
|
113
|
-
if (filters?.ordering)
|
|
114
|
-
params.ordering = filters.ordering;
|
|
115
|
-
if (filters?.page)
|
|
116
|
-
params.page = String(filters.page);
|
|
117
|
-
if (filters?.pageSize)
|
|
118
|
-
params.page_size = String(filters.pageSize);
|
|
119
|
-
return apiClient.get('/api/sectors/', { params });
|
|
120
|
-
};
|
|
121
|
-
exports.getSectors = getSectors;
|
|
122
|
-
const getSector = async ({ apiClient }, uuid) => {
|
|
123
|
-
if (!uuid?.trim()) {
|
|
124
|
-
throw new Error('Sector UUID is required');
|
|
125
|
-
}
|
|
126
|
-
return apiClient.get(`/api/sectors/${uuid}/`);
|
|
127
|
-
};
|
|
128
|
-
exports.getSector = getSector;
|
|
129
|
-
const getSectorsByIndustry = async ({ apiClient }, industryUuid, filters) => {
|
|
130
|
-
if (!industryUuid?.trim()) {
|
|
131
|
-
throw new Error('Industry UUID is required');
|
|
132
|
-
}
|
|
133
|
-
return (0, exports.getSectors)({ apiClient }, { ...filters, industry: industryUuid });
|
|
134
|
-
};
|
|
135
|
-
exports.getSectorsByIndustry = getSectorsByIndustry;
|
|
136
|
-
const getActiveSectors = async ({ apiClient }, filters) => {
|
|
137
|
-
return (0, exports.getSectors)({ apiClient }, { ...filters, isActive: true });
|
|
138
|
-
};
|
|
139
|
-
exports.getActiveSectors = getActiveSectors;
|
|
140
|
-
const searchSectors = async ({ apiClient }, searchTerm, filters) => {
|
|
141
|
-
if (!searchTerm?.trim()) {
|
|
142
|
-
throw new Error('Search term is required');
|
|
143
|
-
}
|
|
144
|
-
return (0, exports.getSectors)({ apiClient }, { ...filters, search: searchTerm });
|
|
145
|
-
};
|
|
146
|
-
exports.searchSectors = searchSectors;
|
|
147
|
-
// =============================
|
|
148
|
-
// STOCK EXCHANGE OPERATIONS
|
|
149
|
-
// =============================
|
|
150
|
-
const getStockExchanges = async ({ apiClient }, filters) => {
|
|
151
|
-
const params = {};
|
|
152
|
-
if (filters?.name)
|
|
153
|
-
params.name = filters.name;
|
|
154
|
-
if (filters?.code)
|
|
155
|
-
params.code = filters.code;
|
|
156
|
-
if (filters?.country)
|
|
157
|
-
params.country = filters.country;
|
|
158
|
-
if (filters?.isActive !== undefined)
|
|
159
|
-
params.is_active = String(filters.isActive);
|
|
160
|
-
if (filters?.search)
|
|
161
|
-
params.search = filters.search;
|
|
162
|
-
if (filters?.ordering)
|
|
163
|
-
params.ordering = filters.ordering;
|
|
164
|
-
if (filters?.page)
|
|
165
|
-
params.page = String(filters.page);
|
|
166
|
-
if (filters?.pageSize)
|
|
167
|
-
params.page_size = String(filters.pageSize);
|
|
168
|
-
return apiClient.get('/api/stock-exchanges/', { params });
|
|
169
|
-
};
|
|
170
|
-
exports.getStockExchanges = getStockExchanges;
|
|
171
|
-
const getStockExchange = async ({ apiClient }, uuid) => {
|
|
172
|
-
if (!uuid?.trim()) {
|
|
173
|
-
throw new Error('Stock exchange UUID is required');
|
|
174
|
-
}
|
|
175
|
-
return apiClient.get(`/api/stock-exchanges/${uuid}/`);
|
|
176
|
-
};
|
|
177
|
-
exports.getStockExchange = getStockExchange;
|
|
178
|
-
const getStockExchangesByCountry = async ({ apiClient }, countryUuid, filters) => {
|
|
179
|
-
if (!countryUuid?.trim()) {
|
|
180
|
-
throw new Error('Country UUID is required');
|
|
181
|
-
}
|
|
182
|
-
return (0, exports.getStockExchanges)({ apiClient }, { ...filters, country: countryUuid });
|
|
183
|
-
};
|
|
184
|
-
exports.getStockExchangesByCountry = getStockExchangesByCountry;
|
|
185
|
-
const getActiveStockExchanges = async ({ apiClient }, filters) => {
|
|
186
|
-
return (0, exports.getStockExchanges)({ apiClient }, { ...filters, isActive: true });
|
|
187
|
-
};
|
|
188
|
-
exports.getActiveStockExchanges = getActiveStockExchanges;
|
|
189
|
-
const searchStockExchanges = async ({ apiClient }, searchTerm, filters) => {
|
|
190
|
-
if (!searchTerm?.trim()) {
|
|
191
|
-
throw new Error('Search term is required');
|
|
192
|
-
}
|
|
193
|
-
return (0, exports.getStockExchanges)({ apiClient }, { ...filters, search: searchTerm });
|
|
194
|
-
};
|
|
195
|
-
exports.searchStockExchanges = searchStockExchanges;
|
|
196
|
-
const getStockExchangeByCode = async ({ apiClient }, code) => {
|
|
197
|
-
if (!code?.trim()) {
|
|
198
|
-
throw new Error('Stock exchange code is required');
|
|
199
|
-
}
|
|
200
|
-
const response = await (0, exports.getStockExchanges)({ apiClient }, { code: code.toUpperCase() });
|
|
201
|
-
return response.results[0] || null;
|
|
202
|
-
};
|
|
203
|
-
exports.getStockExchangeByCode = getStockExchangeByCode;
|
|
204
|
-
// =============================
|
|
205
|
-
// UTILITY FUNCTIONS
|
|
206
|
-
// =============================
|
|
207
|
-
// Helper to get all active reference data at once
|
|
208
|
-
const getAllActiveReferenceData = async ({ apiClient }) => {
|
|
209
|
-
const [countries, industries, sectors, stockExchanges] = await Promise.all([
|
|
210
|
-
(0, exports.getAvailableCountries)({ apiClient }).then(res => res.results),
|
|
211
|
-
(0, exports.getActiveIndustries)({ apiClient }).then(res => res.results),
|
|
212
|
-
(0, exports.getActiveSectors)({ apiClient }).then(res => res.results),
|
|
213
|
-
(0, exports.getActiveStockExchanges)({ apiClient }).then(res => res.results),
|
|
214
|
-
]);
|
|
215
|
-
return { countries, industries, sectors, stockExchanges };
|
|
216
|
-
};
|
|
217
|
-
exports.getAllActiveReferenceData = getAllActiveReferenceData;
|
|
218
|
-
// Format country display name
|
|
219
|
-
const formatCountryName = (country) => {
|
|
220
|
-
return `${country.name} (${country.code})`;
|
|
221
|
-
};
|
|
222
|
-
exports.formatCountryName = formatCountryName;
|
|
223
|
-
// Format stock exchange display name
|
|
224
|
-
const formatStockExchangeName = (exchange) => {
|
|
225
|
-
return `${exchange.name} (${exchange.code})`;
|
|
226
|
-
};
|
|
227
|
-
exports.formatStockExchangeName = formatStockExchangeName;
|
|
228
|
-
// Get sectors grouped by industry
|
|
229
|
-
const getSectorsGroupedByIndustry = async ({ apiClient }) => {
|
|
230
|
-
const [industries, sectors] = await Promise.all([
|
|
231
|
-
(0, exports.getActiveIndustries)({ apiClient }).then(res => res.results),
|
|
232
|
-
(0, exports.getActiveSectors)({ apiClient }).then(res => res.results),
|
|
233
|
-
]);
|
|
234
|
-
const grouped = new Map();
|
|
235
|
-
industries.forEach(industry => {
|
|
236
|
-
grouped.set(industry.uuid, []);
|
|
237
|
-
});
|
|
238
|
-
sectors.forEach(sector => {
|
|
239
|
-
const industrySectors = grouped.get(sector.industry) || [];
|
|
240
|
-
industrySectors.push(sector);
|
|
241
|
-
grouped.set(sector.industry, industrySectors);
|
|
242
|
-
});
|
|
243
|
-
return grouped;
|
|
244
|
-
};
|
|
245
|
-
exports.getSectorsGroupedByIndustry = getSectorsGroupedByIndustry;
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tax Residency Services - Pure Functional Implementation
|
|
3
|
-
*
|
|
4
|
-
* Tax residency 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 interface TaxResidency {
|
|
9
|
-
readonly uuid: string;
|
|
10
|
-
readonly userProfile: string;
|
|
11
|
-
readonly country: string;
|
|
12
|
-
readonly countryName: string;
|
|
13
|
-
readonly countryCode: string;
|
|
14
|
-
readonly taxIdentificationNumber?: string;
|
|
15
|
-
readonly isPrimary: boolean;
|
|
16
|
-
readonly startDate: string;
|
|
17
|
-
readonly endDate?: string;
|
|
18
|
-
readonly createdAt: string;
|
|
19
|
-
readonly updatedAt: string;
|
|
20
|
-
}
|
|
21
|
-
export interface CreateTaxResidencyPayload {
|
|
22
|
-
readonly userProfile: string;
|
|
23
|
-
readonly country: string;
|
|
24
|
-
readonly taxIdentificationNumber?: string;
|
|
25
|
-
readonly isPrimary?: boolean;
|
|
26
|
-
readonly startDate: string;
|
|
27
|
-
readonly endDate?: string;
|
|
28
|
-
}
|
|
29
|
-
export interface UpdateTaxResidencyPayload {
|
|
30
|
-
readonly country?: string;
|
|
31
|
-
readonly taxIdentificationNumber?: string;
|
|
32
|
-
readonly isPrimary?: boolean;
|
|
33
|
-
readonly startDate?: string;
|
|
34
|
-
readonly endDate?: string;
|
|
35
|
-
}
|
|
36
|
-
export interface TaxResidencyFilters {
|
|
37
|
-
readonly userProfile?: string;
|
|
38
|
-
readonly country?: string;
|
|
39
|
-
readonly isPrimary?: boolean;
|
|
40
|
-
readonly isActive?: boolean;
|
|
41
|
-
readonly ordering?: string;
|
|
42
|
-
}
|
|
43
|
-
export interface PaginatedTaxResidencies {
|
|
44
|
-
readonly results: TaxResidency[];
|
|
45
|
-
readonly count: number;
|
|
46
|
-
readonly next: string | null;
|
|
47
|
-
readonly previous: string | null;
|
|
48
|
-
}
|
|
49
|
-
export declare const getTaxResidencies: ({ apiClient }: {
|
|
50
|
-
apiClient: ApiClient;
|
|
51
|
-
}, filters?: TaxResidencyFilters) => Promise<PaginatedTaxResidencies>;
|
|
52
|
-
export declare const getTaxResidency: ({ apiClient }: {
|
|
53
|
-
apiClient: ApiClient;
|
|
54
|
-
}, uuid: string) => Promise<TaxResidency>;
|
|
55
|
-
export declare const createTaxResidency: ({ apiClient }: {
|
|
56
|
-
apiClient: ApiClient;
|
|
57
|
-
}, data: CreateTaxResidencyPayload) => Promise<TaxResidency>;
|
|
58
|
-
export declare const updateTaxResidency: ({ apiClient }: {
|
|
59
|
-
apiClient: ApiClient;
|
|
60
|
-
}, uuid: string, data: UpdateTaxResidencyPayload) => Promise<TaxResidency>;
|
|
61
|
-
export declare const deleteTaxResidency: ({ apiClient }: {
|
|
62
|
-
apiClient: ApiClient;
|
|
63
|
-
}, uuid: string) => Promise<void>;
|
|
64
|
-
export declare const setPrimaryTaxResidency: ({ apiClient }: {
|
|
65
|
-
apiClient: ApiClient;
|
|
66
|
-
}, uuid: string) => Promise<TaxResidency>;
|
|
67
|
-
export declare const getUserTaxResidencies: ({ apiClient }: {
|
|
68
|
-
apiClient: ApiClient;
|
|
69
|
-
}, userProfileUuid: string) => Promise<PaginatedTaxResidencies>;
|
|
70
|
-
export declare const getActiveTaxResidencies: ({ apiClient }: {
|
|
71
|
-
apiClient: ApiClient;
|
|
72
|
-
}, userProfileUuid?: string) => Promise<PaginatedTaxResidencies>;
|
|
73
|
-
export declare const getPrimaryTaxResidency: ({ apiClient }: {
|
|
74
|
-
apiClient: ApiClient;
|
|
75
|
-
}, userProfileUuid: string) => Promise<TaxResidency | null>;
|
|
76
|
-
export declare const getTaxResidenciesByCountry: ({ apiClient }: {
|
|
77
|
-
apiClient: ApiClient;
|
|
78
|
-
}, countryUuid: string, userProfileUuid?: string) => Promise<PaginatedTaxResidencies>;
|
|
79
|
-
export declare const isTaxResidencyActive: (taxResidency: TaxResidency) => boolean;
|
|
80
|
-
export declare const formatTaxResidencyPeriod: (taxResidency: TaxResidency) => string;
|
|
81
|
-
export declare const validateTaxIdentificationNumber: (tin: string, countryCode: string) => boolean;
|
|
82
|
-
export declare const canHaveMultipleResidencies: (countryCode: string) => boolean;
|
|
83
|
-
//# sourceMappingURL=tax-residencies.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tax-residencies.d.ts","sourceRoot":"","sources":["../../src/services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