TD-692: Update Prettier, ESLint, CSpell (#245)

This commit is contained in:
Rinat Arsaev 2023-08-14 12:47:45 +04:00 committed by GitHub
parent 56ed199b66
commit eea2a40d3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
210 changed files with 1719 additions and 1175 deletions

1345
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -37,7 +37,7 @@
"@vality/dominant-cache-proto": "2.0.1-99f38c9.0", "@vality/dominant-cache-proto": "2.0.1-99f38c9.0",
"@vality/fistful-proto": "2.0.1-4ff4ea3.0", "@vality/fistful-proto": "2.0.1-4ff4ea3.0",
"@vality/magista-proto": "2.0.2-e46bba2.0", "@vality/magista-proto": "2.0.2-e46bba2.0",
"@vality/ng-core": "16.2.1-pr-33-bd23324.0", "@vality/ng-core": "16.2.1-pr-33-541079b.0",
"@vality/payout-manager-proto": "2.0.1-b079679.0", "@vality/payout-manager-proto": "2.0.1-b079679.0",
"@vality/repairer-proto": "2.0.1-8f7973d.0", "@vality/repairer-proto": "2.0.1-8f7973d.0",
"@vality/thrift-ts": "2.4.1-8ad5123.0", "@vality/thrift-ts": "2.4.1-8ad5123.0",
@ -74,11 +74,11 @@
"@types/jwt-decode": "2.2.1", "@types/jwt-decode": "2.2.1",
"@types/lodash-es": "4.17.6", "@types/lodash-es": "4.17.6",
"@types/papaparse": "5.3.7", "@types/papaparse": "5.3.7",
"@vality/cspell-config": "0.1.1-pr-15-020121f.0", "@vality/cspell-config": "7.0.1-pr-33-8e9a771.0",
"@vality/eslint-config": "1.0.1-pr-27-18c018c.0", "@vality/eslint-config": "8.0.1-pr-33-541079b.0",
"@vality/prettier-config": "0.1.1-pr-15-225ffc3.0", "@vality/prettier-config": "3.0.1-pr-33-1086ab7.0",
"cross-env": "7.0.3", "cross-env": "7.0.3",
"cspell": "6.31.1", "cspell": "^7.0.0",
"dotenv": "16.0.0", "dotenv": "16.0.0",
"eslint": "^8.39.0", "eslint": "^8.39.0",
"jasmine-core": "4.2.0", "jasmine-core": "4.2.0",
@ -89,7 +89,7 @@
"karma-coverage-istanbul-reporter": "3.0.3", "karma-coverage-istanbul-reporter": "3.0.3",
"karma-jasmine": "5.1.0", "karma-jasmine": "5.1.0",
"karma-jasmine-html-reporter": "2.0.0", "karma-jasmine-html-reporter": "2.0.0",
"prettier": "2.8.8", "prettier": "3.0.1",
"typescript": "~5.0.4", "typescript": "~5.0.4",
"typescript-memoize": "1.1.1" "typescript-memoize": "1.1.1"
} }

View File

@ -17,12 +17,12 @@ export class AccounterService {
constructor(private keycloakTokenInfoService: KeycloakTokenInfoService) { constructor(private keycloakTokenInfoService: KeycloakTokenInfoService) {
const headers$ = this.keycloakTokenInfoService.decoded$.pipe( const headers$ = this.keycloakTokenInfoService.decoded$.pipe(
map(toWachterHeaders('Accounter')) map(toWachterHeaders('Accounter')),
); );
const metadata$ = from( const metadata$ = from(
import('@vality/domain-proto/metadata.json').then( import('@vality/domain-proto/metadata.json').then(
(m) => m.default as ThriftAstMetadata[] (m) => m.default as ThriftAstMetadata[],
) ),
); );
this.client$ = combineLatest([metadata$, headers$]).pipe( this.client$ = combineLatest([metadata$, headers$]).pipe(
switchMap(([metadata, headers]) => switchMap(([metadata, headers]) =>
@ -31,8 +31,8 @@ export class AccounterService {
headers, headers,
logging: environment.logging.requests, logging: environment.logging.requests,
path: '/wachter', path: '/wachter',
}) }),
) ),
); );
} }

View File

@ -26,12 +26,12 @@ export class ClaimManagementService {
constructor(private keycloakTokenInfoService: KeycloakTokenInfoService) { constructor(private keycloakTokenInfoService: KeycloakTokenInfoService) {
const headers$ = this.keycloakTokenInfoService.decoded$.pipe( const headers$ = this.keycloakTokenInfoService.decoded$.pipe(
map(toWachterHeaders('ClaimManagement')) map(toWachterHeaders('ClaimManagement')),
); );
const metadata$ = from( const metadata$ = from(
import('@vality/domain-proto/metadata.json').then( import('@vality/domain-proto/metadata.json').then(
(m) => m.default as ThriftAstMetadata[] (m) => m.default as ThriftAstMetadata[],
) ),
); );
this.client$ = combineLatest([metadata$, headers$]).pipe( this.client$ = combineLatest([metadata$, headers$]).pipe(
switchMap(([metadata, headers]) => switchMap(([metadata, headers]) =>
@ -40,8 +40,8 @@ export class ClaimManagementService {
headers, headers,
logging: environment.logging.requests, logging: environment.logging.requests,
path: '/wachter', path: '/wachter',
}) }),
) ),
); );
} }
@ -70,7 +70,7 @@ export class ClaimManagementService {
partyId: PartyID, partyId: PartyID,
id: ClaimID, id: ClaimID,
revision: ClaimRevision, revision: ClaimRevision,
changeset: ModificationChangeset changeset: ModificationChangeset,
): Observable<void> { ): Observable<void> {
return this.client$.pipe(switchMap((c) => c.UpdateClaim(partyId, id, revision, changeset))); return this.client$.pipe(switchMap((c) => c.UpdateClaim(partyId, id, revision, changeset)));
} }
@ -81,12 +81,12 @@ export class ClaimManagementService {
id: ClaimID, id: ClaimID,
revision: ClaimRevision, revision: ClaimRevision,
modificationId: ModificationID, modificationId: ModificationID,
modificationChange: ModificationChange modificationChange: ModificationChange,
): Observable<void> { ): Observable<void> {
return this.client$.pipe( return this.client$.pipe(
switchMap((c) => switchMap((c) =>
c.UpdateModification(partyId, id, revision, modificationId, modificationChange) c.UpdateModification(partyId, id, revision, modificationId, modificationChange),
) ),
); );
} }
@ -95,10 +95,10 @@ export class ClaimManagementService {
partyId: PartyID, partyId: PartyID,
id: ClaimID, id: ClaimID,
revision: ClaimRevision, revision: ClaimRevision,
modificationId: ModificationID modificationId: ModificationID,
): Observable<void> { ): Observable<void> {
return this.client$.pipe( return this.client$.pipe(
switchMap((c) => c.RemoveModification(partyId, id, revision, modificationId)) switchMap((c) => c.RemoveModification(partyId, id, revision, modificationId)),
); );
} }
@ -117,7 +117,7 @@ export class ClaimManagementService {
partyId: PartyID, partyId: PartyID,
id: ClaimID, id: ClaimID,
revision: ClaimRevision, revision: ClaimRevision,
reason: string reason: string,
): Observable<void> { ): Observable<void> {
return this.client$.pipe(switchMap((c) => c.DenyClaim(partyId, id, revision, reason))); return this.client$.pipe(switchMap((c) => c.DenyClaim(partyId, id, revision, reason)));
} }
@ -127,7 +127,7 @@ export class ClaimManagementService {
partyId: PartyID, partyId: PartyID,
id: ClaimID, id: ClaimID,
revision: ClaimRevision, revision: ClaimRevision,
reason: string reason: string,
): Observable<void> { ): Observable<void> {
return this.client$.pipe(switchMap((c) => c.RevokeClaim(partyId, id, revision, reason))); return this.client$.pipe(switchMap((c) => c.RevokeClaim(partyId, id, revision, reason)));
} }

View File

@ -8,5 +8,5 @@ export const CLAIM_STATUSES = enumerate<keyof ClaimStatus>()(
'pending_acceptance', 'pending_acceptance',
'accepted', 'accepted',
'denied', 'denied',
'revoked' 'revoked',
); );

View File

@ -16,12 +16,12 @@ export class DeanonimusService {
constructor(private keycloakTokenInfoService: KeycloakTokenInfoService) { constructor(private keycloakTokenInfoService: KeycloakTokenInfoService) {
const headers$ = this.keycloakTokenInfoService.decoded$.pipe( const headers$ = this.keycloakTokenInfoService.decoded$.pipe(
map(toWachterHeaders('Deanonimus')) map(toWachterHeaders('Deanonimus')),
); );
const metadata$ = from( const metadata$ = from(
import('@vality/deanonimus-proto/metadata.json').then( import('@vality/deanonimus-proto/metadata.json').then(
(m) => m.default as ThriftAstMetadata[] (m) => m.default as ThriftAstMetadata[],
) ),
); );
this.client$ = combineLatest([metadata$, headers$]).pipe( this.client$ = combineLatest([metadata$, headers$]).pipe(
switchMap(([metadata, headers]) => switchMap(([metadata, headers]) =>
@ -30,8 +30,8 @@ export class DeanonimusService {
headers, headers,
logging: environment.logging.requests, logging: environment.logging.requests,
path: '/wachter', path: '/wachter',
}) }),
) ),
); );
} }

View File

@ -18,12 +18,12 @@ export class ManagementService {
constructor(private keycloakTokenInfoService: KeycloakTokenInfoService) { constructor(private keycloakTokenInfoService: KeycloakTokenInfoService) {
const headers$ = this.keycloakTokenInfoService.decoded$.pipe( const headers$ = this.keycloakTokenInfoService.decoded$.pipe(
map(toWachterHeaders('DepositManagement')) map(toWachterHeaders('DepositManagement')),
); );
const metadata$ = from( const metadata$ = from(
import('@vality/fistful-proto/metadata.json').then( import('@vality/fistful-proto/metadata.json').then(
(m) => m.default as ThriftAstMetadata[] (m) => m.default as ThriftAstMetadata[],
) ),
); );
this.client$ = combineLatest([metadata$, headers$]).pipe( this.client$ = combineLatest([metadata$, headers$]).pipe(
switchMap(([metadata, headers]) => switchMap(([metadata, headers]) =>
@ -32,8 +32,8 @@ export class ManagementService {
headers, headers,
logging: environment.logging.requests, logging: environment.logging.requests,
path: '/wachter', path: '/wachter',
}) }),
) ),
); );
} }

View File

@ -20,7 +20,7 @@ export class DomainStoreService {
version$ = defer(() => this.snapshot$).pipe(pluck('version')); version$ = defer(() => this.snapshot$).pipe(pluck('version'));
isLoading$ = inProgressFrom( isLoading$ = inProgressFrom(
() => this.progress$, () => this.progress$,
defer(() => this.snapshot$) defer(() => this.snapshot$),
); );
private snapshot$: Observable<Snapshot> = defer(() => this.reload$).pipe( private snapshot$: Observable<Snapshot> = defer(() => this.reload$).pipe(
@ -28,10 +28,10 @@ export class DomainStoreService {
switchMap(() => switchMap(() =>
this.repositoryService this.repositoryService
.Checkout({ head: {} }) .Checkout({ head: {} })
.pipe(progressTo(this.progress$), handleError(this.notificationErrorService.error)) .pipe(progressTo(this.progress$), handleError(this.notificationErrorService.error)),
), ),
untilDestroyed(this), untilDestroyed(this),
shareReplay(1) shareReplay(1),
); );
private reload$ = new ReplaySubject<void>(1); private reload$ = new ReplaySubject<void>(1);
private progress$ = new BehaviorSubject(0); private progress$ = new BehaviorSubject(0);
@ -39,7 +39,7 @@ export class DomainStoreService {
constructor( constructor(
private repositoryService: RepositoryService, private repositoryService: RepositoryService,
private domainSecretService: DomainSecretService, private domainSecretService: DomainSecretService,
private notificationErrorService: NotificationErrorService private notificationErrorService: NotificationErrorService,
) {} ) {}
forceReload(): void { forceReload(): void {
@ -49,7 +49,7 @@ export class DomainStoreService {
getDomain(raw = false): Observable<Domain> { getDomain(raw = false): Observable<Domain> {
return this.snapshot$.pipe( return this.snapshot$.pipe(
pluck('domain'), pluck('domain'),
map((d) => (raw ? d : this.domainSecretService.reduceDomain(d))) map((d) => (raw ? d : this.domainSecretService.reduceDomain(d))),
); );
} }
@ -58,8 +58,8 @@ export class DomainStoreService {
map((d) => map((d) =>
Array.from(d.values()) Array.from(d.values())
.filter((o) => getUnionKey(o) === objectType) .filter((o) => getUnionKey(o) === objectType)
.map((o) => o[objectType]) .map((o) => o[objectType]),
) ),
); );
} }
@ -69,7 +69,7 @@ export class DomainStoreService {
switchMap((v) => this.repositoryService.Commit(v, commit)), switchMap((v) => this.repositoryService.Commit(v, commit)),
tap(() => { tap(() => {
if (reload) this.forceReload(); if (reload) this.forceReload();
}) }),
); );
} }
} }

View File

@ -16,12 +16,12 @@ export class RepositoryService {
constructor(private keycloakTokenInfoService: KeycloakTokenInfoService) { constructor(private keycloakTokenInfoService: KeycloakTokenInfoService) {
const headers$ = this.keycloakTokenInfoService.decoded$.pipe( const headers$ = this.keycloakTokenInfoService.decoded$.pipe(
map(toWachterHeaders('Domain')) map(toWachterHeaders('Domain')),
); );
const metadata$ = from( const metadata$ = from(
import('@vality/domain-proto/metadata.json').then( import('@vality/domain-proto/metadata.json').then(
(m) => m.default as ThriftAstMetadata[] (m) => m.default as ThriftAstMetadata[],
) ),
); );
this.client$ = combineLatest([metadata$, headers$]).pipe( this.client$ = combineLatest([metadata$, headers$]).pipe(
switchMap(([metadata, headers]) => switchMap(([metadata, headers]) =>
@ -30,8 +30,8 @@ export class RepositoryService {
headers, headers,
logging: environment.logging.requests, logging: environment.logging.requests,
path: '/wachter', path: '/wachter',
}) }),
) ),
); );
} }

View File

@ -16,12 +16,12 @@ export class DominantCacheService {
constructor(private keycloakTokenInfoService: KeycloakTokenInfoService) { constructor(private keycloakTokenInfoService: KeycloakTokenInfoService) {
const headers$ = this.keycloakTokenInfoService.decoded$.pipe( const headers$ = this.keycloakTokenInfoService.decoded$.pipe(
map(toWachterHeaders('DominantCache')) map(toWachterHeaders('DominantCache')),
); );
const metadata$ = from( const metadata$ = from(
import('@vality/dominant-cache-proto/metadata.json').then( import('@vality/dominant-cache-proto/metadata.json').then(
(m) => m.default as ThriftAstMetadata[] (m) => m.default as ThriftAstMetadata[],
) ),
); );
this.client$ = combineLatest([metadata$, headers$]).pipe( this.client$ = combineLatest([metadata$, headers$]).pipe(
switchMap(([metadata, headers]) => switchMap(([metadata, headers]) =>
@ -30,8 +30,8 @@ export class DominantCacheService {
headers, headers,
logging: environment.logging.requests, logging: environment.logging.requests,
path: '/wachter', path: '/wachter',
}) }),
) ),
); );
} }

