@cranberry-money/shared-constants 4.2.0 → 4.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/config.d.ts +36 -0
- package/dist/api/config.d.ts.map +1 -0
- package/dist/api/config.js +44 -0
- package/dist/api/endpoints.d.ts +111 -0
- package/dist/api/endpoints.d.ts.map +1 -0
- package/dist/api/endpoints.js +133 -0
- package/dist/api/http.d.ts +55 -0
- package/dist/api/http.d.ts.map +1 -0
- package/dist/api/http.js +62 -0
- package/dist/api/index.d.ts +7 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +22 -0
- package/dist/business/accounts.d.ts +30 -0
- package/dist/business/accounts.d.ts.map +1 -0
- package/dist/business/accounts.js +45 -0
- package/dist/business/banking.d.ts +44 -0
- package/dist/business/banking.d.ts.map +1 -0
- package/dist/business/banking.js +72 -0
- package/dist/business/documents.d.ts +34 -0
- package/dist/business/documents.d.ts.map +1 -0
- package/dist/business/documents.js +58 -0
- package/dist/business/index.d.ts +10 -0
- package/dist/business/index.d.ts.map +1 -0
- package/dist/business/index.js +25 -0
- package/dist/business/investments.d.ts +87 -0
- package/dist/business/investments.d.ts.map +1 -0
- package/dist/business/investments.js +96 -0
- package/dist/business/status/banks.d.ts +13 -0
- package/dist/business/status/banks.d.ts.map +1 -0
- package/dist/business/status/banks.js +20 -0
- package/dist/business/status/cash-accounts.d.ts +16 -0
- package/dist/business/status/cash-accounts.d.ts.map +1 -0
- package/dist/business/status/cash-accounts.js +26 -0
- package/dist/business/status/documents.d.ts +13 -0
- package/dist/business/status/documents.d.ts.map +1 -0
- package/dist/business/status/documents.js +20 -0
- package/dist/business/status/index.d.ts +11 -0
- package/dist/business/status/index.d.ts.map +1 -0
- package/dist/business/status/index.js +26 -0
- package/dist/business/status/instruments.d.ts +22 -0
- package/dist/business/status/instruments.d.ts.map +1 -0
- package/dist/business/status/instruments.js +35 -0
- package/dist/business/status/portfolios.d.ts +12 -0
- package/dist/business/status/portfolios.d.ts.map +1 -0
- package/dist/business/status/portfolios.js +18 -0
- package/dist/business/status/trades.d.ts +40 -0
- package/dist/business/status/trades.d.ts.map +1 -0
- package/dist/business/status/trades.js +65 -0
- package/dist/business/status/withdrawals.d.ts +33 -0
- package/dist/business/status/withdrawals.d.ts.map +1 -0
- package/dist/business/status/withdrawals.js +54 -0
- package/dist/business/trading.d.ts +52 -0
- package/dist/business/trading.d.ts.map +1 -0
- package/dist/business/trading.js +71 -0
- package/dist/financial/currency.d.ts +25 -0
- package/dist/financial/currency.d.ts.map +1 -0
- package/dist/financial/currency.js +65 -0
- package/dist/financial/formatting.d.ts +52 -0
- package/dist/financial/formatting.d.ts.map +1 -0
- package/dist/financial/formatting.js +64 -0
- package/dist/financial/index.d.ts +7 -0
- package/dist/financial/index.d.ts.map +1 -0
- package/dist/financial/index.js +22 -0
- package/dist/financial/instruments.d.ts +35 -0
- package/dist/financial/instruments.d.ts.map +1 -0
- package/dist/financial/instruments.js +61 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +32 -0
- package/dist/ui/colors.d.ts +43 -0
- package/dist/ui/colors.d.ts.map +1 -0
- package/dist/ui/colors.js +84 -0
- package/dist/ui/display.d.ts +69 -0
- package/dist/ui/display.d.ts.map +1 -0
- package/dist/ui/display.js +83 -0
- package/dist/ui/index.d.ts +7 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +22 -0
- package/dist/ui/labels/index.d.ts +20 -0
- package/dist/ui/labels/index.d.ts.map +1 -0
- package/dist/ui/labels/index.js +57 -0
- package/dist/utilities/defaults.d.ts +39 -0
- package/dist/utilities/defaults.d.ts.map +1 -0
- package/dist/utilities/defaults.js +46 -0
- package/dist/utilities/index.d.ts +8 -0
- package/dist/utilities/index.d.ts.map +1 -0
- package/dist/utilities/index.js +23 -0
- package/dist/utilities/sorting.d.ts +43 -0
- package/dist/utilities/sorting.d.ts.map +1 -0
- package/dist/utilities/sorting.js +51 -0
- package/dist/utilities/time.d.ts +43 -0
- package/dist/utilities/time.d.ts.map +1 -0
- package/dist/utilities/time.js +52 -0
- package/dist/utilities/validation.d.ts +57 -0
- package/dist/utilities/validation.d.ts.map +1 -0
- package/dist/utilities/validation.js +68 -0
- package/package.json +1 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API configuration constants
|
|
3
|
+
*/
|
|
4
|
+
export declare const API_VERSIONS: {
|
|
5
|
+
readonly V1: "v1";
|
|
6
|
+
readonly V2: "v2";
|
|
7
|
+
};
|
|
8
|
+
export type ApiVersion = typeof API_VERSIONS[keyof typeof API_VERSIONS];
|
|
9
|
+
export declare const API_CONFIG: {
|
|
10
|
+
readonly DEFAULT_TIMEOUT: 30000;
|
|
11
|
+
readonly DEFAULT_RETRY_ATTEMPTS: 3;
|
|
12
|
+
readonly DEFAULT_RETRY_DELAY: 1000;
|
|
13
|
+
readonly MAX_RETRY_DELAY: 10000;
|
|
14
|
+
readonly REQUEST_DEBOUNCE_MS: 300;
|
|
15
|
+
};
|
|
16
|
+
export declare const API_RESPONSE_CONFIG: {
|
|
17
|
+
readonly DEFAULT_PAGE_SIZE: 20;
|
|
18
|
+
readonly MAX_PAGE_SIZE: 100;
|
|
19
|
+
readonly DEFAULT_SORT_ORDER: "desc";
|
|
20
|
+
};
|
|
21
|
+
export declare const API_ERROR_CODES: {
|
|
22
|
+
readonly INVALID_CREDENTIALS: "INVALID_CREDENTIALS";
|
|
23
|
+
readonly TOKEN_EXPIRED: "TOKEN_EXPIRED";
|
|
24
|
+
readonly INSUFFICIENT_PERMISSIONS: "INSUFFICIENT_PERMISSIONS";
|
|
25
|
+
readonly VALIDATION_FAILED: "VALIDATION_FAILED";
|
|
26
|
+
readonly INVALID_INPUT: "INVALID_INPUT";
|
|
27
|
+
readonly MISSING_REQUIRED_FIELD: "MISSING_REQUIRED_FIELD";
|
|
28
|
+
readonly INSUFFICIENT_FUNDS: "INSUFFICIENT_FUNDS";
|
|
29
|
+
readonly PORTFOLIO_LIMIT_EXCEEDED: "PORTFOLIO_LIMIT_EXCEEDED";
|
|
30
|
+
readonly TRADE_LIMIT_EXCEEDED: "TRADE_LIMIT_EXCEEDED";
|
|
31
|
+
readonly SERVICE_UNAVAILABLE: "SERVICE_UNAVAILABLE";
|
|
32
|
+
readonly RATE_LIMIT_EXCEEDED: "RATE_LIMIT_EXCEEDED";
|
|
33
|
+
readonly UNKNOWN_ERROR: "UNKNOWN_ERROR";
|
|
34
|
+
};
|
|
35
|
+
export type ApiErrorCode = typeof API_ERROR_CODES[keyof typeof API_ERROR_CODES];
|
|
36
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/api/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,eAAO,MAAM,YAAY;;;CAGf,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,OAAO,YAAY,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAGxE,eAAO,MAAM,UAAU;;;;;;CAMb,CAAC;AAGX,eAAO,MAAM,mBAAmB;;;;CAItB,CAAC;AAGX,eAAO,MAAM,eAAe;;;;;;;;;;;;;CAoBlB,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,OAAO,eAAe,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* API configuration constants
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.API_ERROR_CODES = exports.API_RESPONSE_CONFIG = exports.API_CONFIG = exports.API_VERSIONS = void 0;
|
|
7
|
+
// API Versions
|
|
8
|
+
exports.API_VERSIONS = {
|
|
9
|
+
V1: 'v1',
|
|
10
|
+
V2: 'v2',
|
|
11
|
+
};
|
|
12
|
+
// API Configuration
|
|
13
|
+
exports.API_CONFIG = {
|
|
14
|
+
DEFAULT_TIMEOUT: 30000, // 30 seconds
|
|
15
|
+
DEFAULT_RETRY_ATTEMPTS: 3,
|
|
16
|
+
DEFAULT_RETRY_DELAY: 1000, // 1 second
|
|
17
|
+
MAX_RETRY_DELAY: 10000, // 10 seconds
|
|
18
|
+
REQUEST_DEBOUNCE_MS: 300,
|
|
19
|
+
};
|
|
20
|
+
// API Response Configuration
|
|
21
|
+
exports.API_RESPONSE_CONFIG = {
|
|
22
|
+
DEFAULT_PAGE_SIZE: 20,
|
|
23
|
+
MAX_PAGE_SIZE: 100,
|
|
24
|
+
DEFAULT_SORT_ORDER: 'desc',
|
|
25
|
+
};
|
|
26
|
+
// API Error Codes (custom application codes)
|
|
27
|
+
exports.API_ERROR_CODES = {
|
|
28
|
+
// Authentication errors
|
|
29
|
+
INVALID_CREDENTIALS: 'INVALID_CREDENTIALS',
|
|
30
|
+
TOKEN_EXPIRED: 'TOKEN_EXPIRED',
|
|
31
|
+
INSUFFICIENT_PERMISSIONS: 'INSUFFICIENT_PERMISSIONS',
|
|
32
|
+
// Validation errors
|
|
33
|
+
VALIDATION_FAILED: 'VALIDATION_FAILED',
|
|
34
|
+
INVALID_INPUT: 'INVALID_INPUT',
|
|
35
|
+
MISSING_REQUIRED_FIELD: 'MISSING_REQUIRED_FIELD',
|
|
36
|
+
// Business logic errors
|
|
37
|
+
INSUFFICIENT_FUNDS: 'INSUFFICIENT_FUNDS',
|
|
38
|
+
PORTFOLIO_LIMIT_EXCEEDED: 'PORTFOLIO_LIMIT_EXCEEDED',
|
|
39
|
+
TRADE_LIMIT_EXCEEDED: 'TRADE_LIMIT_EXCEEDED',
|
|
40
|
+
// System errors
|
|
41
|
+
SERVICE_UNAVAILABLE: 'SERVICE_UNAVAILABLE',
|
|
42
|
+
RATE_LIMIT_EXCEEDED: 'RATE_LIMIT_EXCEEDED',
|
|
43
|
+
UNKNOWN_ERROR: 'UNKNOWN_ERROR',
|
|
44
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API endpoint definitions for all services
|
|
3
|
+
*/
|
|
4
|
+
export declare const API_BASE_PATHS: {
|
|
5
|
+
readonly V1: "/api";
|
|
6
|
+
};
|
|
7
|
+
export declare const ACCOUNT_ENDPOINTS: {
|
|
8
|
+
readonly BASE: "/api/accounts/";
|
|
9
|
+
readonly DETAIL: (uuid: string) => `/api/accounts/${string}/`;
|
|
10
|
+
};
|
|
11
|
+
export declare const AUTH_ENDPOINTS: {
|
|
12
|
+
readonly BASE: "/api/auth/";
|
|
13
|
+
readonly LOGIN: "/api/auth/login/";
|
|
14
|
+
readonly LOGOUT: "/api/auth/logout/";
|
|
15
|
+
readonly REFRESH: "/api/auth/refresh/";
|
|
16
|
+
readonly VERIFY: "/api/auth/verify/";
|
|
17
|
+
};
|
|
18
|
+
export declare const BANK_ENDPOINTS: {
|
|
19
|
+
readonly BASE: "/api/banks/";
|
|
20
|
+
readonly DETAIL: (uuid: string) => `/api/banks/${string}/`;
|
|
21
|
+
readonly ACCOUNTS: "/api/bank-accounts/";
|
|
22
|
+
readonly ACCOUNT_DETAIL: (uuid: string) => `/api/bank-accounts/${string}/`;
|
|
23
|
+
};
|
|
24
|
+
export declare const CASH_ACCOUNT_ENDPOINTS: {
|
|
25
|
+
readonly BASE: "/api/cash-accounts/";
|
|
26
|
+
readonly DETAIL: (uuid: string) => `/api/cash-accounts/${string}/`;
|
|
27
|
+
readonly TRANSACTIONS: (uuid: string) => `/api/cash-accounts/${string}/transactions/`;
|
|
28
|
+
};
|
|
29
|
+
export declare const COUNTRY_ENDPOINTS: {
|
|
30
|
+
readonly BASE: "/api/countries/";
|
|
31
|
+
readonly DETAIL: (uuid: string) => `/api/countries/${string}/`;
|
|
32
|
+
};
|
|
33
|
+
export declare const DOCUMENT_ENDPOINTS: {
|
|
34
|
+
readonly BASE: "/api/documents/";
|
|
35
|
+
readonly DETAIL: (uuid: string) => `/api/documents/${string}/`;
|
|
36
|
+
readonly DOWNLOAD: (uuid: string) => `/api/documents/${string}/download/`;
|
|
37
|
+
readonly SIGN: (uuid: string) => `/api/documents/${string}/sign/`;
|
|
38
|
+
};
|
|
39
|
+
export declare const INDUSTRY_ENDPOINTS: {
|
|
40
|
+
readonly BASE: "/api/industries/";
|
|
41
|
+
readonly DETAIL: (uuid: string) => `/api/industries/${string}/`;
|
|
42
|
+
};
|
|
43
|
+
export declare const INSTRUMENT_ENDPOINTS: {
|
|
44
|
+
readonly BASE: "/api/instruments/";
|
|
45
|
+
readonly DETAIL: (uuid: string) => `/api/instruments/${string}/`;
|
|
46
|
+
readonly PRICES: (uuid: string) => `/api/instruments/${string}/prices/`;
|
|
47
|
+
readonly QUOTE: (uuid: string) => `/api/instruments/${string}/quote/`;
|
|
48
|
+
};
|
|
49
|
+
export declare const PORTFOLIO_ENDPOINTS: {
|
|
50
|
+
readonly BASE: "/api/portfolios/";
|
|
51
|
+
readonly DETAIL: (uuid: string) => `/api/portfolios/${string}/`;
|
|
52
|
+
readonly ALLOCATIONS: (uuid: string) => `/api/portfolios/${string}/allocations/`;
|
|
53
|
+
readonly HOLDINGS: (uuid: string) => `/api/portfolios/${string}/holdings/`;
|
|
54
|
+
readonly PERFORMANCE: (uuid: string) => `/api/portfolios/${string}/performance/`;
|
|
55
|
+
readonly TRANSACTIONS: (uuid: string) => `/api/portfolios/${string}/transactions/`;
|
|
56
|
+
};
|
|
57
|
+
export declare const PORTFOLIO_TEMPLATE_ENDPOINTS: {
|
|
58
|
+
readonly BASE: "/api/portfolio-templates/";
|
|
59
|
+
readonly DETAIL: (uuid: string) => `/api/portfolio-templates/${string}/`;
|
|
60
|
+
readonly ALLOCATIONS: (uuid: string) => `/api/portfolio-templates/${string}/allocations/`;
|
|
61
|
+
readonly RECOMMENDED: "/api/portfolio-templates/recommended/";
|
|
62
|
+
};
|
|
63
|
+
export declare const SECTOR_ENDPOINTS: {
|
|
64
|
+
readonly BASE: "/api/sectors/";
|
|
65
|
+
readonly DETAIL: (uuid: string) => `/api/sectors/${string}/`;
|
|
66
|
+
};
|
|
67
|
+
export declare const STOCK_EXCHANGE_ENDPOINTS: {
|
|
68
|
+
readonly BASE: "/api/stock-exchanges/";
|
|
69
|
+
readonly DETAIL: (uuid: string) => `/api/stock-exchanges/${string}/`;
|
|
70
|
+
};
|
|
71
|
+
export declare const TAX_RESIDENCY_ENDPOINTS: {
|
|
72
|
+
readonly BASE: "/api/tax-residencies/";
|
|
73
|
+
readonly DETAIL: (uuid: string) => `/api/tax-residencies/${string}/`;
|
|
74
|
+
};
|
|
75
|
+
export declare const TRADE_ENDPOINTS: {
|
|
76
|
+
readonly BASE: "/api/trades/";
|
|
77
|
+
readonly DETAIL: (uuid: string) => `/api/trades/${string}/`;
|
|
78
|
+
readonly CANCEL: (uuid: string) => `/api/trades/${string}/cancel/`;
|
|
79
|
+
readonly CONFIRM: (uuid: string) => `/api/trades/${string}/confirm/`;
|
|
80
|
+
};
|
|
81
|
+
export declare const USER_ENDPOINTS: {
|
|
82
|
+
readonly BASE: "/api/users/";
|
|
83
|
+
readonly DETAIL: (uuid: string) => `/api/users/${string}/`;
|
|
84
|
+
readonly PROFILE: "/api/users/profile/";
|
|
85
|
+
readonly PREFERENCES: "/api/users/preferences/";
|
|
86
|
+
readonly INVESTMENT_PREFERENCES: "/api/users/investment-preferences/";
|
|
87
|
+
};
|
|
88
|
+
export declare const WITHDRAWAL_ENDPOINTS: {
|
|
89
|
+
readonly BASE: "/api/withdrawals/";
|
|
90
|
+
readonly DETAIL: (uuid: string) => `/api/withdrawals/${string}/`;
|
|
91
|
+
readonly CANCEL: (uuid: string) => `/api/withdrawals/${string}/cancel/`;
|
|
92
|
+
readonly APPROVE: (uuid: string) => `/api/withdrawals/${string}/approve/`;
|
|
93
|
+
readonly REJECT: (uuid: string) => `/api/withdrawals/${string}/reject/`;
|
|
94
|
+
};
|
|
95
|
+
export declare const TRANSACTION_ENDPOINTS: {
|
|
96
|
+
readonly BASE: "/api/transactions/";
|
|
97
|
+
readonly DETAIL: (uuid: string) => `/api/transactions/${string}/`;
|
|
98
|
+
};
|
|
99
|
+
export declare const ASSET_ALLOCATION_ENDPOINTS: {
|
|
100
|
+
readonly BASE: "/api/asset-allocations/";
|
|
101
|
+
readonly DETAIL: (uuid: string) => `/api/asset-allocations/${string}/`;
|
|
102
|
+
};
|
|
103
|
+
export declare const ASSET_HOLDING_ENDPOINTS: {
|
|
104
|
+
readonly BASE: "/api/asset-holdings/";
|
|
105
|
+
readonly DETAIL: (uuid: string) => `/api/asset-holdings/${string}/`;
|
|
106
|
+
};
|
|
107
|
+
export declare const ASSET_HOLDING_SNAPSHOT_ENDPOINTS: {
|
|
108
|
+
readonly BASE: "/api/asset-holding-snapshots/";
|
|
109
|
+
readonly DETAIL: (id: string) => `/api/asset-holding-snapshots/${string}/`;
|
|
110
|
+
};
|
|
111
|
+
//# sourceMappingURL=endpoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpoints.d.ts","sourceRoot":"","sources":["../../src/api/endpoints.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,cAAc;;CAEjB,CAAC;AAGX,eAAO,MAAM,iBAAiB;;4BAEb,MAAM;CACb,CAAC;AAGX,eAAO,MAAM,cAAc;;;;;;CAMjB,CAAC;AAGX,eAAO,MAAM,cAAc;;4BAEV,MAAM;;oCAEE,MAAM;CACrB,CAAC;AAGX,eAAO,MAAM,sBAAsB;;4BAElB,MAAM;kCACA,MAAM;CACnB,CAAC;AAGX,eAAO,MAAM,iBAAiB;;4BAEb,MAAM;CACb,CAAC;AAGX,eAAO,MAAM,kBAAkB;;4BAEd,MAAM;8BACJ,MAAM;0BACV,MAAM;CACX,CAAC;AAGX,eAAO,MAAM,kBAAkB;;4BAEd,MAAM;CACb,CAAC;AAGX,eAAO,MAAM,oBAAoB;;4BAEhB,MAAM;4BACN,MAAM;2BACP,MAAM;CACZ,CAAC;AAGX,eAAO,MAAM,mBAAmB;;4BAEf,MAAM;iCACD,MAAM;8BACT,MAAM;iCACH,MAAM;kCACL,MAAM;CACnB,CAAC;AAGX,eAAO,MAAM,4BAA4B;;4BAExB,MAAM;iCACD,MAAM;;CAElB,CAAC;AAGX,eAAO,MAAM,gBAAgB;;4BAEZ,MAAM;CACb,CAAC;AAGX,eAAO,MAAM,wBAAwB;;4BAEpB,MAAM;CACb,CAAC;AAGX,eAAO,MAAM,uBAAuB;;4BAEnB,MAAM;CACb,CAAC;AAGX,eAAO,MAAM,eAAe;;4BAEX,MAAM;4BACN,MAAM;6BACL,MAAM;CACd,CAAC;AAGX,eAAO,MAAM,cAAc;;4BAEV,MAAM;;;;CAIb,CAAC;AAGX,eAAO,MAAM,oBAAoB;;4BAEhB,MAAM;4BACN,MAAM;6BACL,MAAM;4BACP,MAAM;CACb,CAAC;AAGX,eAAO,MAAM,qBAAqB;;4BAEjB,MAAM;CACb,CAAC;AAGX,eAAO,MAAM,0BAA0B;;4BAEtB,MAAM;CACb,CAAC;AAGX,eAAO,MAAM,uBAAuB;;4BAEnB,MAAM;CACb,CAAC;AAGX,eAAO,MAAM,gCAAgC;;0BAE9B,MAAM;CACX,CAAC"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* API endpoint definitions for all services
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ASSET_HOLDING_SNAPSHOT_ENDPOINTS = exports.ASSET_HOLDING_ENDPOINTS = exports.ASSET_ALLOCATION_ENDPOINTS = exports.TRANSACTION_ENDPOINTS = exports.WITHDRAWAL_ENDPOINTS = exports.USER_ENDPOINTS = exports.TRADE_ENDPOINTS = exports.TAX_RESIDENCY_ENDPOINTS = exports.STOCK_EXCHANGE_ENDPOINTS = exports.SECTOR_ENDPOINTS = exports.PORTFOLIO_TEMPLATE_ENDPOINTS = exports.PORTFOLIO_ENDPOINTS = exports.INSTRUMENT_ENDPOINTS = exports.INDUSTRY_ENDPOINTS = exports.DOCUMENT_ENDPOINTS = exports.COUNTRY_ENDPOINTS = exports.CASH_ACCOUNT_ENDPOINTS = exports.BANK_ENDPOINTS = exports.AUTH_ENDPOINTS = exports.ACCOUNT_ENDPOINTS = exports.API_BASE_PATHS = void 0;
|
|
7
|
+
exports.API_BASE_PATHS = {
|
|
8
|
+
V1: '/api',
|
|
9
|
+
};
|
|
10
|
+
// Account endpoints
|
|
11
|
+
exports.ACCOUNT_ENDPOINTS = {
|
|
12
|
+
BASE: '/api/accounts/',
|
|
13
|
+
DETAIL: (uuid) => `/api/accounts/${uuid}/`,
|
|
14
|
+
};
|
|
15
|
+
// Authentication endpoints
|
|
16
|
+
exports.AUTH_ENDPOINTS = {
|
|
17
|
+
BASE: '/api/auth/',
|
|
18
|
+
LOGIN: '/api/auth/login/',
|
|
19
|
+
LOGOUT: '/api/auth/logout/',
|
|
20
|
+
REFRESH: '/api/auth/refresh/',
|
|
21
|
+
VERIFY: '/api/auth/verify/',
|
|
22
|
+
};
|
|
23
|
+
// Bank endpoints
|
|
24
|
+
exports.BANK_ENDPOINTS = {
|
|
25
|
+
BASE: '/api/banks/',
|
|
26
|
+
DETAIL: (uuid) => `/api/banks/${uuid}/`,
|
|
27
|
+
ACCOUNTS: '/api/bank-accounts/',
|
|
28
|
+
ACCOUNT_DETAIL: (uuid) => `/api/bank-accounts/${uuid}/`,
|
|
29
|
+
};
|
|
30
|
+
// Cash account endpoints
|
|
31
|
+
exports.CASH_ACCOUNT_ENDPOINTS = {
|
|
32
|
+
BASE: '/api/cash-accounts/',
|
|
33
|
+
DETAIL: (uuid) => `/api/cash-accounts/${uuid}/`,
|
|
34
|
+
TRANSACTIONS: (uuid) => `/api/cash-accounts/${uuid}/transactions/`,
|
|
35
|
+
};
|
|
36
|
+
// Country endpoints
|
|
37
|
+
exports.COUNTRY_ENDPOINTS = {
|
|
38
|
+
BASE: '/api/countries/',
|
|
39
|
+
DETAIL: (uuid) => `/api/countries/${uuid}/`,
|
|
40
|
+
};
|
|
41
|
+
// Document endpoints
|
|
42
|
+
exports.DOCUMENT_ENDPOINTS = {
|
|
43
|
+
BASE: '/api/documents/',
|
|
44
|
+
DETAIL: (uuid) => `/api/documents/${uuid}/`,
|
|
45
|
+
DOWNLOAD: (uuid) => `/api/documents/${uuid}/download/`,
|
|
46
|
+
SIGN: (uuid) => `/api/documents/${uuid}/sign/`,
|
|
47
|
+
};
|
|
48
|
+
// Industry endpoints
|
|
49
|
+
exports.INDUSTRY_ENDPOINTS = {
|
|
50
|
+
BASE: '/api/industries/',
|
|
51
|
+
DETAIL: (uuid) => `/api/industries/${uuid}/`,
|
|
52
|
+
};
|
|
53
|
+
// Instrument endpoints
|
|
54
|
+
exports.INSTRUMENT_ENDPOINTS = {
|
|
55
|
+
BASE: '/api/instruments/',
|
|
56
|
+
DETAIL: (uuid) => `/api/instruments/${uuid}/`,
|
|
57
|
+
PRICES: (uuid) => `/api/instruments/${uuid}/prices/`,
|
|
58
|
+
QUOTE: (uuid) => `/api/instruments/${uuid}/quote/`,
|
|
59
|
+
};
|
|
60
|
+
// Portfolio endpoints
|
|
61
|
+
exports.PORTFOLIO_ENDPOINTS = {
|
|
62
|
+
BASE: '/api/portfolios/',
|
|
63
|
+
DETAIL: (uuid) => `/api/portfolios/${uuid}/`,
|
|
64
|
+
ALLOCATIONS: (uuid) => `/api/portfolios/${uuid}/allocations/`,
|
|
65
|
+
HOLDINGS: (uuid) => `/api/portfolios/${uuid}/holdings/`,
|
|
66
|
+
PERFORMANCE: (uuid) => `/api/portfolios/${uuid}/performance/`,
|
|
67
|
+
TRANSACTIONS: (uuid) => `/api/portfolios/${uuid}/transactions/`,
|
|
68
|
+
};
|
|
69
|
+
// Portfolio template endpoints
|
|
70
|
+
exports.PORTFOLIO_TEMPLATE_ENDPOINTS = {
|
|
71
|
+
BASE: '/api/portfolio-templates/',
|
|
72
|
+
DETAIL: (uuid) => `/api/portfolio-templates/${uuid}/`,
|
|
73
|
+
ALLOCATIONS: (uuid) => `/api/portfolio-templates/${uuid}/allocations/`,
|
|
74
|
+
RECOMMENDED: '/api/portfolio-templates/recommended/',
|
|
75
|
+
};
|
|
76
|
+
// Sector endpoints
|
|
77
|
+
exports.SECTOR_ENDPOINTS = {
|
|
78
|
+
BASE: '/api/sectors/',
|
|
79
|
+
DETAIL: (uuid) => `/api/sectors/${uuid}/`,
|
|
80
|
+
};
|
|
81
|
+
// Stock exchange endpoints
|
|
82
|
+
exports.STOCK_EXCHANGE_ENDPOINTS = {
|
|
83
|
+
BASE: '/api/stock-exchanges/',
|
|
84
|
+
DETAIL: (uuid) => `/api/stock-exchanges/${uuid}/`,
|
|
85
|
+
};
|
|
86
|
+
// Tax residency endpoints
|
|
87
|
+
exports.TAX_RESIDENCY_ENDPOINTS = {
|
|
88
|
+
BASE: '/api/tax-residencies/',
|
|
89
|
+
DETAIL: (uuid) => `/api/tax-residencies/${uuid}/`,
|
|
90
|
+
};
|
|
91
|
+
// Trade endpoints
|
|
92
|
+
exports.TRADE_ENDPOINTS = {
|
|
93
|
+
BASE: '/api/trades/',
|
|
94
|
+
DETAIL: (uuid) => `/api/trades/${uuid}/`,
|
|
95
|
+
CANCEL: (uuid) => `/api/trades/${uuid}/cancel/`,
|
|
96
|
+
CONFIRM: (uuid) => `/api/trades/${uuid}/confirm/`,
|
|
97
|
+
};
|
|
98
|
+
// User endpoints
|
|
99
|
+
exports.USER_ENDPOINTS = {
|
|
100
|
+
BASE: '/api/users/',
|
|
101
|
+
DETAIL: (uuid) => `/api/users/${uuid}/`,
|
|
102
|
+
PROFILE: '/api/users/profile/',
|
|
103
|
+
PREFERENCES: '/api/users/preferences/',
|
|
104
|
+
INVESTMENT_PREFERENCES: '/api/users/investment-preferences/',
|
|
105
|
+
};
|
|
106
|
+
// Withdrawal endpoints
|
|
107
|
+
exports.WITHDRAWAL_ENDPOINTS = {
|
|
108
|
+
BASE: '/api/withdrawals/',
|
|
109
|
+
DETAIL: (uuid) => `/api/withdrawals/${uuid}/`,
|
|
110
|
+
CANCEL: (uuid) => `/api/withdrawals/${uuid}/cancel/`,
|
|
111
|
+
APPROVE: (uuid) => `/api/withdrawals/${uuid}/approve/`,
|
|
112
|
+
REJECT: (uuid) => `/api/withdrawals/${uuid}/reject/`,
|
|
113
|
+
};
|
|
114
|
+
// Transaction endpoints (cash account transactions)
|
|
115
|
+
exports.TRANSACTION_ENDPOINTS = {
|
|
116
|
+
BASE: '/api/transactions/',
|
|
117
|
+
DETAIL: (uuid) => `/api/transactions/${uuid}/`,
|
|
118
|
+
};
|
|
119
|
+
// Asset allocation endpoints
|
|
120
|
+
exports.ASSET_ALLOCATION_ENDPOINTS = {
|
|
121
|
+
BASE: '/api/asset-allocations/',
|
|
122
|
+
DETAIL: (uuid) => `/api/asset-allocations/${uuid}/`,
|
|
123
|
+
};
|
|
124
|
+
// Asset holding endpoints
|
|
125
|
+
exports.ASSET_HOLDING_ENDPOINTS = {
|
|
126
|
+
BASE: '/api/asset-holdings/',
|
|
127
|
+
DETAIL: (uuid) => `/api/asset-holdings/${uuid}/`,
|
|
128
|
+
};
|
|
129
|
+
// Asset holding snapshot endpoints
|
|
130
|
+
exports.ASSET_HOLDING_SNAPSHOT_ENDPOINTS = {
|
|
131
|
+
BASE: '/api/asset-holding-snapshots/',
|
|
132
|
+
DETAIL: (id) => `/api/asset-holding-snapshots/${id}/`,
|
|
133
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP-related constants
|
|
3
|
+
*/
|
|
4
|
+
export declare const HTTP_STATUS: {
|
|
5
|
+
readonly OK: 200;
|
|
6
|
+
readonly CREATED: 201;
|
|
7
|
+
readonly ACCEPTED: 202;
|
|
8
|
+
readonly NO_CONTENT: 204;
|
|
9
|
+
readonly MOVED_PERMANENTLY: 301;
|
|
10
|
+
readonly FOUND: 302;
|
|
11
|
+
readonly NOT_MODIFIED: 304;
|
|
12
|
+
readonly BAD_REQUEST: 400;
|
|
13
|
+
readonly UNAUTHORIZED: 401;
|
|
14
|
+
readonly FORBIDDEN: 403;
|
|
15
|
+
readonly NOT_FOUND: 404;
|
|
16
|
+
readonly METHOD_NOT_ALLOWED: 405;
|
|
17
|
+
readonly CONFLICT: 409;
|
|
18
|
+
readonly UNPROCESSABLE_ENTITY: 422;
|
|
19
|
+
readonly TOO_MANY_REQUESTS: 429;
|
|
20
|
+
readonly INTERNAL_SERVER_ERROR: 500;
|
|
21
|
+
readonly BAD_GATEWAY: 502;
|
|
22
|
+
readonly SERVICE_UNAVAILABLE: 503;
|
|
23
|
+
readonly GATEWAY_TIMEOUT: 504;
|
|
24
|
+
};
|
|
25
|
+
export type HttpStatus = typeof HTTP_STATUS[keyof typeof HTTP_STATUS];
|
|
26
|
+
export declare const HTTP_HEADERS: {
|
|
27
|
+
readonly ACCEPT: "Accept";
|
|
28
|
+
readonly AUTHORIZATION: "Authorization";
|
|
29
|
+
readonly CONTENT_TYPE: "Content-Type";
|
|
30
|
+
readonly CACHE_CONTROL: "Cache-Control";
|
|
31
|
+
readonly USER_AGENT: "User-Agent";
|
|
32
|
+
readonly X_REQUESTED_WITH: "X-Requested-With";
|
|
33
|
+
readonly X_CSRF_TOKEN: "X-CSRFToken";
|
|
34
|
+
};
|
|
35
|
+
export declare const CONTENT_TYPES: {
|
|
36
|
+
readonly JSON: "application/json";
|
|
37
|
+
readonly FORM_DATA: "multipart/form-data";
|
|
38
|
+
readonly URL_ENCODED: "application/x-www-form-urlencoded";
|
|
39
|
+
readonly TEXT: "text/plain";
|
|
40
|
+
readonly HTML: "text/html";
|
|
41
|
+
readonly XML: "application/xml";
|
|
42
|
+
readonly PDF: "application/pdf";
|
|
43
|
+
};
|
|
44
|
+
export type ContentType = typeof CONTENT_TYPES[keyof typeof CONTENT_TYPES];
|
|
45
|
+
export declare const HTTP_METHODS: {
|
|
46
|
+
readonly GET: "GET";
|
|
47
|
+
readonly POST: "POST";
|
|
48
|
+
readonly PUT: "PUT";
|
|
49
|
+
readonly PATCH: "PATCH";
|
|
50
|
+
readonly DELETE: "DELETE";
|
|
51
|
+
readonly HEAD: "HEAD";
|
|
52
|
+
readonly OPTIONS: "OPTIONS";
|
|
53
|
+
};
|
|
54
|
+
export type HttpMethod = typeof HTTP_METHODS[keyof typeof HTTP_METHODS];
|
|
55
|
+
//# sourceMappingURL=http.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/api/http.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;CA2Bd,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,OAAO,WAAW,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC;AAGtE,eAAO,MAAM,YAAY;;;;;;;;CAQf,CAAC;AAGX,eAAO,MAAM,aAAa;;;;;;;;CAQhB,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,OAAO,aAAa,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAG3E,eAAO,MAAM,YAAY;;;;;;;;CAQf,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,OAAO,YAAY,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC"}
|
package/dist/api/http.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* HTTP-related constants
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.HTTP_METHODS = exports.CONTENT_TYPES = exports.HTTP_HEADERS = exports.HTTP_STATUS = void 0;
|
|
7
|
+
// HTTP Status Codes
|
|
8
|
+
exports.HTTP_STATUS = {
|
|
9
|
+
// 2xx Success
|
|
10
|
+
OK: 200,
|
|
11
|
+
CREATED: 201,
|
|
12
|
+
ACCEPTED: 202,
|
|
13
|
+
NO_CONTENT: 204,
|
|
14
|
+
// 3xx Redirection
|
|
15
|
+
MOVED_PERMANENTLY: 301,
|
|
16
|
+
FOUND: 302,
|
|
17
|
+
NOT_MODIFIED: 304,
|
|
18
|
+
// 4xx Client Errors
|
|
19
|
+
BAD_REQUEST: 400,
|
|
20
|
+
UNAUTHORIZED: 401,
|
|
21
|
+
FORBIDDEN: 403,
|
|
22
|
+
NOT_FOUND: 404,
|
|
23
|
+
METHOD_NOT_ALLOWED: 405,
|
|
24
|
+
CONFLICT: 409,
|
|
25
|
+
UNPROCESSABLE_ENTITY: 422,
|
|
26
|
+
TOO_MANY_REQUESTS: 429,
|
|
27
|
+
// 5xx Server Errors
|
|
28
|
+
INTERNAL_SERVER_ERROR: 500,
|
|
29
|
+
BAD_GATEWAY: 502,
|
|
30
|
+
SERVICE_UNAVAILABLE: 503,
|
|
31
|
+
GATEWAY_TIMEOUT: 504,
|
|
32
|
+
};
|
|
33
|
+
// HTTP Headers
|
|
34
|
+
exports.HTTP_HEADERS = {
|
|
35
|
+
ACCEPT: 'Accept',
|
|
36
|
+
AUTHORIZATION: 'Authorization',
|
|
37
|
+
CONTENT_TYPE: 'Content-Type',
|
|
38
|
+
CACHE_CONTROL: 'Cache-Control',
|
|
39
|
+
USER_AGENT: 'User-Agent',
|
|
40
|
+
X_REQUESTED_WITH: 'X-Requested-With',
|
|
41
|
+
X_CSRF_TOKEN: 'X-CSRFToken',
|
|
42
|
+
};
|
|
43
|
+
// Content Types
|
|
44
|
+
exports.CONTENT_TYPES = {
|
|
45
|
+
JSON: 'application/json',
|
|
46
|
+
FORM_DATA: 'multipart/form-data',
|
|
47
|
+
URL_ENCODED: 'application/x-www-form-urlencoded',
|
|
48
|
+
TEXT: 'text/plain',
|
|
49
|
+
HTML: 'text/html',
|
|
50
|
+
XML: 'application/xml',
|
|
51
|
+
PDF: 'application/pdf',
|
|
52
|
+
};
|
|
53
|
+
// HTTP Methods
|
|
54
|
+
exports.HTTP_METHODS = {
|
|
55
|
+
GET: 'GET',
|
|
56
|
+
POST: 'POST',
|
|
57
|
+
PUT: 'PUT',
|
|
58
|
+
PATCH: 'PATCH',
|
|
59
|
+
DELETE: 'DELETE',
|
|
60
|
+
HEAD: 'HEAD',
|
|
61
|
+
OPTIONS: 'OPTIONS',
|
|
62
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* API-related constants
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
17
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
__exportStar(require("./endpoints"), exports);
|
|
21
|
+
__exportStar(require("./http"), exports);
|
|
22
|
+
__exportStar(require("./config"), exports);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Account-related business constants
|
|
3
|
+
*/
|
|
4
|
+
export declare const ACCOUNT_TYPE: {
|
|
5
|
+
readonly TRANSACTION: "TRANSACTION";
|
|
6
|
+
readonly SAVINGS: "SAVINGS";
|
|
7
|
+
readonly OTHER: "OTHER";
|
|
8
|
+
};
|
|
9
|
+
export type AccountType = typeof ACCOUNT_TYPE[keyof typeof ACCOUNT_TYPE];
|
|
10
|
+
export declare const ACCOUNT_TYPE_LABELS: Record<AccountType, string>;
|
|
11
|
+
export declare const SOURCE_OF_FUNDS: {
|
|
12
|
+
readonly SALARY: "SALARY";
|
|
13
|
+
readonly SAVINGS: "SAVINGS";
|
|
14
|
+
readonly INHERITANCE: "INHERITANCE";
|
|
15
|
+
readonly GIFT: "GIFT";
|
|
16
|
+
readonly INVESTMENT: "INVESTMENT";
|
|
17
|
+
readonly BUSINESS: "BUSINESS";
|
|
18
|
+
readonly OTHER: "OTHER";
|
|
19
|
+
};
|
|
20
|
+
export type SourceOfFunds = typeof SOURCE_OF_FUNDS[keyof typeof SOURCE_OF_FUNDS];
|
|
21
|
+
export declare const SOURCE_OF_FUNDS_LABELS: Record<SourceOfFunds, string>;
|
|
22
|
+
export declare const ACCOUNT_TYPE_OPTIONS: {
|
|
23
|
+
value: string;
|
|
24
|
+
label: string;
|
|
25
|
+
}[];
|
|
26
|
+
export declare const SOURCE_OF_FUNDS_OPTIONS: {
|
|
27
|
+
value: string;
|
|
28
|
+
label: string;
|
|
29
|
+
}[];
|
|
30
|
+
//# sourceMappingURL=accounts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../src/business/accounts.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,eAAO,MAAM,YAAY;;;;CAIf,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,OAAO,YAAY,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAEzE,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAIlD,CAAC;AAGX,eAAO,MAAM,eAAe;;;;;;;;CAQlB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,OAAO,eAAe,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;AAEjF,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAQvD,CAAC;AAGX,eAAO,MAAM,oBAAoB;;;GAG9B,CAAC;AAEJ,eAAO,MAAM,uBAAuB;;;GAGjC,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Account-related business constants
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SOURCE_OF_FUNDS_OPTIONS = exports.ACCOUNT_TYPE_OPTIONS = exports.SOURCE_OF_FUNDS_LABELS = exports.SOURCE_OF_FUNDS = exports.ACCOUNT_TYPE_LABELS = exports.ACCOUNT_TYPE = void 0;
|
|
7
|
+
// Account types
|
|
8
|
+
exports.ACCOUNT_TYPE = {
|
|
9
|
+
TRANSACTION: 'TRANSACTION',
|
|
10
|
+
SAVINGS: 'SAVINGS',
|
|
11
|
+
OTHER: 'OTHER',
|
|
12
|
+
};
|
|
13
|
+
exports.ACCOUNT_TYPE_LABELS = {
|
|
14
|
+
[exports.ACCOUNT_TYPE.TRANSACTION]: 'Transaction Account',
|
|
15
|
+
[exports.ACCOUNT_TYPE.SAVINGS]: 'Savings Account',
|
|
16
|
+
[exports.ACCOUNT_TYPE.OTHER]: 'Other',
|
|
17
|
+
};
|
|
18
|
+
// Source of funds
|
|
19
|
+
exports.SOURCE_OF_FUNDS = {
|
|
20
|
+
SALARY: 'SALARY',
|
|
21
|
+
SAVINGS: 'SAVINGS',
|
|
22
|
+
INHERITANCE: 'INHERITANCE',
|
|
23
|
+
GIFT: 'GIFT',
|
|
24
|
+
INVESTMENT: 'INVESTMENT',
|
|
25
|
+
BUSINESS: 'BUSINESS',
|
|
26
|
+
OTHER: 'OTHER',
|
|
27
|
+
};
|
|
28
|
+
exports.SOURCE_OF_FUNDS_LABELS = {
|
|
29
|
+
[exports.SOURCE_OF_FUNDS.SALARY]: 'Salary/Wages',
|
|
30
|
+
[exports.SOURCE_OF_FUNDS.SAVINGS]: 'Personal Savings',
|
|
31
|
+
[exports.SOURCE_OF_FUNDS.INHERITANCE]: 'Inheritance',
|
|
32
|
+
[exports.SOURCE_OF_FUNDS.GIFT]: 'Gift',
|
|
33
|
+
[exports.SOURCE_OF_FUNDS.INVESTMENT]: 'Investment Returns',
|
|
34
|
+
[exports.SOURCE_OF_FUNDS.BUSINESS]: 'Business Income',
|
|
35
|
+
[exports.SOURCE_OF_FUNDS.OTHER]: 'Other',
|
|
36
|
+
};
|
|
37
|
+
// Account options for forms
|
|
38
|
+
exports.ACCOUNT_TYPE_OPTIONS = Object.entries(exports.ACCOUNT_TYPE_LABELS).map(([value, label]) => ({
|
|
39
|
+
value,
|
|
40
|
+
label,
|
|
41
|
+
}));
|
|
42
|
+
exports.SOURCE_OF_FUNDS_OPTIONS = Object.entries(exports.SOURCE_OF_FUNDS_LABELS).map(([value, label]) => ({
|
|
43
|
+
value,
|
|
44
|
+
label,
|
|
45
|
+
}));
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Banking-related business constants
|
|
3
|
+
*/
|
|
4
|
+
export declare const BANK_ACCOUNT_TYPE: {
|
|
5
|
+
readonly CHECKING: "CHECKING";
|
|
6
|
+
readonly SAVINGS: "SAVINGS";
|
|
7
|
+
readonly BUSINESS: "BUSINESS";
|
|
8
|
+
readonly INVESTMENT: "INVESTMENT";
|
|
9
|
+
readonly OTHER: "OTHER";
|
|
10
|
+
};
|
|
11
|
+
export type BankAccountType = typeof BANK_ACCOUNT_TYPE[keyof typeof BANK_ACCOUNT_TYPE];
|
|
12
|
+
export declare const BANK_ACCOUNT_TYPE_LABELS: Record<BankAccountType, string>;
|
|
13
|
+
export declare const BANKING_INSTITUTION: {
|
|
14
|
+
readonly CBA: "CBA";
|
|
15
|
+
readonly ANZ: "ANZ";
|
|
16
|
+
readonly NAB: "NAB";
|
|
17
|
+
readonly WESTPAC: "WESTPAC";
|
|
18
|
+
readonly MACQUARIE: "MACQUARIE";
|
|
19
|
+
readonly ING: "ING";
|
|
20
|
+
readonly BENDIGO: "BENDIGO";
|
|
21
|
+
readonly SUNCORP: "SUNCORP";
|
|
22
|
+
readonly OTHER: "OTHER";
|
|
23
|
+
};
|
|
24
|
+
export type BankingInstitution = typeof BANKING_INSTITUTION[keyof typeof BANKING_INSTITUTION];
|
|
25
|
+
export declare const BANKING_INSTITUTION_LABELS: Record<BankingInstitution, string>;
|
|
26
|
+
export declare const VERIFICATION_METHOD: {
|
|
27
|
+
readonly MICRO_DEPOSIT: "MICRO_DEPOSIT";
|
|
28
|
+
readonly INSTANT: "INSTANT";
|
|
29
|
+
readonly MANUAL: "MANUAL";
|
|
30
|
+
readonly DOCUMENT: "DOCUMENT";
|
|
31
|
+
};
|
|
32
|
+
export type VerificationMethod = typeof VERIFICATION_METHOD[keyof typeof VERIFICATION_METHOD];
|
|
33
|
+
export declare const VERIFICATION_METHOD_LABELS: Record<VerificationMethod, string>;
|
|
34
|
+
export declare const BSB_VALIDATION: {
|
|
35
|
+
readonly LENGTH: 6;
|
|
36
|
+
readonly PATTERN: RegExp;
|
|
37
|
+
readonly FORMAT_PATTERN: RegExp;
|
|
38
|
+
};
|
|
39
|
+
export declare const ACCOUNT_NUMBER_VALIDATION: {
|
|
40
|
+
readonly MIN_LENGTH: 4;
|
|
41
|
+
readonly MAX_LENGTH: 10;
|
|
42
|
+
readonly PATTERN: RegExp;
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=banking.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"banking.d.ts","sourceRoot":"","sources":["../../src/business/banking.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,eAAO,MAAM,iBAAiB;;;;;;CAMpB,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,OAAO,iBAAiB,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAC;AAEvF,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,CAM3D,CAAC;AAGX,eAAO,MAAM,mBAAmB;;;;;;;;;;CAetB,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAAG,OAAO,mBAAmB,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC;AAE9F,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAUhE,CAAC;AAGX,eAAO,MAAM,mBAAmB;;;;;CAKtB,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAAG,OAAO,mBAAmB,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC;AAE9F,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAKhE,CAAC;AAGX,eAAO,MAAM,cAAc;;;;CAIjB,CAAC;AAGX,eAAO,MAAM,yBAAyB;;;;CAI5B,CAAC"}
|