Compare commits
2
Commits
bb49d8d825
...
7df5782ce5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7df5782ce5 | ||
|
|
22668da3fa |
@@ -56,6 +56,7 @@ export default defineConfig(
|
|||||||
'after',
|
'after',
|
||||||
{ overrides: { '?': 'before', ':': 'before' } },
|
{ overrides: { '?': 'before', ':': 'before' } },
|
||||||
],
|
],
|
||||||
|
'import-x/no-cycle': 'error',
|
||||||
'import-x/no-duplicates': ['error', { 'prefer-inline': true }],
|
'import-x/no-duplicates': ['error', { 'prefer-inline': true }],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -211,4 +212,24 @@ export default defineConfig(
|
|||||||
'@typescript-eslint/no-unsafe-enum-comparison': 'error',
|
'@typescript-eslint/no-unsafe-enum-comparison': 'error',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
files: ['src/**/*.ts'],
|
||||||
|
ignores: [...tests, 'src/modules/investments/tbank-sync/**'],
|
||||||
|
rules: {
|
||||||
|
// Separate rule so it does not replace layer-specific no-restricted-imports configs.
|
||||||
|
'import-x/no-restricted-paths': ['error', {
|
||||||
|
zones: [{
|
||||||
|
target: './src',
|
||||||
|
from: './src/modules/investments/tbank-sync',
|
||||||
|
except: [
|
||||||
|
'./tbank-sync.api.ts',
|
||||||
|
'./tbank-sync.dto.ts',
|
||||||
|
'./tbank-sync.module.ts',
|
||||||
|
'./tbank-sync-repository.module.ts',
|
||||||
|
],
|
||||||
|
message: 'Use tbank-sync.api for cross-module access.',
|
||||||
|
}],
|
||||||
|
}],
|
||||||
|
},
|
||||||
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import {
|
|||||||
import { investmentResourceMeta } from '../investment-resource.mapper';
|
import { investmentResourceMeta } from '../investment-resource.mapper';
|
||||||
import { sumMoneyByCurrency } from '../portfolio/domain/portfolio-totals';
|
import { sumMoneyByCurrency } from '../portfolio/domain/portfolio-totals';
|
||||||
import { PortfolioPositionDto, PortfolioService } from '../portfolio/portfolio.api';
|
import { PortfolioPositionDto, PortfolioService } from '../portfolio/portfolio.api';
|
||||||
import { hourlyAttempt, TbankSyncRepository } from '../tbank-sync/tbank-sync.repository';
|
import { hourlyAttempt, TbankSyncRepository } from '../tbank-sync/tbank-sync.api';
|
||||||
import {
|
import {
|
||||||
BrokerageAccountDto,
|
BrokerageAccountDto,
|
||||||
BrokerageAccountsResourceDto,
|
BrokerageAccountsResourceDto,
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
export const operationCategories = [
|
||||||
|
'trade',
|
||||||
|
'income',
|
||||||
|
'tax',
|
||||||
|
'fee',
|
||||||
|
'transfer',
|
||||||
|
'other',
|
||||||
|
] as const;
|
||||||
|
|
||||||
|
export type OperationCategory = (typeof operationCategories)[number];
|
||||||
@@ -20,7 +20,7 @@ import {
|
|||||||
import {
|
import {
|
||||||
hourlyAttempt,
|
hourlyAttempt,
|
||||||
TbankSyncRepository,
|
TbankSyncRepository,
|
||||||
} from '../../tbank-sync/tbank-sync.repository';
|
} from '../../tbank-sync/tbank-sync.api';
|
||||||
import { OperationErrorCode } from '../domain/operation-error-code';
|
import { OperationErrorCode } from '../domain/operation-error-code';
|
||||||
import {
|
import {
|
||||||
confirmedOperationRanges,
|
confirmedOperationRanges,
|
||||||
|
|||||||
@@ -3,10 +3,8 @@ import { MILLISECONDS_PER_SECOND } from '../../../../common/time';
|
|||||||
import { decimal } from '../../../../integrations/tbank/decimal';
|
import { decimal } from '../../../../integrations/tbank/decimal';
|
||||||
import { TbankOperationType } from '../../../../integrations/tbank/tbank-protocol';
|
import { TbankOperationType } from '../../../../integrations/tbank/tbank-protocol';
|
||||||
import { TbankMoney, TbankOperationItem } from '../../../../integrations/tbank/tbank.api';
|
import { TbankMoney, TbankOperationItem } from '../../../../integrations/tbank/tbank.api';
|
||||||
import {
|
import { type OperationCategory } from '../../operation-category';
|
||||||
BrokerageOperationDto,
|
import { BrokerageOperationDto } from '../presentation/brokerage-operation.dto';
|
||||||
OperationCategory,
|
|
||||||
} from '../presentation/brokerage-operation.dto';
|
|
||||||
|
|
||||||
const MISSING_TIMESTAMP_COMPONENT = 0;
|
const MISSING_TIMESTAMP_COMPONENT = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -5,4 +5,3 @@ export type { OperationInterval } from './domain/operations-sync-plan';
|
|||||||
|
|
||||||
// Public cross-module surface. Nest providers are exported by the matching module.
|
// Public cross-module surface. Nest providers are exported by the matching module.
|
||||||
export { BrokerageOperationDto } from './presentation/brokerage-operation.dto';
|
export { BrokerageOperationDto } from './presentation/brokerage-operation.dto';
|
||||||
export { operationCategories } from './presentation/brokerage-operation.dto';
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import {
|
|||||||
import { MoneyDto } from '../../../../common/money.dto';
|
import { MoneyDto } from '../../../../common/money.dto';
|
||||||
import { AccountReferenceDto } from '../../account-reference.dto';
|
import { AccountReferenceDto } from '../../account-reference.dto';
|
||||||
import { InvestmentResourceMetaDto } from '../../investment-resource.dto';
|
import { InvestmentResourceMetaDto } from '../../investment-resource.dto';
|
||||||
|
import { operationCategories, type OperationCategory } from '../../operation-category';
|
||||||
|
|
||||||
const MIN_OPERATIONS_PAGE_SIZE = 1;
|
const MIN_OPERATIONS_PAGE_SIZE = 1;
|
||||||
|
|
||||||
@@ -23,16 +24,6 @@ const MAX_CURSOR_LENGTH = 4096;
|
|||||||
const MAX_OPERATIONS_PAGE_SIZE = 1000;
|
const MAX_OPERATIONS_PAGE_SIZE = 1000;
|
||||||
export const DEFAULT_OPERATIONS_PAGE_SIZE = 100;
|
export const DEFAULT_OPERATIONS_PAGE_SIZE = 100;
|
||||||
|
|
||||||
export const operationCategories = [
|
|
||||||
'trade',
|
|
||||||
'income',
|
|
||||||
'tax',
|
|
||||||
'fee',
|
|
||||||
'transfer',
|
|
||||||
'other',
|
|
||||||
] as const;
|
|
||||||
export type OperationCategory = (typeof operationCategories)[number];
|
|
||||||
|
|
||||||
export class BrokerageOperationsQueryDto {
|
export class BrokerageOperationsQueryDto {
|
||||||
@ApiPropertyOptional({
|
@ApiPropertyOptional({
|
||||||
format: 'uuid',
|
format: 'uuid',
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import { investmentResourceMeta } from '../../investment-resource.mapper';
|
|||||||
import {
|
import {
|
||||||
hourlyAttempt,
|
hourlyAttempt,
|
||||||
TbankSyncRepository,
|
TbankSyncRepository,
|
||||||
} from '../../tbank-sync/tbank-sync.repository';
|
} from '../../tbank-sync/tbank-sync.api';
|
||||||
import { portfolioStructure } from '../domain/portfolio-structure';
|
import { portfolioStructure } from '../domain/portfolio-structure';
|
||||||
import { sumMoneyByCurrency } from '../domain/portfolio-totals';
|
import { sumMoneyByCurrency } from '../domain/portfolio-totals';
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
export { hourlyAttempt, TbankSyncRepository } from './tbank-sync.repository';
|
||||||
@@ -23,7 +23,7 @@ import {
|
|||||||
|
|
||||||
import { MAX_INSTRUMENT_QUERY_LENGTH, MIN_INSTRUMENT_QUERY_LENGTH } from '../instrument-query';
|
import { MAX_INSTRUMENT_QUERY_LENGTH, MIN_INSTRUMENT_QUERY_LENGTH } from '../instrument-query';
|
||||||
import { InvestmentAttemptProblemDto } from '../investment-resource.dto';
|
import { InvestmentAttemptProblemDto } from '../investment-resource.dto';
|
||||||
import { operationCategories } from '../operations/operations.api';
|
import { operationCategories } from '../operation-category';
|
||||||
|
|
||||||
const MIN_ACCOUNT_ID_LENGTH = 1;
|
const MIN_ACCOUNT_ID_LENGTH = 1;
|
||||||
const MIN_SYNC_PAGE_SIZE = 1;
|
const MIN_SYNC_PAGE_SIZE = 1;
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import {
|
|||||||
import {
|
import {
|
||||||
hourlyAttempt,
|
hourlyAttempt,
|
||||||
TbankSyncRepository,
|
TbankSyncRepository,
|
||||||
} from '../tbank-sync/tbank-sync.repository';
|
} from '../tbank-sync/tbank-sync.api';
|
||||||
import { bondEvent, dividendEvent } from './upcoming-event.mapper';
|
import { bondEvent, dividendEvent } from './upcoming-event.mapper';
|
||||||
import {
|
import {
|
||||||
UpcomingEventDto,
|
UpcomingEventDto,
|
||||||
|
|||||||
Reference in New Issue
Block a user