View File

@ -18,12 +18,12 @@ export class FistfulAdminService {
constructor(private keycloakTokenInfoService: KeycloakTokenInfoService) { constructor(private keycloakTokenInfoService: KeycloakTokenInfoService) {
const headers$ = this.keycloakTokenInfoService.decoded$.pipe( const headers$ = this.keycloakTokenInfoService.decoded$.pipe(
map(toWachterHeaders('FistfulAdmin')) map(toWachterHeaders('FistfulAdmin')),
); );
const metadata$ = from( const metadata$ = from(
import('@vality/fistful-proto/metadata.json').then( import('@vality/fistful-proto/metadata.json').then(
(m) => m.default as ThriftAstMetadata[] (m) => m.default as ThriftAstMetadata[],
) ),
); );
this.client$ = combineLatest([metadata$, headers$]).pipe( this.client$ = combineLatest([metadata$, headers$]).pipe(
switchMap(([metadata, headers]) => switchMap(([metadata, headers]) =>
@ -32,8 +32,8 @@ export class FistfulAdminService {
headers, headers,
logging: environment.logging.requests, logging: environment.logging.requests,
path: '/wachter', path: '/wachter',
}) }),
) ),
); );
} }

View File

@ -16,12 +16,12 @@ export class FistfulStatisticsService {
constructor(private keycloakTokenInfoService: KeycloakTokenInfoService) { constructor(private keycloakTokenInfoService: KeycloakTokenInfoService) {
const headers$ = this.keycloakTokenInfoService.decoded$.pipe( const headers$ = this.keycloakTokenInfoService.decoded$.pipe(
map(toWachterHeaders('FistfulStatistics')) map(toWachterHeaders('FistfulStatistics')),
); );
const metadata$ = from( const metadata$ = from(
import('@vality/fistful-proto/metadata.json').then( import('@vality/fistful-proto/metadata.json').then(
(m) => m.default as ThriftAstMetadata[] (m) => m.default as ThriftAstMetadata[],
) ),
); );
this.client$ = combineLatest([metadata$, headers$]).pipe( this.client$ = combineLatest([metadata$, headers$]).pipe(
switchMap(([metadata, headers]) => switchMap(([metadata, headers]) =>
@ -30,8 +30,8 @@ export class FistfulStatisticsService {
headers, headers,
logging: environment.logging.requests, logging: environment.logging.requests,
path: '/wachter', path: '/wachter',
}) }),
) ),
); );
} }

View File

@ -6,7 +6,7 @@ import { DepositParams } from './deposit-params';
export const depositParamsToRequest = ( export const depositParamsToRequest = (
params: DepositParams, params: DepositParams,
continuationToken?: string continuationToken?: string,
): StatRequest => { ): StatRequest => {
const { const {
fromTime, fromTime,

View File

@ -24,12 +24,12 @@ export class MerchantStatisticsService {
constructor(private keycloakTokenInfoService: KeycloakTokenInfoService) { constructor(private keycloakTokenInfoService: KeycloakTokenInfoService) {
const headers$ = this.keycloakTokenInfoService.decoded$.pipe( const headers$ = this.keycloakTokenInfoService.decoded$.pipe(
map(toWachterHeaders('MerchantStatistics')) map(toWachterHeaders('MerchantStatistics')),
); );
const metadata$ = from( const metadata$ = from(
import('@vality/magista-proto/metadata.json').then( import('@vality/magista-proto/metadata.json').then(
(m) => m.default as ThriftAstMetadata[] (m) => m.default as ThriftAstMetadata[],
) ),
); );
this.client$ = combineLatest([metadata$, headers$]).pipe( this.client$ = combineLatest([metadata$, headers$]).pipe(
switchMap(([metadata, headers]) => switchMap(([metadata, headers]) =>
@ -38,8 +38,8 @@ export class MerchantStatisticsService {
headers, headers,
logging: environment.logging.requests, logging: environment.logging.requests,
path: '/wachter', path: '/wachter',
}) }),
) ),
); );
} }

View File

@ -31,12 +31,12 @@ export class InvoicingService {
constructor(private keycloakTokenInfoService: KeycloakTokenInfoService) { constructor(private keycloakTokenInfoService: KeycloakTokenInfoService) {
const headers$ = this.keycloakTokenInfoService.decoded$.pipe( const headers$ = this.keycloakTokenInfoService.decoded$.pipe(
map(toWachterHeaders('Invoicing')) map(toWachterHeaders('Invoicing')),
); );
const metadata$ = from( const metadata$ = from(
import('@vality/domain-proto/metadata.json').then( import('@vality/domain-proto/metadata.json').then(
(m) => m.default as ThriftAstMetadata[] (m) => m.default as ThriftAstMetadata[],
) ),
); );
this.client$ = combineLatest([metadata$, headers$]).pipe( this.client$ = combineLatest([metadata$, headers$]).pipe(
switchMap(([metadata, headers]) => switchMap(([metadata, headers]) =>
@ -45,8 +45,8 @@ export class InvoicingService {
headers, headers,
logging: environment.logging.requests, logging: environment.logging.requests,
path: '/wachter', path: '/wachter',
}) }),
) ),
); );
} }
@ -59,10 +59,10 @@ export class InvoicingService {
CreatePaymentAdjustment( CreatePaymentAdjustment(
id: InvoiceID, id: InvoiceID,
paymentId: InvoicePaymentID, paymentId: InvoicePaymentID,
params: InvoicePaymentAdjustmentParams params: InvoicePaymentAdjustmentParams,
): Observable<InvoicePaymentAdjustment> { ): Observable<InvoicePaymentAdjustment> {
return this.client$.pipe( return this.client$.pipe(
switchMap((c) => c.CreatePaymentAdjustment(id, paymentId, params)) switchMap((c) => c.CreatePaymentAdjustment(id, paymentId, params)),
); );
} }
@ -70,7 +70,7 @@ export class InvoicingService {
CreateChargeback( CreateChargeback(
id: InvoiceID, id: InvoiceID,
paymentId: InvoicePaymentID, paymentId: InvoicePaymentID,
params: InvoicePaymentChargebackParams params: InvoicePaymentChargebackParams,
): Observable<InvoicePaymentChargeback> { ): Observable<InvoicePaymentChargeback> {
return this.client$.pipe(switchMap((c) => c.CreateChargeback(id, paymentId, params))); return this.client$.pipe(switchMap((c) => c.CreateChargeback(id, paymentId, params)));
} }
@ -80,10 +80,10 @@ export class InvoicingService {
id: InvoiceID, id: InvoiceID,
paymentId: InvoicePaymentID, paymentId: InvoicePaymentID,
chargebackId: InvoicePaymentChargebackID, chargebackId: InvoicePaymentChargebackID,
params: InvoicePaymentChargebackAcceptParams params: InvoicePaymentChargebackAcceptParams,
): Observable<void> { ): Observable<void> {
return this.client$.pipe( return this.client$.pipe(
switchMap((c) => c.AcceptChargeback(id, paymentId, chargebackId, params)) switchMap((c) => c.AcceptChargeback(id, paymentId, chargebackId, params)),
); );
} }
@ -92,10 +92,10 @@ export class InvoicingService {
id: InvoiceID, id: InvoiceID,
paymentId: InvoicePaymentID, paymentId: InvoicePaymentID,
chargebackId: InvoicePaymentChargebackID, chargebackId: InvoicePaymentChargebackID,
params: InvoicePaymentChargebackRejectParams params: InvoicePaymentChargebackRejectParams,
): Observable<void> { ): Observable<void> {
return this.client$.pipe( return this.client$.pipe(
switchMap((c) => c.RejectChargeback(id, paymentId, chargebackId, params)) switchMap((c) => c.RejectChargeback(id, paymentId, chargebackId, params)),
); );
} }
@ -104,10 +104,10 @@ export class InvoicingService {
id: InvoiceID, id: InvoiceID,
paymentId: InvoicePaymentID, paymentId: InvoicePaymentID,
chargebackId: InvoicePaymentChargebackID, chargebackId: InvoicePaymentChargebackID,
params: InvoicePaymentChargebackReopenParams params: InvoicePaymentChargebackReopenParams,
): Observable<void> { ): Observable<void> {
return this.client$.pipe( return this.client$.pipe(
switchMap((c) => c.ReopenChargeback(id, paymentId, chargebackId, params)) switchMap((c) => c.ReopenChargeback(id, paymentId, chargebackId, params)),
); );
} }
@ -116,10 +116,10 @@ export class InvoicingService {
id: InvoiceID, id: InvoiceID,
paymentId: InvoicePaymentID, paymentId: InvoicePaymentID,
chargebackId: InvoicePaymentChargebackID, chargebackId: InvoicePaymentChargebackID,
params: InvoicePaymentChargebackCancelParams params: InvoicePaymentChargebackCancelParams,
): Observable<void> { ): Observable<void> {
return this.client$.pipe( return this.client$.pipe(
switchMap((c) => c.CancelChargeback(id, paymentId, chargebackId, params)) switchMap((c) => c.CancelChargeback(id, paymentId, chargebackId, params)),
); );
} }
} }

View File

@ -17,12 +17,12 @@ export class PartyManagementService {
constructor(private keycloakTokenInfoService: KeycloakTokenInfoService) { constructor(private keycloakTokenInfoService: KeycloakTokenInfoService) {
const headers$ = this.keycloakTokenInfoService.decoded$.pipe( const headers$ = this.keycloakTokenInfoService.decoded$.pipe(
map(toWachterHeaders('PartyManagement')) map(toWachterHeaders('PartyManagement')),
); );
const metadata$ = from( const metadata$ = from(
import('@vality/domain-proto/metadata.json').then( import('@vality/domain-proto/metadata.json').then(
(m) => m.default as ThriftAstMetadata[] (m) => m.default as ThriftAstMetadata[],
) ),
); );
this.client$ = combineLatest([metadata$, headers$]).pipe( this.client$ = combineLatest([metadata$, headers$]).pipe(
switchMap(([metadata, headers]) => switchMap(([metadata, headers]) =>
@ -31,8 +31,8 @@ export class PartyManagementService {
headers, headers,
logging: environment.logging.requests, logging: environment.logging.requests,
path: '/wachter', path: '/wachter',
}) }),
) ),
); );
} }

View File

@ -16,12 +16,12 @@ export class PayoutManagementService {
constructor(private keycloakTokenInfoService: KeycloakTokenInfoService) { constructor(private keycloakTokenInfoService: KeycloakTokenInfoService) {
const headers$ = this.keycloakTokenInfoService.decoded$.pipe( const headers$ = this.keycloakTokenInfoService.decoded$.pipe(
map(toWachterHeaders('PayoutManagement')) map(toWachterHeaders('PayoutManagement')),
); );
const metadata$ = from( const metadata$ = from(
import('@vality/payout-manager-proto/metadata.json').then( import('@vality/payout-manager-proto/metadata.json').then(
(m) => m.default as ThriftAstMetadata[] (m) => m.default as ThriftAstMetadata[],
) ),
); );
this.client$ = combineLatest([metadata$, headers$]).pipe( this.client$ = combineLatest([metadata$, headers$]).pipe(
switchMap(([metadata, headers]) => switchMap(([metadata, headers]) =>
@ -30,8 +30,8 @@ export class PayoutManagementService {
headers, headers,
logging: environment.logging.requests, logging: environment.logging.requests,
path: '/wachter', path: '/wachter',
}) }),
) ),
); );
} }

View File

@ -22,12 +22,12 @@ export class RepairManagementService {
constructor(private keycloakTokenInfoService: KeycloakTokenInfoService) { constructor(private keycloakTokenInfoService: KeycloakTokenInfoService) {
const headers$ = this.keycloakTokenInfoService.decoded$.pipe( const headers$ = this.keycloakTokenInfoService.decoded$.pipe(
map(toWachterHeaders('RepairManagement')) map(toWachterHeaders('RepairManagement')),
); );
const metadata$ = from( const metadata$ = from(
import('@vality/repairer-proto/metadata.json').then( import('@vality/repairer-proto/metadata.json').then(
(m) => m.default as ThriftAstMetadata[] (m) => m.default as ThriftAstMetadata[],
) ),
); );
this.client$ = combineLatest([metadata$, headers$]).pipe( this.client$ = combineLatest([metadata$, headers$]).pipe(
switchMap(([metadata, headers]) => switchMap(([metadata, headers]) =>
@ -36,8 +36,8 @@ export class RepairManagementService {
headers, headers,
logging: environment.logging.requests, logging: environment.logging.requests,
path: '/wachter', path: '/wachter',
}) }),
) ),
); );
} }

View File

@ -18,12 +18,12 @@ export class ManagementService {
constructor(private keycloakTokenInfoService: KeycloakTokenInfoService) { constructor(private keycloakTokenInfoService: KeycloakTokenInfoService) {
const headers$ = this.keycloakTokenInfoService.decoded$.pipe( const headers$ = this.keycloakTokenInfoService.decoded$.pipe(
map(toWachterHeaders('WalletManagement')) map(toWachterHeaders('WalletManagement')),
); );
const metadata$ = from( const metadata$ = from(
import('@vality/fistful-proto/metadata.json').then( import('@vality/fistful-proto/metadata.json').then(
(m) => m.default as ThriftAstMetadata[] (m) => m.default as ThriftAstMetadata[],
) ),
); );
this.client$ = combineLatest([metadata$, headers$]).pipe( this.client$ = combineLatest([metadata$, headers$]).pipe(
switchMap(([metadata, headers]) => switchMap(([metadata, headers]) =>
@ -32,8 +32,8 @@ export class ManagementService {
headers, headers,
logging: environment.logging.requests, logging: environment.logging.requests,
path: '/wachter', path: '/wachter',
}) }),
) ),
); );
} }

View File

@ -17,12 +17,12 @@ export class ManagementService {
constructor(private keycloakTokenInfoService: KeycloakTokenInfoService) { constructor(private keycloakTokenInfoService: KeycloakTokenInfoService) {
const headers$ = this.keycloakTokenInfoService.decoded$.pipe( const headers$ = this.keycloakTokenInfoService.decoded$.pipe(
map(toWachterHeaders('WithdrawalManagement')) map(toWachterHeaders('WithdrawalManagement')),
); );
const metadata$ = from( const metadata$ = from(
import('@vality/fistful-proto/metadata.json').then( import('@vality/fistful-proto/metadata.json').then(
(m) => m.default as ThriftAstMetadata[] (m) => m.default as ThriftAstMetadata[],
) ),
); );
this.client$ = combineLatest([metadata$, headers$]).pipe( this.client$ = combineLatest([metadata$, headers$]).pipe(
switchMap(([metadata, headers]) => switchMap(([metadata, headers]) =>
@ -31,8 +31,8 @@ export class ManagementService {
headers, headers,
logging: environment.logging.requests, logging: environment.logging.requests,
path: '/wachter', path: '/wachter',
}) }),
) ),
); );
} }

View File

@ -15,7 +15,7 @@ import { AppAuthGuardService } from '@cc/app/shared/services';
], ],
{ {
paramsInheritanceStrategy: 'always', paramsInheritanceStrategy: 'always',
} },
), ),
], ],
providers: [AppAuthGuardService], providers: [AppAuthGuardService],

View File

@ -35,7 +35,7 @@ export class AppComponent implements OnInit {
constructor( constructor(
private keycloakService: KeycloakService, private keycloakService: KeycloakService,
private appAuthGuardService: AppAuthGuardService private appAuthGuardService: AppAuthGuardService,
) {} ) {}
ngOnInit() { ngOnInit() {
@ -113,13 +113,13 @@ export class AppComponent implements OnInit {
services: WALLETS_ROUTING_CONFIG.services, services: WALLETS_ROUTING_CONFIG.services,
}, },
], ],
'name' 'name',
), ),
]; ];
return menuItems.map((group) => return menuItems.map((group) =>
group.filter((item) => group.filter((item) =>
this.appAuthGuardService.userHasSomeServiceMethods(item.services) this.appAuthGuardService.userHasSomeServiceMethods(item.services),
) ),
); );
} }
} }

View File

@ -91,7 +91,7 @@ export class AppModule {
constructor( constructor(
private matIconRegistry: MatIconRegistry, private matIconRegistry: MatIconRegistry,
private domSanitizer: DomSanitizer, private domSanitizer: DomSanitizer,
private injector: Injector private injector: Injector,
) { ) {
this.registerIcons(); this.registerIcons();
AppInjector = this.injector; AppInjector = this.injector;
@ -101,7 +101,7 @@ export class AppModule {
for (const name of icons) { for (const name of icons) {
this.matIconRegistry.addSvgIcon( this.matIconRegistry.addSvgIcon(
name, name,
this.domSanitizer.bypassSecurityTrustResourceUrl(`../assets/icons/${name}.svg`) this.domSanitizer.bypassSecurityTrustResourceUrl(`../assets/icons/${name}.svg`),
); );
} }
} }

View File

@ -23,7 +23,7 @@ const initializer = (keycloak: KeycloakService, configService: ConfigService) =>
bearerPrefix: 'Bearer', bearerPrefix: 'Bearer',
}) })
.then(() => keycloak.getToken()), .then(() => keycloak.getToken()),
]) ]),
), ),
]); ]);

View File

@ -64,12 +64,12 @@ export class ChargebacksComponent implements OnInit {
dateRange: DateRange; dateRange: DateRange;
}>, }>,
private fetchChargebacksService: FetchChargebacksService, private fetchChargebacksService: FetchChargebacksService,
private dialog: DialogService private dialog: DialogService,
) {} ) {}
ngOnInit() { ngOnInit() {
this.filtersForm.patchValue( this.filtersForm.patchValue(
merge({}, this.qp.params.filters, clean({ dateRange: this.qp.params.dateRange })) merge({}, this.qp.params.filters, clean({ dateRange: this.qp.params.dateRange })),
); );
this.filtersForm.valueChanges this.filtersForm.valueChanges
.pipe(startWith(null), debounceTime(500), untilDestroyed(this)) .pipe(startWith(null), debounceTime(500), untilDestroyed(this))
@ -102,10 +102,10 @@ export class ChargebacksComponent implements OnInit {
chargeback_statuses: rootParams.chargeback_statuses?.map(createUnion), chargeback_statuses: rootParams.chargeback_statuses?.map(createUnion),
}, },
false, false,
true true,
), ),
}, },
options options,
); );
this.active = this.active =
countProps(rootParams, commonParams) + countProps(rootParams, commonParams) +
@ -118,7 +118,7 @@ export class ChargebacksComponent implements OnInit {
.afterClosed() .afterClosed()
.pipe( .pipe(
filter((res) => res.status === DialogResponseStatus.Success), filter((res) => res.status === DialogResponseStatus.Success),
untilDestroyed(this) untilDestroyed(this),
) )
.subscribe((res) => { .subscribe((res) => {
this.filtersForm.reset({ this.filtersForm.reset({
@ -134,7 +134,7 @@ export class ChargebacksComponent implements OnInit {
.afterClosed() .afterClosed()
.pipe( .pipe(
filter((res) => res.status === DialogResponseStatus.Success), filter((res) => res.status === DialogResponseStatus.Success),
untilDestroyed(this) untilDestroyed(this),
) )
.subscribe(() => { .subscribe(() => {
this.load(); this.load();

View File

@ -59,7 +59,7 @@ export class ChargebacksTableComponent {
formatter: (data) => formatter: (data) =>
this.amountCurrencyService.toMajor( this.amountCurrencyService.toMajor(
data.levy_amount, data.levy_amount,
data.levy_currency_code.symbolic_code data.levy_currency_code.symbolic_code,
), ),
typeParameters: { typeParameters: {
currencyCode: (data) => data.levy_currency_code.symbolic_code, currencyCode: (data) => data.levy_currency_code.symbolic_code,
@ -80,7 +80,7 @@ export class ChargebacksTableComponent {
formatter: (data) => formatter: (data) =>
this.amountCurrencyService.toMajor( this.amountCurrencyService.toMajor(
data.provider_fee, data.provider_fee,
data.currency_code.symbolic_code data.currency_code.symbolic_code,
), ),
typeParameters: { typeParameters: {
currencyCode: (data) => data.currency_code.symbolic_code, currencyCode: (data) => data.currency_code.symbolic_code,
@ -92,7 +92,7 @@ export class ChargebacksTableComponent {
formatter: (data) => formatter: (data) =>
this.amountCurrencyService.toMajor( this.amountCurrencyService.toMajor(
data.external_fee, data.external_fee,
data.currency_code.symbolic_code data.currency_code.symbolic_code,
), ),
typeParameters: { typeParameters: {
currencyCode: (data) => data.currency_code.symbolic_code, currencyCode: (data) => data.currency_code.symbolic_code,

View File

@ -28,7 +28,7 @@ export class CreateChargebackDialogComponent extends DialogSuperclass<
injector: Injector, injector: Injector,
private invoicingService: InvoicingService, private invoicingService: InvoicingService,
private notificationErrorService: NotificationErrorService, private notificationErrorService: NotificationErrorService,
private log: NotifyLogService private log: NotifyLogService,
) { ) {
super(injector); super(injector);
} }
@ -38,7 +38,7 @@ export class CreateChargebackDialogComponent extends DialogSuperclass<
.CreateChargeback( .CreateChargeback(
this.invoiceControl.value, this.invoiceControl.value,
this.paymentControl.value, this.paymentControl.value,
this.form.value as InvoicePaymentChargebackParams this.form.value as InvoicePaymentChargebackParams,
) )
.pipe(untilDestroyed(this)) .pipe(untilDestroyed(this))
.subscribe({ .subscribe({

View File

@ -47,7 +47,7 @@ export class CreateChargebacksByFileDialogComponent
]).pipe( ]).pipe(
switchMap(([file]) => loadFileContent(file)), switchMap(([file]) => loadFileContent(file)),
map((content) => map((content) =>
parseCsv(content, { header: this.hasHeaderControl.value || false, delimiter: ';' }) parseCsv(content, { header: this.hasHeaderControl.value || false, delimiter: ';' }),
), ),
tap((d) => { tap((d) => {
if (!d.errors.length) return; if (!d.errors.length) return;
@ -58,18 +58,18 @@ export class CreateChargebacksByFileDialogComponent
const chargebacks = unifyCsvItems(d?.data, CSV_CHARGEBACK_PROPS); const chargebacks = unifyCsvItems(d?.data, CSV_CHARGEBACK_PROPS);
if (chargebacks[0].invoice_id) return chargebacks; if (chargebacks[0].invoice_id) return chargebacks;
this.log.error( this.log.error(
'Perhaps you incorrectly checked the checkbox to have or not a header (the first element does not have at least an invoice ID)' 'Perhaps you incorrectly checked the checkbox to have or not a header (the first element does not have at least an invoice ID)',
); );
return []; return [];
}), }),
shareReplay({ refCount: true, bufferSize: 1 }) shareReplay({ refCount: true, bufferSize: 1 }),
); );
successfullyChargebacks: InvoicePaymentChargeback[] = []; successfullyChargebacks: InvoicePaymentChargeback[] = [];
constructor( constructor(
injector: Injector, injector: Injector,
private invoicingService: InvoicingService, private invoicingService: InvoicingService,
private log: NotifyLogService private log: NotifyLogService,
) { ) {
super(injector); super(injector);
} }
@ -87,26 +87,26 @@ export class CreateChargebacksByFileDialogComponent
this.invoicingService.CreateChargeback( this.invoicingService.CreateChargeback(
c.invoice_id, c.invoice_id,
c.payment_id, c.payment_id,
csvChargebacksToInvoicePaymentChargebackParams(c) csvChargebacksToInvoicePaymentChargebackParams(c),
) ),
), ),
2, 2,
this.progress$ this.progress$,
) )
.pipe(untilDestroyed(this)) .pipe(untilDestroyed(this))
.subscribe({ .subscribe({
next: (res) => { next: (res) => {
this.successfullyChargebacks.push( this.successfullyChargebacks.push(
...res.filter((c) => !c.hasError).map((c) => c.result) ...res.filter((c) => !c.hasError).map((c) => c.result),
); );
const chargebacksWithError = res.filter((c) => c.hasError); const chargebacksWithError = res.filter((c) => c.hasError);
if (chargebacksWithError.length) { if (chargebacksWithError.length) {
this.log.error( this.log.error(
chargebacksWithError.map((c) => c.error), chargebacksWithError.map((c) => c.error),
`Creating ${chargebacksWithError.length} chargebacks ended in an error. They were re-selected in the table.` `Creating ${chargebacksWithError.length} chargebacks ended in an error. They were re-selected in the table.`,
); );
this.selectedChargebacks = chargebacksWithError.map( this.selectedChargebacks = chargebacksWithError.map(
(c) => selected[c.index] (c) => selected[c.index],
); );
} else { } else {
this.log.successOperation('create', 'chargebacks'); this.log.successOperation('create', 'chargebacks');

View File

@ -5,7 +5,7 @@ import short from 'short-uuid';
import { CsvChargeback } from '../types/csv-chargeback'; import { CsvChargeback } from '../types/csv-chargeback';
export function csvChargebacksToInvoicePaymentChargebackParams( export function csvChargebacksToInvoicePaymentChargebackParams(
c: CsvChargeback c: CsvChargeback,
): InvoicePaymentChargebackParams { ): InvoicePaymentChargebackParams {
return clean( return clean(
{ {
@ -27,7 +27,7 @@ export function csvChargebacksToInvoicePaymentChargebackParams(
symbolic_code: c['body.currency.symbolic_code'], symbolic_code: c['body.currency.symbolic_code'],
}, },
}, },
true true,
), ),
transaction_info: clean( transaction_info: clean(
{ {
@ -38,7 +38,7 @@ export function csvChargebacksToInvoicePaymentChargebackParams(
? JSON.parse(c['transaction_info.additional_info']) ? JSON.parse(c['transaction_info.additional_info'])
: undefined, : undefined,
}, },
true true,
), ),
external_id: c.external_id, external_id: c.external_id,
context: clean( context: clean(
@ -46,11 +46,11 @@ export function csvChargebacksToInvoicePaymentChargebackParams(
type: c['context.type'], type: c['context.type'],
data: c['context.data'], data: c['context.data'],
}, },
true true,
), ),
occurred_at: c['occurred_at'], occurred_at: c['occurred_at'],
}, },
false, false,
true true,
); );
} }

View File

@ -15,7 +15,7 @@ export class FetchChargebacksService extends FetchSuperclass<
> { > {
constructor( constructor(
private merchantStatisticsService: MerchantStatisticsService, private merchantStatisticsService: MerchantStatisticsService,
private log: NotifyLogService private log: NotifyLogService,
) { ) {
super(); super();
} }
@ -38,7 +38,7 @@ export class FetchChargebacksService extends FetchSuperclass<
catchError((err) => { catchError((err) => {
this.log.errorOperation(err, 'receive', 'chargebacks'); this.log.errorOperation(err, 'receive', 'chargebacks');
return of({ result: [] }); return of({ result: [] });
}) }),
); );
} }
} }

View File

@ -28,29 +28,29 @@ export class ClaimComponent {
switchMap(({ partyID }) => switchMap(({ partyID }) =>
this.partyManagementService this.partyManagementService
.Get(partyID) .Get(partyID)
.pipe(progressTo(this.progress$), handleError(this.notificationErrorService.error)) .pipe(progressTo(this.progress$), handleError(this.notificationErrorService.error)),
), ),
shareReplay({ refCount: true, bufferSize: 1 }) shareReplay({ refCount: true, bufferSize: 1 }),
); );
claim$ = merge( claim$ = merge(
this.route.params, this.route.params,
defer(() => this.loadClaim$) defer(() => this.loadClaim$),
).pipe( ).pipe(
map(() => this.route.snapshot.params as Record<string, string>), map(() => this.route.snapshot.params as Record<string, string>),
switchMap(({ partyID, claimID }) => switchMap(({ partyID, claimID }) =>
this.claimManagementService this.claimManagementService
.GetClaim(partyID, Number(claimID)) .GetClaim(partyID, Number(claimID))
.pipe(progressTo(this.progress$), handleError(this.notificationErrorService.error)) .pipe(progressTo(this.progress$), handleError(this.notificationErrorService.error)),
), ),
shareReplay({ refCount: true, bufferSize: 1 }) shareReplay({ refCount: true, bufferSize: 1 }),
); );
isAllowedChangeStatus$ = this.claim$.pipe( isAllowedChangeStatus$ = this.claim$.pipe(
map( map(
(claim) => (claim) =>
!!this.allowedClaimStatusesService.getAllowedStatuses(getUnionKey(claim.status)) !!this.allowedClaimStatusesService.getAllowedStatuses(getUnionKey(claim.status))
.length .length,
), ),
shareReplay({ refCount: true, bufferSize: 1 }) shareReplay({ refCount: true, bufferSize: 1 }),
); );
isLoading$ = inProgressFrom(() => this.progress$, merge(this.claim$, this.party$)); isLoading$ = inProgressFrom(() => this.progress$, merge(this.claim$, this.party$));
statusColor = CLAIM_STATUS_COLOR; statusColor = CLAIM_STATUS_COLOR;
@ -65,7 +65,7 @@ export class ClaimComponent {
private notificationService: NotificationService, private notificationService: NotificationService,
private allowedClaimStatusesService: AllowedClaimStatusesService, private allowedClaimStatusesService: AllowedClaimStatusesService,
private dialogService: DialogService, private dialogService: DialogService,
private notificationErrorService: NotificationErrorService private notificationErrorService: NotificationErrorService,
) {} ) {}
reloadClaim() { reloadClaim() {
@ -79,9 +79,9 @@ export class ClaimComponent {
switchMap(([party, claim]) => switchMap(([party, claim]) =>
this.dialogService this.dialogService
.open(AddModificationDialogComponent, { party, claim }) .open(AddModificationDialogComponent, { party, claim })
.afterClosed() .afterClosed(),
), ),
untilDestroyed(this) untilDestroyed(this),
) )
.subscribe((result) => { .subscribe((result) => {
if (result.status === DialogResponseStatus.Success) this.reloadClaim(); if (result.status === DialogResponseStatus.Success) this.reloadClaim();
@ -95,9 +95,9 @@ export class ClaimComponent {
switchMap(([party, claim]) => switchMap(([party, claim]) =>
this.dialogService this.dialogService
.open(ChangeStatusDialogComponent, { partyID: party.id, claim }) .open(ChangeStatusDialogComponent, { partyID: party.id, claim })
.afterClosed() .afterClosed(),
), ),
untilDestroyed(this) untilDestroyed(this),
) )
.subscribe((result) => { .subscribe((result) => {
if (result.status === DialogResponseStatus.Success) this.reloadClaim(); if (result.status === DialogResponseStatus.Success) this.reloadClaim();

View File

@ -26,7 +26,7 @@ export class AddModificationDialogComponent extends DialogSuperclass<
control = this.fb.control<Modification | ModificationChange>( control = this.fb.control<Modification | ModificationChange>(
this.dialogData.modificationUnit?.modification || null, this.dialogData.modificationUnit?.modification || null,
Validators.required Validators.required,
); );
isLoading$ = inProgressFrom(() => this.progress$); isLoading$ = inProgressFrom(() => this.progress$);
@ -41,7 +41,7 @@ export class AddModificationDialogComponent extends DialogSuperclass<
private fb: FormBuilder, private fb: FormBuilder,
private claimManagementService: ClaimManagementService, private claimManagementService: ClaimManagementService,
private notificationService: NotificationService, private notificationService: NotificationService,
private notificationErrorService: NotificationErrorService private notificationErrorService: NotificationErrorService,
) { ) {
super(injector); super(injector);
} }
@ -68,7 +68,7 @@ export class AddModificationDialogComponent extends DialogSuperclass<
claim.id, claim.id,
claim.revision, claim.revision,
modificationUnit.modification_id, modificationUnit.modification_id,
this.control.value this.control.value,
) )
.pipe(progressTo(this.progress$), untilDestroyed(this)) .pipe(progressTo(this.progress$), untilDestroyed(this))
.subscribe({ .subscribe({

View File

@ -27,7 +27,7 @@ export class ChangeStatusDialogComponent extends DialogSuperclass<
denyReason: null as string, denyReason: null as string,
}); });
statuses = this.allowedClaimStatusesService.getAllowedStatuses( statuses = this.allowedClaimStatusesService.getAllowedStatuses(
getUnionKey(this.dialogData.claim.status) getUnionKey(this.dialogData.claim.status),
); );
inProgress$ = inProgressFrom(() => this.progress$); inProgress$ = inProgressFrom(() => this.progress$);
@ -39,7 +39,7 @@ export class ChangeStatusDialogComponent extends DialogSuperclass<
private claimManagementService: ClaimManagementService, private claimManagementService: ClaimManagementService,
private notificationService: NotificationService, private notificationService: NotificationService,
private allowedClaimStatusesService: AllowedClaimStatusesService, private allowedClaimStatusesService: AllowedClaimStatusesService,
private notificationErrorService: NotificationErrorService private notificationErrorService: NotificationErrorService,
) { ) {
super(injector); super(injector);
} }

View File

@ -27,7 +27,7 @@ export class ModificationFormComponent
metadata$ = from(import('@vality/domain-proto/metadata.json').then((m) => m.default)); metadata$ = from(import('@vality/domain-proto/metadata.json').then((m) => m.default));
extensions$ = combineLatest([ extensions$ = combineLatest([
defer(() => this.claimOrPartyChanged$).pipe( defer(() => this.claimOrPartyChanged$).pipe(
map(() => createPartyClaimMetadataFormExtensions(this.party, this.claim)) map(() => createPartyClaimMetadataFormExtensions(this.party, this.claim)),
), ),
this.domainMetadataFormExtensionsService.extensions$, this.domainMetadataFormExtensionsService.extensions$,
]).pipe(map((extensionGroups) => extensionGroups.flat())); ]).pipe(map((extensionGroups) => extensionGroups.flat()));

View File

@ -11,7 +11,7 @@ import {
} from '@cc/app/shared/components/metadata-form'; } from '@cc/app/shared/components/metadata-form';
function createPartyOptions( function createPartyOptions(
values: IterableIterator<{ id: string }> values: IterableIterator<{ id: string }>,
): MetadataFormExtensionOption[] { ): MetadataFormExtensionOption[] {
return Array.from(values).map((value) => ({ return Array.from(values).map((value) => ({
label: 'from party', label: 'from party',
@ -21,7 +21,7 @@ function createPartyOptions(
} }
function createClaimOptions( function createClaimOptions(
modificationUnits: { id: string; modification: unknown }[] modificationUnits: { id: string; modification: unknown }[],
): MetadataFormExtensionOption[] { ): MetadataFormExtensionOption[] {
return uniqBy( return uniqBy(
modificationUnits.filter(Boolean).map((unit) => ({ modificationUnits.filter(Boolean).map((unit) => ({
@ -30,7 +30,7 @@ function createClaimOptions(
value: unit.id, value: unit.id,
color: 'primary', color: 'primary',
})), })),
'value' 'value',
); );
} }
@ -40,7 +40,7 @@ function generate() {
export function createPartyClaimMetadataFormExtensions( export function createPartyClaimMetadataFormExtensions(
party: Party, party: Party,
claim: Claim claim: Claim,
): MetadataFormExtension[] { ): MetadataFormExtension[] {
return [ return [
{ {
@ -51,8 +51,8 @@ export function createPartyClaimMetadataFormExtensions(
...createClaimOptions( ...createClaimOptions(
claim.changeset.map( claim.changeset.map(
(unit) => (unit) =>
unit.modification.party_modification?.contractor_modification unit.modification.party_modification?.contractor_modification,
) ),
), ),
...createPartyOptions(party.contractors.values()), ...createPartyOptions(party.contractors.values()),
], ],
@ -68,8 +68,8 @@ export function createPartyClaimMetadataFormExtensions(
...createClaimOptions( ...createClaimOptions(
claim.changeset.map( claim.changeset.map(
(unit) => (unit) =>
unit.modification.party_modification?.contract_modification unit.modification.party_modification?.contract_modification,
) ),
), ),
...createPartyOptions(party.contracts.values()), ...createPartyOptions(party.contracts.values()),
], ],
@ -84,8 +84,8 @@ export function createPartyClaimMetadataFormExtensions(
options: [ options: [
...createClaimOptions( ...createClaimOptions(
claim.changeset.map( claim.changeset.map(
(unit) => unit.modification.party_modification?.shop_modification (unit) => unit.modification.party_modification?.shop_modification,
) ),
), ),
...createPartyOptions(party.shops.values()), ...createPartyOptions(party.shops.values()),
], ],
@ -100,8 +100,8 @@ export function createPartyClaimMetadataFormExtensions(
options: [ options: [
...createClaimOptions( ...createClaimOptions(
claim.changeset.map( claim.changeset.map(
(unit) => unit.modification.party_modification?.wallet_modification (unit) => unit.modification.party_modification?.wallet_modification,
) ),
), ),
...createPartyOptions(party.wallets.values()), ...createPartyOptions(party.wallets.values()),
], ],

View File

@ -48,7 +48,7 @@ export class ModificationUnitTimelineItemComponent {
private claimManagementService: ClaimManagementService, private claimManagementService: ClaimManagementService,
private notificationService: NotificationService, private notificationService: NotificationService,
private domainMetadataViewExtensionsService: DomainMetadataViewExtensionsService, private domainMetadataViewExtensionsService: DomainMetadataViewExtensionsService,
private notificationErrorService: NotificationErrorService private notificationErrorService: NotificationErrorService,
) {} ) {}
get name() { get name() {
@ -71,9 +71,9 @@ export class ModificationUnitTimelineItemComponent {
claim: this.claim, claim: this.claim,
modificationUnit: this.modificationUnit, modificationUnit: this.modificationUnit,
}) })
.afterClosed() .afterClosed(),
), ),
untilDestroyed(this) untilDestroyed(this),
) )
.subscribe((result) => { .subscribe((result) => {
if (result.status === DialogResponseStatus.Success) this.claimChanged.emit(); if (result.status === DialogResponseStatus.Success) this.claimChanged.emit();
@ -92,11 +92,11 @@ export class ModificationUnitTimelineItemComponent {
party.id, party.id,
this.claim.id, this.claim.id,
this.claim.revision, this.claim.revision,
this.modificationUnit.modification_id this.modificationUnit.modification_id,
) ),
), ),
progressTo(this.progress$), progressTo(this.progress$),
untilDestroyed(this) untilDestroyed(this),
) )
.subscribe({ .subscribe({
next: () => { next: () => {

View File

@ -2,8 +2,8 @@
<span [ngClass]="{ outdated: outdated, removed: removed }"> <span [ngClass]="{ outdated: outdated, removed: removed }">
{{ text }} {{ text }}
<span *ngIf="createdAt" <span *ngIf="createdAt"
>at {{ createdAt | date : 'dd.MM.yyyy HH:mm:ss' }} ({{ >at {{ createdAt | date: 'dd.MM.yyyy HH:mm:ss' }} ({{
createdAt | humanizedDuration : { largest: 1, hasAgoEnding: true } createdAt | humanizedDuration: { largest: 1, hasAgoEnding: true }
}})</span }})</span
> >
</span> </span>

View File

@ -55,7 +55,10 @@ export class ClaimsTableComponent {
]), ]),
]; ];
constructor(private router: Router, private partiesStoreService: PartiesStoreService) {} constructor(
private router: Router,
private partiesStoreService: PartiesStoreService,
) {}
navigateToClaim(partyId: string, claimID: number) { navigateToClaim(partyId: string, claimID: number) {
void this.router.navigate([`/party/${partyId}/claim/${claimID}`]); void this.router.navigate([`/party/${partyId}/claim/${claimID}`]);

View File

@ -33,7 +33,7 @@ export class ClaimsComponent implements OnInit {
private fetchClaimsService: FetchClaimsService, private fetchClaimsService: FetchClaimsService,
private dialogService: DialogService, private dialogService: DialogService,
private fb: NonNullableFormBuilder, private fb: NonNullableFormBuilder,
private qp: QueryParamsService<ClaimsComponent['filtersForm']['value']> private qp: QueryParamsService<ClaimsComponent['filtersForm']['value']>,
) {} ) {}
ngOnInit(): void { ngOnInit(): void {
@ -50,7 +50,7 @@ export class ClaimsComponent implements OnInit {
void this.qp.set(filters); void this.qp.set(filters);
this.fetchClaimsService.load( this.fetchClaimsService.load(
{ ...filters, statuses: filters.statuses?.map((status) => ({ [status]: {} })) || [] }, { ...filters, statuses: filters.statuses?.map((status) => ({ [status]: {} })) || [] },
options options,
); );
this.active = Object.keys(filters).length; this.active = Object.keys(filters).length;
} }

View File

@ -27,7 +27,7 @@ export class CreateClaimDialogComponent extends DialogSuperclass<
private claimService: ClaimManagementService, private claimService: ClaimManagementService,
private notificationService: NotificationService, private notificationService: NotificationService,
private notificationErrorService: NotificationErrorService, private notificationErrorService: NotificationErrorService,
private router: Router private router: Router,
) { ) {
super(injector); super(injector);
} }
@ -45,7 +45,7 @@ export class CreateClaimDialogComponent extends DialogSuperclass<
error: (err) => { error: (err) => {
this.notificationErrorService.error( this.notificationErrorService.error(
err, err,
'An error occurred while claim creation' 'An error occurred while claim creation',
); );
}, },
}); });

View File

@ -13,14 +13,14 @@ export class FetchClaimsService extends FetchSuperclass<
> { > {
constructor( constructor(
private claimManagementService: ClaimManagementService, private claimManagementService: ClaimManagementService,
private log: NotifyLogService private log: NotifyLogService,
) { ) {
super(); super();
} }
protected fetch( protected fetch(
params: Omit<ClaimSearchQuery, 'continuation_token' | 'limit'>, params: Omit<ClaimSearchQuery, 'continuation_token' | 'limit'>,
{ size, continuationToken }: FetchOptions { size, continuationToken }: FetchOptions,
): Observable<FetchResult<Claim>> { ): Observable<FetchResult<Claim>> {
return this.claimManagementService return this.claimManagementService
.SearchClaims({ .SearchClaims({
@ -36,7 +36,7 @@ export class FetchClaimsService extends FetchSuperclass<
catchError((err) => { catchError((err) => {
this.log.errorOperation(err, 'receive', 'claims'); this.log.errorOperation(err, 'receive', 'claims');
return of({ result: [] }); return of({ result: [] });
}) }),
); );
} }
} }

View File

@ -16,7 +16,7 @@ export class DepositDetailsComponent implements OnInit {
constructor( constructor(
private fetchDepositService: ReceiveDepositService, private fetchDepositService: ReceiveDepositService,
private route: ActivatedRoute private route: ActivatedRoute,
) {} ) {}
ngOnInit() { ngOnInit() {

View File

@ -18,7 +18,7 @@
{{ deposit.currency_symbolic_code | ccCurrency }}</cc-details-item {{ deposit.currency_symbolic_code | ccCurrency }}</cc-details-item
> >
<cc-details-item fxFlex title="Created At">{{ <cc-details-item fxFlex title="Created At">{{
deposit.created_at | date : 'dd.MM.yyyy HH:mm:ss' deposit.created_at | date: 'dd.MM.yyyy HH:mm:ss'
}}</cc-details-item> }}</cc-details-item>
</div> </div>
<div fxFlexFill fxLayout fxLayoutGap="16px"> <div fxFlexFill fxLayout fxLayoutGap="16px">

View File

@ -35,7 +35,7 @@ export class CreateRevertDialogComponent extends DialogSuperclass<
private fb: NonNullableFormBuilder, private fb: NonNullableFormBuilder,
private depositManagementService: ManagementService, private depositManagementService: ManagementService,
private idGenerator: UserInfoBasedIdGeneratorService, private idGenerator: UserInfoBasedIdGeneratorService,
private log: NotifyLogService private log: NotifyLogService,
) { ) {
super(injector); super(injector);
} }
@ -58,8 +58,8 @@ export class CreateRevertDialogComponent extends DialogSuperclass<
external_id: externalID, external_id: externalID,
}, },
false, false,
true true,
) ),
) )
.pipe(untilDestroyed(this)) .pipe(untilDestroyed(this))
.subscribe({ .subscribe({

View File

@ -26,7 +26,7 @@
<ng-container matColumnDef="createdAt"> <ng-container matColumnDef="createdAt">
<th *matHeaderCellDef mat-header-cell>Created At</th> <th *matHeaderCellDef mat-header-cell>Created At</th>
<td *matCellDef="let revert" mat-cell> <td *matCellDef="let revert" mat-cell>
{{ revert.created_at | date : 'dd.MM.yyyy HH:mm:ss' }} {{ revert.created_at | date: 'dd.MM.yyyy HH:mm:ss' }}
</td> </td>
</ng-container> </ng-container>

View File

@ -23,7 +23,10 @@ export class RevertsComponent implements OnInit {
hasMore$ = this.fetchRevertsService.hasMore$; hasMore$ = this.fetchRevertsService.hasMore$;
doAction$ = this.fetchRevertsService.doAction$; doAction$ = this.fetchRevertsService.doAction$;
constructor(private fetchRevertsService: FetchRevertsService, private dialog: DialogService) {} constructor(
private fetchRevertsService: FetchRevertsService,
private dialog: DialogService,
) {}
ngOnInit() { ngOnInit() {
this.fetchRevertsService.search({ deposit_id: this.deposit.id }); this.fetchRevertsService.search({ deposit_id: this.deposit.id });

View File

@ -14,14 +14,14 @@ import { FetchRevertsParams } from '../../types/fetch-reverts-params';
export class FetchRevertsService extends PartialFetcher<StatDepositRevert, FetchRevertsParams> { export class FetchRevertsService extends PartialFetcher<StatDepositRevert, FetchRevertsParams> {
constructor( constructor(
private fistfulStatisticsService: FistfulStatisticsService, private fistfulStatisticsService: FistfulStatisticsService,
@Inject(SMALL_SEARCH_LIMIT) private smallSearchLimit: number @Inject(SMALL_SEARCH_LIMIT) private smallSearchLimit: number,
) { ) {
super(); super();
} }
fetch( fetch(
params: FetchRevertsParams, params: FetchRevertsParams,
continuationToken: string continuationToken: string,
): Observable<FetchResult<StatDepositRevert>> { ): Observable<FetchResult<StatDepositRevert>> {
return this.fistfulStatisticsService return this.fistfulStatisticsService
.GetDepositReverts({ .GetDepositReverts({
@ -37,7 +37,7 @@ export class FetchRevertsService extends PartialFetcher<StatDepositRevert, Fetch
map((res) => ({ map((res) => ({
result: res.data.deposit_reverts, result: res.data.deposit_reverts,
continuationToken: res.continuation_token, continuationToken: res.continuation_token,
})) })),
); );
} }
} }

View File

@ -22,11 +22,11 @@ export class ReceiveDepositService {
this.error$.next(true); this.error$.next(true);
this.notificationErrorService.error(err); this.notificationErrorService.error(err);
return EMPTY; return EMPTY;
}) }),
) ),
), ),
map(({ data }) => data?.deposits[0]), map(({ data }) => data?.deposits[0]),
shareReplay(1) shareReplay(1),
); );
// eslint-disable-next-line @typescript-eslint/member-ordering // eslint-disable-next-line @typescript-eslint/member-ordering
@ -34,7 +34,7 @@ export class ReceiveDepositService {
constructor( constructor(
private fistfulStatisticsService: FistfulStatisticsService, private fistfulStatisticsService: FistfulStatisticsService,
private notificationErrorService: NotificationErrorService private notificationErrorService: NotificationErrorService,
) {} ) {}
receiveDeposit(id: string) { receiveDeposit(id: string) {

View File

@ -34,7 +34,7 @@ export class CreateDepositDialogComponent implements OnInit {
private snackBar: MatSnackBar, private snackBar: MatSnackBar,
private dialogRef: MatDialogRef<CreateDepositDialogComponent>, private dialogRef: MatDialogRef<CreateDepositDialogComponent>,
private configService: ConfigService, private configService: ConfigService,
private fetchSourcesService: FetchSourcesService private fetchSourcesService: FetchSourcesService,
) {} ) {}
ngOnInit() { ngOnInit() {
@ -43,7 +43,7 @@ export class CreateDepositDialogComponent implements OnInit {
.afterClosed() .afterClosed()
.pipe( .pipe(
switchMap(() => this.sources$.pipe(first())), switchMap(() => this.sources$.pipe(first())),
untilDestroyed(this) untilDestroyed(this),
) )
.subscribe((sources) => this.form.reset({ currency: sources[0] })); .subscribe((sources) => this.form.reset({ currency: sources[0] }));
this.depositCreated$.subscribe((deposit) => { this.depositCreated$.subscribe((deposit) => {

View File

@ -35,9 +35,9 @@ export class CreateDepositService {
catchError(() => { catchError(() => {
this.errorSubject$.next(true); this.errorSubject$.next(true);
return EMPTY; return EMPTY;
}) }),
), ),
]) ]),
), ),
switchMap(([pollingParams]) => switchMap(([pollingParams]) =>
this.fistfulStatisticsService.GetDeposits(pollingParams).pipe( this.fistfulStatisticsService.GetDeposits(pollingParams).pipe(
@ -50,15 +50,15 @@ export class CreateDepositService {
catchError(() => { catchError(() => {
this.pollingTimeoutSubject$.next(true); this.pollingTimeoutSubject$.next(true);
return EMPTY; return EMPTY;
}) }),
) ),
) ),
); );
// eslint-disable-next-line @typescript-eslint/member-ordering // eslint-disable-next-line @typescript-eslint/member-ordering
isLoading$ = progress( isLoading$ = progress(
this.create$, this.create$,
merge([this.depositCreated$, this.errorSubject$, this.pollingErrorSubject$]) merge([this.depositCreated$, this.errorSubject$, this.pollingErrorSubject$]),
); );
// eslint-disable-next-line @typescript-eslint/member-ordering // eslint-disable-next-line @typescript-eslint/member-ordering
@ -81,7 +81,7 @@ export class CreateDepositService {
private fb: FormBuilder, private fb: FormBuilder,
private idGenerator: UserInfoBasedIdGeneratorService, private idGenerator: UserInfoBasedIdGeneratorService,
private configService: ConfigService, private configService: ConfigService,
private fetchSourcesService: FetchSourcesService private fetchSourcesService: FetchSourcesService,
) { ) {
this.initForm(); this.initForm();
} }

View File

@ -30,12 +30,12 @@ export class DepositsComponent implements OnInit {
private paramsStoreService: ParamsStoreService, private paramsStoreService: ParamsStoreService,
private fetchDepositsService: FetchDepositsService, private fetchDepositsService: FetchDepositsService,
private snackBar: MatSnackBar, private snackBar: MatSnackBar,
private router: Router private router: Router,
) {} ) {}
ngOnInit() { ngOnInit() {
this.fetchDepositsService.errors$.subscribe((e) => this.fetchDepositsService.errors$.subscribe((e) =>
this.snackBar.open(`An error occurred while search deposits (${String(e)})`, 'OK') this.snackBar.open(`An error occurred while search deposits (${String(e)})`, 'OK'),
); );
} }
@ -45,7 +45,7 @@ export class DepositsComponent implements OnInit {
.afterClosed() .afterClosed()
.pipe( .pipe(
filter((deposit) => !!deposit), filter((deposit) => !!deposit),
untilDestroyed(this) untilDestroyed(this),
) )
.subscribe(() => { .subscribe(() => {
this.refresh(); this.refresh();

View File

@ -48,10 +48,10 @@ export class SearchFiltersComponent implements OnInit {
constructor( constructor(
private searchFiltersService: SearchFiltersService, private searchFiltersService: SearchFiltersService,
private configService: ConfigService, private configService: ConfigService,
private fetchSourcesService: FetchSourcesService private fetchSourcesService: FetchSourcesService,
) { ) {
this.searchFiltersService.searchParamsChanges$.subscribe((params) => this.searchFiltersService.searchParamsChanges$.subscribe((params) =>
this.valueChanges.emit(params) this.valueChanges.emit(params),
); );
} }

View File

@ -25,7 +25,7 @@ export class SearchFiltersService {
debounceTime(600), debounceTime(600),
filter(() => this.form.valid), filter(() => this.form.valid),
map(formValueToSearchParams), map(formValueToSearchParams),
shareReplay(1) shareReplay(1),
); );
constructor(private fb: UntypedFormBuilder) {} constructor(private fb: UntypedFormBuilder) {}

View File

@ -11,4 +11,4 @@ export const searchParamsToFormParams = (value: SearchParams): FormValue =>
...(value.fromTime ? { fromTime: moment(value.fromTime) } : {}), ...(value.fromTime ? { fromTime: moment(value.fromTime) } : {}),
...(value.toTime ? { toTime: moment(value.toTime) } : {}), ...(value.toTime ? { toTime: moment(value.toTime) } : {}),
...(value.amountTo ? { amountTo: toMajor(value.amountTo) } : {}), ...(value.amountTo ? { amountTo: toMajor(value.amountTo) } : {}),
} as FormValue); }) as FormValue;

View File

@ -13,7 +13,7 @@ import { SearchParams } from '../../types/search-params';
export class FetchDepositsService extends PartialFetcher<StatDeposit, SearchParams> { export class FetchDepositsService extends PartialFetcher<StatDeposit, SearchParams> {
constructor( constructor(
private fistfulStatisticsService: FistfulStatisticsService, private fistfulStatisticsService: FistfulStatisticsService,
@Inject(SEARCH_LIMIT) private searchLimit: number @Inject(SEARCH_LIMIT) private searchLimit: number,
) { ) {
super(); super();
} }
@ -26,14 +26,14 @@ export class FetchDepositsService extends PartialFetcher<StatDeposit, SearchPara
...params, ...params,
size: this.searchLimit, size: this.searchLimit,
}, },
continuationToken continuationToken,
) ),
) )
.pipe( .pipe(
map((res) => ({ map((res) => ({
result: res.data.deposits, result: res.data.deposits,
continuationToken: res.continuation_token, continuationToken: res.continuation_token,
})) })),
); );
} }
} }

View File

@ -7,7 +7,10 @@ import { SearchParams } from '../../types/search-params';
@Injectable() @Injectable()
export class ParamsStoreService extends QueryParamsStore<SearchParams> { export class ParamsStoreService extends QueryParamsStore<SearchParams> {
constructor(protected route: ActivatedRoute, protected router: Router) { constructor(
protected route: ActivatedRoute,
protected router: Router,
) {
super(router, route); super(router, route);
} }

View File

@ -51,11 +51,11 @@ export class DomainGroupComponent implements OnInit, AfterViewInit {
...data[idx], ...data[idx],
type, type,
stringified: JSON.stringify( stringified: JSON.stringify(
objectToJSON([data[idx].obj, data[idx].ref, type]) objectToJSON([data[idx].obj, data[idx].ref, type]),
),
})),
),
), ),
}))
)
)
), ),
switchMap((data: DataSourceItem[]) => switchMap((data: DataSourceItem[]) =>
combineLatest([ combineLatest([
@ -63,19 +63,21 @@ export class DomainGroupComponent implements OnInit, AfterViewInit {
this.typesControl.valueChanges.pipe(startWith(this.typesControl.value)), this.typesControl.valueChanges.pipe(startWith(this.typesControl.value)),
]).pipe( ]).pipe(
map(([searchStr, selectedTypes]) => map(([searchStr, selectedTypes]) =>
this.createMatTableDataSource(data, searchStr, selectedTypes) this.createMatTableDataSource(data, searchStr, selectedTypes),
)
)
), ),
shareReplay({ refCount: true, bufferSize: 1 }) ),
),
shareReplay({ refCount: true, bufferSize: 1 }),
); );
cols = new Columns('type', 'ref', 'obj', 'actions'); cols = new Columns('type', 'ref', 'obj', 'actions');
fields$ = this.metadataService.getDomainFields().pipe( fields$ = this.metadataService.getDomainFields().pipe(
map((fields) => sortBy(fields, 'type')), map((fields) => sortBy(fields, 'type')),
shareReplay({ refCount: true, bufferSize: 1 }) shareReplay({ refCount: true, bufferSize: 1 }),
); );
options$ = this.fields$.pipe( options$ = this.fields$.pipe(
map((fields) => fields.map(({ type }) => ({ label: startCase(String(type)), value: type }))) map((fields) =>
fields.map(({ type }) => ({ label: startCase(String(type)), value: type })),
),
); );
isLoading$ = this.domainStoreService.isLoading$; isLoading$ = this.domainStoreService.isLoading$;
@ -84,7 +86,7 @@ export class DomainGroupComponent implements OnInit, AfterViewInit {
constructor( constructor(
private domainStoreService: DomainStoreService, private domainStoreService: DomainStoreService,
private metadataService: MetadataService, private metadataService: MetadataService,
private queryParamsService: QueryParamsService<Params> private queryParamsService: QueryParamsService<Params>,
) {} ) {}
ngOnInit() { ngOnInit() {
@ -94,7 +96,7 @@ export class DomainGroupComponent implements OnInit, AfterViewInit {
this.queryParamsService.params$ this.queryParamsService.params$
.pipe( .pipe(
filter((p) => !!p.ref), filter((p) => !!p.ref),
withLatestFrom(this.domainStoreService.getDomain()) withLatestFrom(this.domainStoreService.getDomain()),
) )
.subscribe(([params, domain]) => { .subscribe(([params, domain]) => {
domain.forEach((obj, ref) => { domain.forEach((obj, ref) => {
@ -116,10 +118,10 @@ export class DomainGroupComponent implements OnInit, AfterViewInit {
private createMatTableDataSource( private createMatTableDataSource(
data: DataSourceItem[], data: DataSourceItem[],
searchStr: string, searchStr: string,
selectedTypes: string[] selectedTypes: string[],
) { ) {
const dataSource = new MatTableDataSource( const dataSource = new MatTableDataSource(
data.filter((d) => selectedTypes.includes(d.type)) data.filter((d) => selectedTypes.includes(d.type)),
); );
dataSource.paginator = this.paginator; dataSource.paginator = this.paginator;
dataSource.sort = this.sort; dataSource.sort = this.sort;

View File

@ -16,7 +16,7 @@ export function sortData(data: DataSourceItem[], sort: MatSort): DataSourceItem[
break; break;
case 'ref': { case 'ref': {
const groups = groupBy(data, (o) => const groups = groupBy(data, (o) =>
typeof getUnionValue(o.ref)?.['id'] === 'number' ? 0 : 1 typeof getUnionValue(o.ref)?.['id'] === 'number' ? 0 : 1,
); );
data = [ data = [

View File

@ -55,7 +55,7 @@ export class DomainInfoComponent {
private notificationService: NotificationService, private notificationService: NotificationService,
private notificationErrorService: NotificationErrorService, private notificationErrorService: NotificationErrorService,
private domainMetadataViewExtensionsService: DomainMetadataViewExtensionsService, private domainMetadataViewExtensionsService: DomainMetadataViewExtensionsService,
private queryParamsService: QueryParamsService<{ ref?: Reference }> private queryParamsService: QueryParamsService<{ ref?: Reference }>,
) {} ) {}
edit() { edit() {
@ -72,8 +72,8 @@ export class DomainInfoComponent {
switchMap(() => switchMap(() =>
this.domainStoreService.commit({ this.domainStoreService.commit({
ops: [{ remove: { object: this.objWithRef.obj } }], ops: [{ remove: { object: this.objWithRef.obj } }],
}) }),
) ),
) )
.subscribe({ .subscribe({
next: () => { next: () => {

View File

@ -65,7 +65,7 @@ export class DomainObjCreationComponent {
private notificationService: NotificationService, private notificationService: NotificationService,
private notificationErrorService: NotificationErrorService, private notificationErrorService: NotificationErrorService,
private domainNavigateService: DomainNavigateService, private domainNavigateService: DomainNavigateService,
private metadataService: MetadataService private metadataService: MetadataService,
) {} ) {}
reviewChanges() { reviewChanges() {
@ -77,10 +77,10 @@ export class DomainObjCreationComponent {
.commit({ ops: [{ insert: { object: this.control.value } }] }) .commit({ ops: [{ insert: { object: this.control.value } }] })
.pipe( .pipe(
withLatestFrom( withLatestFrom(
this.metadataService.getDomainFieldByFieldName(getUnionKey(this.control.value)) this.metadataService.getDomainFieldByFieldName(getUnionKey(this.control.value)),
), ),
progressTo(this.progress$), progressTo(this.progress$),
untilDestroyed(this) untilDestroyed(this),
) )
.subscribe({ .subscribe({
next: ([, field]) => { next: ([, field]) => {

View File

@ -32,6 +32,6 @@ export class DomainObjCodeLensProvider implements CodeLensProvider {
resolveCodeLens?( resolveCodeLens?(
model: ITextModel, model: ITextModel,
codeLens: CodeLens, codeLens: CodeLens,
token: CancellationToken token: CancellationToken,
): ProviderResult<CodeLens>; ): ProviderResult<CodeLens>;
} }

View File

@ -54,7 +54,7 @@ export class DomainObjModificationComponent implements OnInit {
private domainObjModService: DomainObjModificationService, private domainObjModService: DomainObjModificationService,
private modifiedDomainObjectService: ModifiedDomainObjectService, private modifiedDomainObjectService: ModifiedDomainObjectService,
private domainMetadataFormExtensionsService: DomainMetadataFormExtensionsService, private domainMetadataFormExtensionsService: DomainMetadataFormExtensionsService,
private domainNavigateService: DomainNavigateService private domainNavigateService: DomainNavigateService,
) {} ) {}
ngOnInit() { ngOnInit() {

View File

@ -35,7 +35,7 @@ export class DomainObjReviewComponent {
private notificationService: NotificationService, private notificationService: NotificationService,
private notificationErrorService: NotificationErrorService, private notificationErrorService: NotificationErrorService,
private domainNavigateService: DomainNavigateService, private domainNavigateService: DomainNavigateService,
private domainSecretService: DomainSecretService private domainSecretService: DomainSecretService,
) { ) {
if (!modifiedDomainObjectService.domainObject) { if (!modifiedDomainObjectService.domainObject) {
this.back(); this.back();
@ -59,10 +59,10 @@ export class DomainObjReviewComponent {
}, },
}, },
], ],
}) }),
), ),
withLatestFrom(this.type$), withLatestFrom(this.type$),
untilDestroyed(this) untilDestroyed(this),
) )
.subscribe({ .subscribe({
next: ([, type]) => { next: ([, type]) => {

View File

@ -17,11 +17,11 @@ export class DomainObjModificationService {
object$ = defer(() => this.ref$).pipe( object$ = defer(() => this.ref$).pipe(
switchMap((ref) => this.getDomainObject(ref, false).pipe(progressTo(this.progress$))), switchMap((ref) => this.getDomainObject(ref, false).pipe(progressTo(this.progress$))),
map((obj) => getUnionValue(obj)), map((obj) => getUnionValue(obj)),
shareReplay({ refCount: true, bufferSize: 1 }) shareReplay({ refCount: true, bufferSize: 1 }),
); );
type$ = defer(() => this.ref$).pipe( type$ = defer(() => this.ref$).pipe(
switchMap((ref) => this.metadataService.getDomainObjectType(ref)), switchMap((ref) => this.metadataService.getDomainObjectType(ref)),
shareReplay({ refCount: true, bufferSize: 1 }) shareReplay({ refCount: true, bufferSize: 1 }),
); );
private ref$ = this.route.params.pipe( private ref$ = this.route.params.pipe(
@ -32,14 +32,14 @@ export class DomainObjModificationService {
this.notificationErrorService.error(err, 'Malformed domain object ref'); this.notificationErrorService.error(err, 'Malformed domain object ref');
return null; return null;
} }
}) }),
); );
constructor( constructor(
private route: ActivatedRoute, private route: ActivatedRoute,
private domainStoreService: DomainStoreService, private domainStoreService: DomainStoreService,
private metadataService: MetadataService, private metadataService: MetadataService,
private notificationErrorService: NotificationErrorService private notificationErrorService: NotificationErrorService,
) {} ) {}
private getDomainObject(ref: Reference, rawDomain: boolean): Observable<DomainObject> { private getDomainObject(ref: Reference, rawDomain: boolean): Observable<DomainObject> {
@ -48,9 +48,9 @@ export class DomainObjModificationService {
map((domain) => { map((domain) => {
const searchRef = JSON.stringify(ref); const searchRef = JSON.stringify(ref);
return domain.get( return domain.get(
Array.from(domain.keys()).find((k) => JSON.stringify(toJson(k)) === searchRef) Array.from(domain.keys()).find((k) => JSON.stringify(toJson(k)) === searchRef),
); );
}) }),
); );
} }
} }

View File

@ -8,7 +8,7 @@ import { map, shareReplay } from 'rxjs/operators';
@Injectable() @Injectable()
export class MetadataService { export class MetadataService {
private metadata$: Observable<ThriftAstMetadata[]> = from( private metadata$: Observable<ThriftAstMetadata[]> = from(
import('@vality/domain-proto/metadata.json').then((m) => m.default) import('@vality/domain-proto/metadata.json').then((m) => m.default),
).pipe(shareReplay(1)) as Observable<ThriftAstMetadata[]>; ).pipe(shareReplay(1)) as Observable<ThriftAstMetadata[]>;
get metadata() { get metadata() {
@ -28,19 +28,19 @@ export class MetadataService {
map((d) => { map((d) => {
const found = d.find(({ name }) => name === searchName); const found = d.find(({ name }) => name === searchName);
return found ? (found.type as string) : null; return found ? (found.type as string) : null;
}) }),
); );
} }
getDomainFieldByFieldName(fieldName: string): Observable<Field> { getDomainFieldByFieldName(fieldName: string): Observable<Field> {
return this.getDomainFields().pipe( return this.getDomainFields().pipe(
map((fields) => fields.find((f) => f.name === fieldName)) map((fields) => fields.find((f) => f.name === fieldName)),
); );
} }
getDomainFields(): Observable<Field[]> { getDomainFields(): Observable<Field[]> {
return this.metadata$.pipe( return this.metadata$.pipe(
map((m) => m.find(({ name }) => name === 'domain').ast.union.DomainObject) map((m) => m.find(({ name }) => name === 'domain').ast.union.DomainObject),
); );
} }
} }

View File

@ -10,17 +10,17 @@ import { PartyManagementService } from '@cc/app/api/payment-processing';
export class PartyShopsService { export class PartyShopsService {
shops$ = defer(() => this.party$).pipe( shops$ = defer(() => this.party$).pipe(
pluck('shops'), pluck('shops'),
map((shops) => Array.from(shops.values())) map((shops) => Array.from(shops.values())),
); );
private party$: Observable<Party> = this.route.params.pipe( private party$: Observable<Party> = this.route.params.pipe(
pluck('partyID'), pluck('partyID'),
switchMap((partyID) => this.partyManagementService.Get(partyID)), switchMap((partyID) => this.partyManagementService.Get(partyID)),
shareReplay(1) shareReplay(1),
); );
constructor( constructor(
private partyManagementService: PartyManagementService, private partyManagementService: PartyManagementService,
private route: ActivatedRoute private route: ActivatedRoute,
) {} ) {}
} }

View File

@ -17,7 +17,10 @@ export class ShopsTableComponent implements OnChanges {
dataSource: MatTableDataSource<Shop> = new MatTableDataSource(); dataSource: MatTableDataSource<Shop> = new MatTableDataSource();
displayedColumns = ['id', 'name', 'url', 'actions']; displayedColumns = ['id', 'name', 'url', 'actions'];
constructor(private router: Router, private route: ActivatedRoute) {} constructor(
private router: Router,
private route: ActivatedRoute,
) {}
ngOnChanges({ shops }: SimpleChanges) { ngOnChanges({ shops }: SimpleChanges) {
if (shops.currentValue) { if (shops.currentValue) {

View File

@ -20,7 +20,7 @@ export class PartyComponent {
filter((e) => e instanceof NavigationEnd), filter((e) => e instanceof NavigationEnd),
startWith(undefined), startWith(undefined),
map(() => this.findLinkWithMaxActiveFragments()), map(() => this.findLinkWithMaxActiveFragments()),
shareReplay(1) shareReplay(1),
); );
partyID$: Observable<string>; partyID$: Observable<string>;
@ -30,7 +30,7 @@ export class PartyComponent {
private route: ActivatedRoute, private route: ActivatedRoute,
private router: Router, private router: Router,
private appAuthGuardService: AppAuthGuardService, private appAuthGuardService: AppAuthGuardService,
private deanonimusService: DeanonimusService private deanonimusService: DeanonimusService,
) { ) {
this.partyID$ = this.route.params.pipe(pluck('partyID'), shareReplay(1)); this.partyID$ = this.route.params.pipe(pluck('partyID'), shareReplay(1));
this.merchantEmail$ = this.partyID$.pipe( this.merchantEmail$ = this.partyID$.pipe(
@ -41,7 +41,7 @@ export class PartyComponent {
console.error(err); console.error(err);
return of('--/--'); return of('--/--');
}), }),
shareReplay(1) shareReplay(1),
); );
} }
@ -65,7 +65,7 @@ export class PartyComponent {
}, },
]; ];
return links.filter((item) => return links.filter((item) =>
this.appAuthGuardService.userHasSomeServiceMethods(item.services) this.appAuthGuardService.userHasSomeServiceMethods(item.services),
); );
} }

View File

@ -31,7 +31,7 @@ export class CreateChargebackDialogComponent extends DialogSuperclass<
private invoicingService: InvoicingService, private invoicingService: InvoicingService,
private domainMetadataFormExtensionsService: DomainMetadataFormExtensionsService, private domainMetadataFormExtensionsService: DomainMetadataFormExtensionsService,
private notificationErrorService: NotificationErrorService, private notificationErrorService: NotificationErrorService,
private notificationService: NotificationService private notificationService: NotificationService,
) { ) {
super(injector); super(injector);
} }
@ -41,7 +41,7 @@ export class CreateChargebackDialogComponent extends DialogSuperclass<
.CreateChargeback( .CreateChargeback(
this.dialogData.invoiceID, this.dialogData.invoiceID,
this.dialogData.paymentID, this.dialogData.paymentID,
this.form.value as InvoicePaymentChargebackParams this.form.value as InvoicePaymentChargebackParams,
) )
.pipe(untilDestroyed(this)) .pipe(untilDestroyed(this))
.subscribe({ .subscribe({

View File

@ -25,17 +25,17 @@ export class PaymentDetailsComponent {
chargebacks$ = merge( chargebacks$ = merge(
this.route.params, this.route.params,
defer(() => this.updateChargebacks$) defer(() => this.updateChargebacks$),
).pipe( ).pipe(
map(() => this.route.snapshot.params as Record<'invoiceID' | 'paymentID', string>), map(() => this.route.snapshot.params as Record<'invoiceID' | 'paymentID', string>),
switchMap(({ invoiceID, paymentID }) => switchMap(({ invoiceID, paymentID }) =>
this.invoicingService.GetPayment(invoiceID, paymentID) this.invoicingService.GetPayment(invoiceID, paymentID),
), ),
map(({ chargebacks }) => chargebacks), map(({ chargebacks }) => chargebacks),
shareReplay({ refCount: true, bufferSize: 1 }) shareReplay({ refCount: true, bufferSize: 1 }),
); );
metadata$ = from( metadata$ = from(
import('@vality/magista-proto/metadata.json').then((m) => m.default as ThriftAstMetadata[]) import('@vality/magista-proto/metadata.json').then((m) => m.default as ThriftAstMetadata[]),
); );
private updateChargebacks$ = new Subject<void>(); private updateChargebacks$ = new Subject<void>();
@ -44,14 +44,14 @@ export class PaymentDetailsComponent {
private paymentDetailsService: PaymentDetailsService, private paymentDetailsService: PaymentDetailsService,
private route: ActivatedRoute, private route: ActivatedRoute,
private invoicingService: InvoicingService, private invoicingService: InvoicingService,
private dialogService: DialogService private dialogService: DialogService,
) {} ) {}
createChargeback() { createChargeback() {
this.dialogService this.dialogService
.open( .open(
CreateChargebackDialogComponent, CreateChargebackDialogComponent,
this.route.snapshot.params as Record<'invoiceID' | 'paymentID', string> this.route.snapshot.params as Record<'invoiceID' | 'paymentID', string>,
) )
.afterClosed() .afterClosed()
.pipe(untilDestroyed(this)) .pipe(untilDestroyed(this))

View File

@ -30,7 +30,7 @@ export class PaymentDetailsService {
payment_id: paymentID, payment_id: paymentID,
}, },
invoice_ids: [invoiceID], invoice_ids: [invoiceID],
}) }),
) )
.pipe( .pipe(
map(({ payments }) => payments[0]), map(({ payments }) => payments[0]),
@ -38,10 +38,10 @@ export class PaymentDetailsService {
if (!payment) { if (!payment) {
this.snackBar.open('An error occurred when receiving payment', 'OK'); this.snackBar.open('An error occurred when receiving payment', 'OK');
} }
}) }),
)
), ),
shareReplay(1) ),
shareReplay(1),
); );
// eslint-disable-next-line @typescript-eslint/member-ordering // eslint-disable-next-line @typescript-eslint/member-ordering
@ -51,13 +51,13 @@ export class PaymentDetailsService {
shop$ = this.payment$.pipe( shop$ = this.payment$.pipe(
switchMap((payment) => combineLatest([this.partyID$, of(payment.shop_id)])), switchMap((payment) => combineLatest([this.partyID$, of(payment.shop_id)])),
switchMap(([partyID, shopID]) => this.partyManagementService.GetShop(partyID, shopID)), switchMap(([partyID, shopID]) => this.partyManagementService.GetShop(partyID, shopID)),
shareReplay(1) shareReplay(1),
); );
constructor( constructor(
private partyManagementService: PartyManagementService, private partyManagementService: PartyManagementService,
private merchantStatisticsService: MerchantStatisticsService, private merchantStatisticsService: MerchantStatisticsService,
private route: ActivatedRoute, private route: ActivatedRoute,
private snackBar: MatSnackBar private snackBar: MatSnackBar,
) {} ) {}
} }

View File

@ -21,20 +21,20 @@ export class FetchContractorService {
this.hasError$.next(); this.hasError$.next();
return of('error'); return of('error');
}), }),
filter((result) => result !== 'error') filter((result) => result !== 'error'),
), ),
]) ]),
), ),
map(([contractID, party]: [ContractID, Party]) => { map(([contractID, party]: [ContractID, Party]) => {
const contractorID = party.contracts.get(contractID)?.contractor_id; const contractorID = party.contracts.get(contractID)?.contractor_id;
return party.contractors.get(contractorID)?.contractor; return party.contractors.get(contractorID)?.contractor;
}), }),
shareReplay(1) shareReplay(1),
); );
// eslint-disable-next-line @typescript-eslint/member-ordering // eslint-disable-next-line @typescript-eslint/member-ordering
inProgress$ = progress(this.getContractor$, merge(this.contractor$, this.hasError$)).pipe( inProgress$ = progress(this.getContractor$, merge(this.contractor$, this.hasError$)).pipe(
startWith(true) startWith(true),
); );
constructor(private partyManagementService: PartyManagementService) { constructor(private partyManagementService: PartyManagementService) {

View File

@ -5,7 +5,7 @@
{{ payment.currency_symbolic_code | ccCurrency }}</cc-details-item {{ payment.currency_symbolic_code | ccCurrency }}</cc-details-item
> >
<cc-details-item fxFlex title="Created At">{{ <cc-details-item fxFlex title="Created At">{{
payment.created_at | date : 'dd.MM.yyyy HH:mm:ss' payment.created_at | date: 'dd.MM.yyyy HH:mm:ss'
}}</cc-details-item> }}</cc-details-item>
<cc-details-item fxFlex title="Status"> <cc-details-item fxFlex title="Status">
<cc-status [color]="payment.status | toStatus | toPaymentColor">{{ <cc-status [color]="payment.status | toStatus | toPaymentColor">{{

View File

@ -19,15 +19,15 @@ export class FetchProviderService {
this.hasError$.next(); this.hasError$.next();
return of('error'); return of('error');
}), }),
filter((result) => result !== 'error') filter((result) => result !== 'error'),
)
), ),
shareReplay(1) ),
shareReplay(1),
); );
// eslint-disable-next-line @typescript-eslint/member-ordering // eslint-disable-next-line @typescript-eslint/member-ordering
inProgress$ = progress(this.getProvider$, merge(this.provider$, this.hasError$)).pipe( inProgress$ = progress(this.getProvider$, merge(this.provider$, this.hasError$)).pipe(
startWith(true) startWith(true),
); );
constructor(private domainStoreService: DomainStoreService) { constructor(private domainStoreService: DomainStoreService) {

View File

@ -19,15 +19,15 @@ export class FetchTerminalService {
this.hasError$.next(); this.hasError$.next();
return of('error'); return of('error');
}), }),
filter((result) => result !== 'error') filter((result) => result !== 'error'),
)
), ),
shareReplay(1) ),
shareReplay(1),
); );
// eslint-disable-next-line @typescript-eslint/member-ordering // eslint-disable-next-line @typescript-eslint/member-ordering
inProgress$ = progress(this.getTerminal$, merge(this.terminal$, this.hasError$)).pipe( inProgress$ = progress(this.getTerminal$, merge(this.terminal$, this.hasError$)).pipe(
startWith(true) startWith(true),
); );
constructor(private domainStoreService: DomainStoreService) { constructor(private domainStoreService: DomainStoreService) {

View File

@ -21,7 +21,7 @@ export class FetchRefundsService extends PartialFetcher<
protected fetch( protected fetch(
params: DeepPartial<RefundSearchQuery>, params: DeepPartial<RefundSearchQuery>,
continuationToken: string continuationToken: string,
): Observable<FetchResult<StatRefund>> { ): Observable<FetchResult<StatRefund>> {
return this.merchantStatisticsService return this.merchantStatisticsService
.SearchRefunds( .SearchRefunds(
@ -34,15 +34,15 @@ export class FetchRefundsService extends PartialFetcher<
from_time: new Date('01.01.2020').toISOString(), // TODO from_time: new Date('01.01.2020').toISOString(), // TODO
to_time: new Date().toISOString(), to_time: new Date().toISOString(),
}, },
params.common_search_query_params params.common_search_query_params,
), ),
}) }),
) )
.pipe( .pipe(
map(({ refunds, continuation_token }) => ({ map(({ refunds, continuation_token }) => ({
result: refunds, result: refunds,
continuationToken: continuation_token, continuationToken: continuation_token,
})) })),
); );
} }
} }

View File

@ -17,7 +17,10 @@ export class PaymentRefundsComponent implements OnInit {
hasMore$ = this.fetchRefundsService.hasMore$; hasMore$ = this.fetchRefundsService.hasMore$;
refunds$ = this.fetchRefundsService.searchResult$; refunds$ = this.fetchRefundsService.searchResult$;
constructor(private fetchRefundsService: FetchRefundsService, private snackBar: MatSnackBar) {} constructor(
private fetchRefundsService: FetchRefundsService,
private snackBar: MatSnackBar,
) {}
ngOnInit() { ngOnInit() {
this.fetchRefundsService.search({ this.fetchRefundsService.search({
@ -26,7 +29,7 @@ export class PaymentRefundsComponent implements OnInit {
invoice_ids: [this.invoiceID], invoice_ids: [this.invoiceID],
}); });
this.fetchRefundsService.errors$.subscribe((e) => this.fetchRefundsService.errors$.subscribe((e) =>
this.snackBar.open(`An error occurred while search refunds (${String(e)})`, 'OK') this.snackBar.open(`An error occurred while search refunds (${String(e)})`, 'OK'),
); );
} }

View File

@ -2,21 +2,21 @@
<ng-container matColumnDef="createdAt"> <ng-container matColumnDef="createdAt">
<th *matHeaderCellDef class="mat-caption" mat-header-cell>Created At</th> <th *matHeaderCellDef class="mat-caption" mat-header-cell>Created At</th>
<td *matCellDef="let refund" mat-cell> <td *matCellDef="let refund" mat-cell>
{{ refund.created_at | date : 'dd.MM.yyyy HH:mm:ss' }} {{ refund.created_at | date: 'dd.MM.yyyy HH:mm:ss' }}
</td> </td>
</ng-container> </ng-container>
<ng-container matColumnDef="status"> <ng-container matColumnDef="status">
<th *matHeaderCellDef class="mat-caption" mat-header-cell>Status</th> <th *matHeaderCellDef class="mat-caption" mat-header-cell>Status</th>
<td *matCellDef="let refund" mat-cell> <td *matCellDef="let refund" mat-cell>
<cc-status>{{ refund.status | ccMapUnion : mapStatus }}</cc-status> <cc-status>{{ refund.status | ccMapUnion: mapStatus }}</cc-status>
</td> </td>
</ng-container> </ng-container>
<ng-container matColumnDef="amount"> <ng-container matColumnDef="amount">
<th *matHeaderCellDef class="mat-caption" mat-header-cell>Amount</th> <th *matHeaderCellDef class="mat-caption" mat-header-cell>Amount</th>
<td *matCellDef="let refund" mat-cell> <td *matCellDef="let refund" mat-cell>
{{ refund.amount | amountCurrency : refund.currency_symbolic_code }} {{ refund.amount | amountCurrency: refund.currency_symbolic_code }}
</td> </td>
</ng-container> </ng-container>

View File

@ -32,7 +32,7 @@ export class CreatePaymentAdjustmentComponent extends DialogSuperclass<
injector: Injector, injector: Injector,
private invoicingService: InvoicingService, private invoicingService: InvoicingService,
private log: NotifyLogService, private log: NotifyLogService,
private domainMetadataFormExtensionsService: DomainMetadataFormExtensionsService private domainMetadataFormExtensionsService: DomainMetadataFormExtensionsService,
) { ) {
super(injector); super(injector);
} }
@ -57,13 +57,13 @@ export class CreatePaymentAdjustmentComponent extends DialogSuperclass<
return of(null); return of(null);
}), }),
finalize(() => finalize(() =>
this.progress$.next(this.progress$.value + progressStep) this.progress$.next(this.progress$.value + progressStep),
)
)
)
)
), ),
untilDestroyed(this) ),
),
),
),
untilDestroyed(this),
) )
.subscribe({ .subscribe({
complete: () => { complete: () => {
@ -82,8 +82,8 @@ export class CreatePaymentAdjustmentComponent extends DialogSuperclass<
.join(', '); .join(', ');
this.log.error( this.log.error(
new Error( new Error(
`${this.withError.length} out of ${payments.length} failed. Errors: ${errors}` `${this.withError.length} out of ${payments.length} failed. Errors: ${errors}`,
) ),
); );
} }
this.progress$.next(0); this.progress$.next(0);

View File

@ -100,6 +100,6 @@ export class PaymentsTableComponent {
constructor( constructor(
private amountCurrencyService: AmountCurrencyService, private amountCurrencyService: AmountCurrencyService,
private partiesStoreService: PartiesStoreService, private partiesStoreService: PartiesStoreService,
private router: Router private router: Router,
) {} ) {}
} }

View File

@ -50,7 +50,7 @@ export class PaymentsComponent implements OnInit {
payment_params: {}, payment_params: {},
}); });
metadata$ = from( metadata$ = from(
import('@vality/magista-proto/metadata.json').then((m) => m.default as ThriftAstMetadata[]) import('@vality/magista-proto/metadata.json').then((m) => m.default as ThriftAstMetadata[]),
); );
extensions: MetadataFormExtension[] = [ extensions: MetadataFormExtension[] = [
{ {
@ -63,7 +63,7 @@ export class PaymentsComponent implements OnInit {
'payment_first6', 'payment_first6',
'payment_last4', 'payment_last4',
'payment_rrn', 'payment_rrn',
].includes(data?.field?.name) ].includes(data?.field?.name),
), ),
extension: () => of({ hidden: true }), extension: () => of({ hidden: true }),
}, },
@ -79,12 +79,12 @@ export class PaymentsComponent implements OnInit {
}>, }>,
private fetchPaymentsService: FetchPaymentsService, private fetchPaymentsService: FetchPaymentsService,
private dialogService: DialogService, private dialogService: DialogService,
private fb: NonNullableFormBuilder private fb: NonNullableFormBuilder,
) {} ) {}
ngOnInit() { ngOnInit() {
this.filtersForm.patchValue( this.filtersForm.patchValue(
lodashMerge({}, this.qp.params.filters, clean({ dateRange: this.qp.params.dateRange })) lodashMerge({}, this.qp.params.filters, clean({ dateRange: this.qp.params.dateRange })),
); );
const otherFilters = this.otherFiltersControl.value; const otherFilters = this.otherFiltersControl.value;
const otherFiltersParams: Partial<PaymentSearchQuery> = this.qp.params.otherFilters || {}; const otherFiltersParams: Partial<PaymentSearchQuery> = this.qp.params.otherFilters || {};
@ -123,13 +123,13 @@ export class PaymentsComponent implements OnInit {
}, },
invoice_ids: filters.invoice_ids, invoice_ids: filters.invoice_ids,
}), }),
options options,
); );
this.active = this.active =
countProps( countProps(
filters, filters,
otherFilters.payment_params, otherFilters.payment_params,
otherFilters.common_search_query_params otherFilters.common_search_query_params,
) + +!isEqualDateRange(dateRange, createDateRangeToToday()); ) + +!isEqualDateRange(dateRange, createDateRangeToToday());
} }

View File

@ -12,14 +12,14 @@ import { MerchantStatisticsService } from '@cc/app/api/magista';
export class FetchPaymentsService extends FetchSuperclass<StatPayment, PaymentSearchQuery> { export class FetchPaymentsService extends FetchSuperclass<StatPayment, PaymentSearchQuery> {
constructor( constructor(
private merchantStatisticsService: MerchantStatisticsService, private merchantStatisticsService: MerchantStatisticsService,
private log: NotifyLogService private log: NotifyLogService,
) { ) {
super(); super();
} }
protected fetch( protected fetch(
params: PaymentSearchQuery, params: PaymentSearchQuery,
{ size, continuationToken }: FetchOptions { size, continuationToken }: FetchOptions,
): Observable<FetchResult<StatPayment>> { ): Observable<FetchResult<StatPayment>> {
return this.merchantStatisticsService return this.merchantStatisticsService
.SearchPayments({ .SearchPayments({
@ -38,7 +38,7 @@ export class FetchPaymentsService extends FetchSuperclass<StatPayment, PaymentSe
catchError((err) => { catchError((err) => {
this.log.errorOperation(err, 'receive', 'payments'); this.log.errorOperation(err, 'receive', 'payments');
return of({ result: [] }); return of({ result: [] });
}) }),
); );
} }
} }

View File

@ -37,7 +37,7 @@
payout.status.cancelled.details payout.status.cancelled.details
}}</cc-details-item> }}</cc-details-item>
<cc-details-item title="Created At">{{ <cc-details-item title="Created At">{{
payout.created_at | date : 'dd.MM.yyyy HH:mm:ss' payout.created_at | date: 'dd.MM.yyyy HH:mm:ss'
}}</cc-details-item> }}</cc-details-item>
</div> </div>

View File

@ -20,25 +20,27 @@ export class PayoutDetailsComponent {
startWith(this.route.snapshot.params), startWith(this.route.snapshot.params),
pluck('payoutId'), pluck('payoutId'),
switchMap((id: string) => this.payoutManagementService.GetPayout(id)), switchMap((id: string) => this.payoutManagementService.GetPayout(id)),
shareReplay({ refCount: true, bufferSize: 1 }) shareReplay({ refCount: true, bufferSize: 1 }),
); );
shop$ = this.payout$.pipe( shop$ = this.payout$.pipe(
switchMap(({ party_id, shop_id }) => switchMap(({ party_id, shop_id }) =>
this.partyManagementService.GetShop(party_id, shop_id) this.partyManagementService.GetShop(party_id, shop_id),
), ),
shareReplay({ refCount: true, bufferSize: 1 }) shareReplay({ refCount: true, bufferSize: 1 }),
); );
party$ = this.payout$.pipe( party$ = this.payout$.pipe(
switchMap(({ party_id }) => this.partyManagementService.Get(party_id)), switchMap(({ party_id }) => this.partyManagementService.Get(party_id)),
shareReplay({ refCount: true, bufferSize: 1 }) shareReplay({ refCount: true, bufferSize: 1 }),
); );
payoutTool$ = combineLatest([this.payout$, this.shop$]).pipe( payoutTool$ = combineLatest([this.payout$, this.shop$]).pipe(
switchMap(([{ party_id, payout_tool_id }, { contract_id }]) => switchMap(([{ party_id, payout_tool_id }, { contract_id }]) =>
this.partyManagementService this.partyManagementService
.GetContract(party_id, contract_id) .GetContract(party_id, contract_id)
.pipe(map((contract) => contract.payout_tools.find((t) => t.id === payout_tool_id))) .pipe(
map((contract) => contract.payout_tools.find((t) => t.id === payout_tool_id)),
), ),
shareReplay({ refCount: true, bufferSize: 1 }) ),
shareReplay({ refCount: true, bufferSize: 1 }),
); );
displayedColumns = ['source', 'destination', 'volume', 'details']; displayedColumns = ['source', 'destination', 'volume', 'details'];
@ -46,7 +48,7 @@ export class PayoutDetailsComponent {
private route: ActivatedRoute, private route: ActivatedRoute,
private payoutManagementService: PayoutManagementService, private payoutManagementService: PayoutManagementService,
private partyManagementService: PartyManagementService, private partyManagementService: PartyManagementService,
private payoutActionsService: PayoutActionsService private payoutActionsService: PayoutActionsService,
) {} ) {}
canBeConfirmed(status: keyof PayoutStatus) { canBeConfirmed(status: keyof PayoutStatus) {

View File

@ -12,7 +12,7 @@ import { RouterModule } from '@angular/router';
path: 'payouts/:payoutId', path: 'payouts/:payoutId',
loadChildren: () => loadChildren: () =>
import('./payout-details/payout-details.module').then( import('./payout-details/payout-details.module').then(
(m) => m.PayoutDetailsModule (m) => m.PayoutDetailsModule,
), ),
}, },
]), ]),

View File

@ -27,7 +27,7 @@ export class CancelPayoutDialogComponent extends DialogSuperclass<
injector: Injector, injector: Injector,
private payoutManagementService: PayoutManagementService, private payoutManagementService: PayoutManagementService,
private notificationService: NotificationService, private notificationService: NotificationService,
private notificationErrorService: NotificationErrorService private notificationErrorService: NotificationErrorService,
) { ) {
super(injector); super(injector);
} }

View File

@ -43,7 +43,7 @@ export class CreatePayoutDialogComponent extends DialogSuperclass<CreatePayoutDi
private fb: FormBuilder, private fb: FormBuilder,
private payoutManagementService: PayoutManagementService, private payoutManagementService: PayoutManagementService,
private notificationService: NotificationService, private notificationService: NotificationService,
private notificationErrorService: NotificationErrorService private notificationErrorService: NotificationErrorService,
) { ) {
super(injector); super(injector);
} }
@ -64,8 +64,8 @@ export class CreatePayoutDialogComponent extends DialogSuperclass<CreatePayoutDi
}, },
payout_tool_id: value.payoutToolId, payout_tool_id: value.payoutToolId,
}, },
isNil isNil,
) as PayoutParams ) as PayoutParams,
) )
.pipe(untilDestroyed(this), progressTo(this.progress$)) .pipe(untilDestroyed(this), progressTo(this.progress$))
.subscribe({ .subscribe({

View File

@ -11,13 +11,13 @@
<ng-container matColumnDef="shop"> <ng-container matColumnDef="shop">
<th *matHeaderCellDef mat-header-cell>Shop</th> <th *matHeaderCellDef mat-header-cell>Shop</th>
<td *matCellDef="let payout" mat-cell>{{ payout.shop_id | shopName : payout.party_id }}</td> <td *matCellDef="let payout" mat-cell>{{ payout.shop_id | shopName: payout.party_id }}</td>
</ng-container> </ng-container>
<ng-container matColumnDef="createdAt"> <ng-container matColumnDef="createdAt">
<th *matHeaderCellDef mat-header-cell>Created At</th> <th *matHeaderCellDef mat-header-cell>Created At</th>
<td *matCellDef="let payout" mat-cell> <td *matCellDef="let payout" mat-cell>
{{ payout.created_at | date : 'dd.MM.yyyy HH:mm:ss' }} {{ payout.created_at | date: 'dd.MM.yyyy HH:mm:ss' }}
</td> </td>
</ng-container> </ng-container>

View File

@ -32,7 +32,7 @@ export class PayoutsComponent implements OnInit {
constructor( constructor(
private fetchPayoutsService: FetchPayoutsService, private fetchPayoutsService: FetchPayoutsService,
private qp: QueryParamsService<Partial<PayoutsSearchForm>>, private qp: QueryParamsService<Partial<PayoutsSearchForm>>,
private dialogService: DialogService private dialogService: DialogService,
) {} ) {}
ngOnInit() { ngOnInit() {
@ -57,14 +57,14 @@ export class PayoutsComponent implements OnInit {
party_id: value.partyId, party_id: value.partyId,
shop_ids: value.shops, shop_ids: value.shops,
}, },
isNilOrEmptyString isNilOrEmptyString,
), ),
payout_id: value.payoutId, payout_id: value.payoutId,
payout_status_types: value.payoutStatusTypes, payout_status_types: value.payoutStatusTypes,
payout_type: value.payoutToolType, payout_type: value.payoutToolType,
}, },
isNilOrEmptyString isNilOrEmptyString,
) as SearchParams ) as SearchParams,
); );
} }

View File

@ -23,14 +23,14 @@ export type SearchParams = Overwrite<
export class FetchPayoutsService extends PartialFetcher<StatPayout, SearchParams> { export class FetchPayoutsService extends PartialFetcher<StatPayout, SearchParams> {
constructor( constructor(
private merchantStatisticsService: MerchantStatisticsService, private merchantStatisticsService: MerchantStatisticsService,
private notificationErrorService: NotificationErrorService private notificationErrorService: NotificationErrorService,
) { ) {
super(); super();
} }
protected fetch( protected fetch(
params: SearchParams, params: SearchParams,
continuationToken: string continuationToken: string,
): Observable<FetchResult<StatPayout>> { ): Observable<FetchResult<StatPayout>> {
return this.merchantStatisticsService return this.merchantStatisticsService
.SearchPayouts({ .SearchPayouts({
@ -44,7 +44,7 @@ export class FetchPayoutsService extends PartialFetcher<StatPayout, SearchParams
map(({ continuation_token, payouts }) => ({ map(({ continuation_token, payouts }) => ({
result: payouts, result: payouts,
continuationToken: continuation_token, continuationToken: continuation_token,
})) })),
); );
} }

View File

@ -16,7 +16,7 @@ export class PayoutActionsService {
constructor( constructor(
private payoutManagementService: PayoutManagementService, private payoutManagementService: PayoutManagementService,
private dialogService: DialogService, private dialogService: DialogService,
private notificationErrorService: NotificationErrorService private notificationErrorService: NotificationErrorService,
) {} ) {}
canBeConfirmed(status: keyof PayoutStatus) { canBeConfirmed(status: keyof PayoutStatus) {
@ -38,7 +38,7 @@ export class PayoutActionsService {
.pipe( .pipe(
filter(({ status }) => status === DialogResponseStatus.Success), filter(({ status }) => status === DialogResponseStatus.Success),
switchMap(() => this.payoutManagementService.ConfirmPayout(id)), switchMap(() => this.payoutManagementService.ConfirmPayout(id)),
untilDestroyed(this) untilDestroyed(this),
) )
.subscribe({ .subscribe({
error: this.notificationErrorService.error, error: this.notificationErrorService.error,

View File

@ -39,11 +39,11 @@ export class RepairByScenarioDialogComponent
typeControl = new FormControl<Types>(Types.Same, Validators.required); typeControl = new FormControl<Types>(Types.Same, Validators.required);
form = new FormControl<RepairInvoicesRequest | RepairWithdrawalsRequest>( form = new FormControl<RepairInvoicesRequest | RepairWithdrawalsRequest>(
[], [],
Validators.required Validators.required,
); );
sameForm = new FormControl<RepairInvoicesRequest | RepairWithdrawalsRequest>( sameForm = new FormControl<RepairInvoicesRequest | RepairWithdrawalsRequest>(
null, null,
Validators.required Validators.required,
); );
metadata$ = from(import('@vality/repairer-proto/metadata.json').then((m) => m.default)); metadata$ = from(import('@vality/repairer-proto/metadata.json').then((m) => m.default));
extensions$ = this.domainMetadataFormExtensionsService.extensions$; extensions$ = this.domainMetadataFormExtensionsService.extensions$;
@ -61,7 +61,7 @@ export class RepairByScenarioDialogComponent
private repairManagementService: RepairManagementService, private repairManagementService: RepairManagementService,
private notificationErrorService: NotificationErrorService, private notificationErrorService: NotificationErrorService,
private notificationService: NotificationService, private notificationService: NotificationService,
private domainMetadataFormExtensionsService: DomainMetadataFormExtensionsService private domainMetadataFormExtensionsService: DomainMetadataFormExtensionsService,
) { ) {
super(injector); super(injector);
} }
@ -71,7 +71,7 @@ export class RepairByScenarioDialogComponent
.pipe(untilDestroyed(this)) .pipe(untilDestroyed(this))
.subscribe(() => { .subscribe(() => {
this.form.setValue( this.form.setValue(
this.dialogData.machines.map(({ id }) => ({ id, scenario: {} })) this.dialogData.machines.map(({ id }) => ({ id, scenario: {} })),
); );
}); });
} }

View File

@ -80,7 +80,7 @@ export class RepairingComponent implements OnInit {
tooltip: 'history', tooltip: 'history',
}, },
]), ]),
shareReplay({ refCount: true, bufferSize: 1 }) shareReplay({ refCount: true, bufferSize: 1 }),
); );
cellTemplate: Record<string, TemplateRef<unknown>> = {}; cellTemplate: Record<string, TemplateRef<unknown>> = {};
@ -92,14 +92,14 @@ export class RepairingComponent implements OnInit {
private repairManagementService: RepairManagementService, private repairManagementService: RepairManagementService,
private notificationService: NotificationService, private notificationService: NotificationService,
private notificationErrorService: NotificationErrorService, private notificationErrorService: NotificationErrorService,
private domainStoreService: DomainStoreService private domainStoreService: DomainStoreService,
) {} ) {}
ngOnInit() { ngOnInit() {
this.filters.valueChanges this.filters.valueChanges
.pipe( .pipe(
map(() => clean(this.filters.value)), map(() => clean(this.filters.value)),
untilDestroyed(this) untilDestroyed(this),
) )
.subscribe((v: Filters) => this.qp.set(v)); .subscribe((v: Filters) => this.qp.set(v));
this.qp.params$ this.qp.params$
@ -118,9 +118,9 @@ export class RepairingComponent implements OnInit {
to_time: timespan?.end?.toISOString(), to_time: timespan?.end?.toISOString(),
} }
: null, : null,
}) }),
), ),
untilDestroyed(this) untilDestroyed(this),
) )
.subscribe((params) => this.machinesService.search(params)); .subscribe((params) => this.machinesService.search(params));
} }
@ -144,10 +144,10 @@ export class RepairingComponent implements OnInit {
filter(({ status }) => status === DialogResponseStatus.Success), filter(({ status }) => status === DialogResponseStatus.Success),
switchMap(() => switchMap(() =>
this.repairManagementService.SimpleRepairAll( this.repairManagementService.SimpleRepairAll(
this.selected$.value.map(({ id, ns }) => ({ id, ns })) this.selected$.value.map(({ id, ns }) => ({ id, ns })),
)
), ),
untilDestroyed(this) ),
untilDestroyed(this),
) )
.subscribe({ .subscribe({
next: () => { next: () => {

View File

@ -10,7 +10,7 @@ import { NotificationErrorService } from '../../../shared/services/notification-
export class MachinesService extends PartialFetcher<Machine, SearchRequest> { export class MachinesService extends PartialFetcher<Machine, SearchRequest> {
constructor( constructor(
private repairManagementService: RepairManagementService, private repairManagementService: RepairManagementService,
private notificationErrorService: NotificationErrorService private notificationErrorService: NotificationErrorService,
) { ) {
super(); super();
} }
@ -22,7 +22,7 @@ export class MachinesService extends PartialFetcher<Machine, SearchRequest> {
map(({ machines, continuation_token }) => ({ map(({ machines, continuation_token }) => ({
result: machines, result: machines,
continuationToken: continuation_token, continuationToken: continuation_token,
})) })),
); );
} }

View File

@ -23,7 +23,7 @@ describe('ChangeDelegateRulesetDialogComponent', () => {
fixture = TestBed.createComponent(HostComponent); fixture = TestBed.createComponent(HostComponent);
debugElement = fixture.debugElement.query( debugElement = fixture.debugElement.query(
By.directive(ChangeDelegateRulesetDialogComponent) By.directive(ChangeDelegateRulesetDialogComponent),
); );
component = debugElement.componentInstance; component = debugElement.componentInstance;

View File

@ -29,7 +29,7 @@ export class ChangeDelegateRulesetDialogComponent
constructor( constructor(
injector: Injector, injector: Injector,
private fb: UntypedFormBuilder, private fb: UntypedFormBuilder,
private routingRulesService: RoutingRulesService private routingRulesService: RoutingRulesService,
) { ) {
super(injector); super(injector);
} }
@ -39,7 +39,7 @@ export class ChangeDelegateRulesetDialogComponent
.getRuleset(this.dialogData.mainRulesetRefID) .getRuleset(this.dialogData.mainRulesetRefID)
.pipe( .pipe(
map((r) => r?.data?.decisions?.delegates?.[this.dialogData?.delegateIdx]), map((r) => r?.data?.decisions?.delegates?.[this.dialogData?.delegateIdx]),
untilDestroyed(this) untilDestroyed(this),
) )
.subscribe((delegate) => { .subscribe((delegate) => {
this.form.patchValue({ this.form.patchValue({

View File

@ -25,7 +25,7 @@ export class ChangeTargetDialogComponent extends DialogSuperclass<
constructor( constructor(
injector: Injector, injector: Injector,
private routingRulesService: RoutingRulesService, private routingRulesService: RoutingRulesService,
private notificationErrorService: NotificationErrorService private notificationErrorService: NotificationErrorService,
) { ) {
super(injector); super(injector);
this.routingRulesService this.routingRulesService

View File

@ -33,7 +33,7 @@ export class AttachNewRulesetDialogComponent extends DialogSuperclass<
injector: Injector, injector: Injector,
private fb: UntypedFormBuilder, private fb: UntypedFormBuilder,
private routingRulesService: RoutingRulesService, private routingRulesService: RoutingRulesService,
private notificationErrorService: NotificationErrorService private notificationErrorService: NotificationErrorService,
) { ) {
super(injector); super(injector);
} }

View File

@ -22,7 +22,7 @@ import { ROUTING_CONFIG } from './routing-config';
path: '', path: '',
loadChildren: () => loadChildren: () =>
import('../party-routing-ruleset').then( import('../party-routing-ruleset').then(
(m) => m.PartyRoutingRulesetModule (m) => m.PartyRoutingRulesetModule,
), ),
}, },
{ {

View File

@ -33,7 +33,7 @@ export class PartyDelegateRulesetsComponent {
rules.map(({ mainRoutingRule, partyDelegate, paymentInstitution }) => ({ rules.map(({ mainRoutingRule, partyDelegate, paymentInstitution }) => ({
parentRefId: mainRoutingRule?.ref?.id, parentRefId: mainRoutingRule?.ref?.id,
delegateIdx: mainRoutingRule?.data?.decisions?.delegates?.findIndex( delegateIdx: mainRoutingRule?.data?.decisions?.delegates?.findIndex(
(d) => d === partyDelegate (d) => d === partyDelegate,
), ),
paymentInstitution: { paymentInstitution: {
text: paymentInstitution?.data?.name, text: paymentInstitution?.data?.name,
@ -47,8 +47,8 @@ export class PartyDelegateRulesetsComponent {
text: partyDelegate?.description, text: partyDelegate?.description,
caption: partyDelegate?.ruleset?.id, caption: partyDelegate?.ruleset?.id,
}, },
})) })),
) ),
); );
private get partyID() { private get partyID() {
@ -62,7 +62,7 @@ export class PartyDelegateRulesetsComponent {
private dialogService: DialogService, private dialogService: DialogService,
private domainStoreService: DomainStoreService, private domainStoreService: DomainStoreService,
private notificationErrorService: NotificationErrorService, private notificationErrorService: NotificationErrorService,
private route: ActivatedRoute private route: ActivatedRoute,
) {} ) {}
attachNewRuleset() { attachNewRuleset() {

Some files were not shown because too many files have changed in this diff Show More