diff --git a/package-lock.json b/package-lock.json index d1f607632..60446e64e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,12 +21,11 @@ "@angular/router": "^19.1.6", "@jsverse/transloco": "^7.5.0", "@vality/matez": "19.0.1-pr-423-eca1120.0", - "@vality/swag-anapi-v2": "2.0.1-dc90399.0", - "@vality/swag-api-keys-v2": "0.1.2", + "@vality/swag-anapi-v2": "2.0.1-4c69a2f.0", + "@vality/swag-api-keys-v2": "0.1.3-eb0cff1.0", "@vality/swag-organizations": "1.0.1-67dcada.0", - "@vality/swag-payments": "0.1.3-fd6802c.0", - "@vality/swag-url-shortener": "0.1.1-17b1e98.0", - "@vality/swag-wallets": "0.1.3", + "@vality/swag-payments": "0.1.3-9cbb3b3.0", + "@vality/swag-wallets": "0.1.4-20f6c0d.0", "apexcharts": "^3.19.2", "humanize-duration": "^3.19.0", "jwt-decode": "^3.1.2", @@ -9538,9 +9537,9 @@ } }, "node_modules/@vality/swag-anapi-v2": { - "version": "2.0.1-dc90399.0", - "resolved": "https://registry.npmjs.org/@vality/swag-anapi-v2/-/swag-anapi-v2-2.0.1-dc90399.0.tgz", - "integrity": "sha512-0eRkyR9uynKBdpKJvbhoH+deviFHMQkwl+D42DOcyq8ZVn5HXCd6bqsQvVGIZ+9yR1LR6Tw28pTYXRimmq8otQ==", + "version": "2.0.1-4c69a2f.0", + "resolved": "https://registry.npmjs.org/@vality/swag-anapi-v2/-/swag-anapi-v2-2.0.1-4c69a2f.0.tgz", + "integrity": "sha512-l+ltOdeodGbTShCuBtR5sx460x12+NLDuq8HncVjb1BJ0IpKMxjuW7iu4dWSYrdXJD32We81cRsSC662fF1v6w==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.3.0" @@ -9551,9 +9550,9 @@ } }, "node_modules/@vality/swag-api-keys-v2": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/@vality/swag-api-keys-v2/-/swag-api-keys-v2-0.1.2.tgz", - "integrity": "sha512-MlidctOG1gsUpSdG8Dnd9MIwe755+zrIpj2z9qMs7u5bthMH7fuqjBpnI4vGVJvrTe2B4j+Pkh3JYnXDMKuE2w==", + "version": "0.1.3-eb0cff1.0", + "resolved": "https://registry.npmjs.org/@vality/swag-api-keys-v2/-/swag-api-keys-v2-0.1.3-eb0cff1.0.tgz", + "integrity": "sha512-sF+o70yFpHTnBLa9Jup5zj4HvZg9+7ezmvWV/tfNRC/GimEnoH4Lv2sERNM/hPe+pqthoMo5+zBSGZlsbjoHQw==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.3.0" @@ -9577,22 +9576,9 @@ } }, "node_modules/@vality/swag-payments": { - "version": "0.1.3-fd6802c.0", - "resolved": "https://registry.npmjs.org/@vality/swag-payments/-/swag-payments-0.1.3-fd6802c.0.tgz", - "integrity": "sha512-mpykZPpuiHZDZr3vLNVNM0VjBSgskabTfqQt+cxqz/Ggaa5dTnhjB76okTgXTZyPujaQRlSSly9dcmVmnM+A6g==", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.3.0" - }, - "peerDependencies": { - "@angular/core": "*", - "rxjs": "*" - } - }, - "node_modules/@vality/swag-url-shortener": { - "version": "0.1.1-17b1e98.0", - "resolved": "https://registry.npmjs.org/@vality/swag-url-shortener/-/swag-url-shortener-0.1.1-17b1e98.0.tgz", - "integrity": "sha512-w3AJwlvQxvuyjKQAMKb7/jEMt8eR2KZflJE77HLwIa1ztDq6AWtndTH69bVfXairq1n3wVQZ9dnEa87MXC+f8g==", + "version": "0.1.3-9cbb3b3.0", + "resolved": "https://registry.npmjs.org/@vality/swag-payments/-/swag-payments-0.1.3-9cbb3b3.0.tgz", + "integrity": "sha512-VLjnCU5oQJoNEmNWUWkQ/3qQSVYJewUHhYymrzNKzSbEY6ViPDy0y/rEUc8fRh8IN/vmaQj/IrxHbKQxHasp9A==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.3.0" @@ -9603,9 +9589,9 @@ } }, "node_modules/@vality/swag-wallets": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/@vality/swag-wallets/-/swag-wallets-0.1.3.tgz", - "integrity": "sha512-W620FPgGYcpYQNzzML3QjKPKqk4sQfkR7vU0314DfhJiPe5XtYz8FVMQWWTWHezaEt+s0EhV7WDJ4Z98/+EYYQ==", + "version": "0.1.4-20f6c0d.0", + "resolved": "https://registry.npmjs.org/@vality/swag-wallets/-/swag-wallets-0.1.4-20f6c0d.0.tgz", + "integrity": "sha512-0ikRCBGUkATFSncU9GHCtK8c+q/9S1cYfkf9xjHFSwBFOUWWPqDuVzh6MwjL5DflOSlhYSWspfROMvhZsTWO/g==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.3.0" diff --git a/package.json b/package.json index 04c79beaa..a68255440 100644 --- a/package.json +++ b/package.json @@ -38,12 +38,11 @@ "@angular/router": "^19.1.6", "@jsverse/transloco": "^7.5.0", "@vality/matez": "19.0.1-pr-423-eca1120.0", - "@vality/swag-anapi-v2": "2.0.1-dc90399.0", - "@vality/swag-api-keys-v2": "0.1.2", + "@vality/swag-anapi-v2": "2.0.1-4c69a2f.0", + "@vality/swag-api-keys-v2": "0.1.3-eb0cff1.0", "@vality/swag-organizations": "1.0.1-67dcada.0", - "@vality/swag-payments": "0.1.3-fd6802c.0", - "@vality/swag-url-shortener": "0.1.1-17b1e98.0", - "@vality/swag-wallets": "0.1.3", + "@vality/swag-payments": "0.1.3-9cbb3b3.0", + "@vality/swag-wallets": "0.1.4-20f6c0d.0", "apexcharts": "^3.19.2", "humanize-duration": "^3.19.0", "jwt-decode": "^3.1.2", diff --git a/src/app/api/payments/contracts.service.ts b/src/app/api/payments/contracts.service.ts deleted file mode 100644 index 1bec2df11..000000000 --- a/src/app/api/payments/contracts.service.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Injectable } from '@angular/core'; -import { ContractsService as ApiContractsService } from '@vality/swag-payments'; - -import { PartyIdExtension } from '@dsh/app/api/utils/extensions'; - -import { createApi } from '../utils'; - -@Injectable({ - providedIn: 'root', -}) -export class ContractsService extends createApi(ApiContractsService, [PartyIdExtension]) {} diff --git a/src/app/api/payments/index.ts b/src/app/api/payments/index.ts index ea1cec691..6e1c76f35 100644 --- a/src/app/api/payments/index.ts +++ b/src/app/api/payments/index.ts @@ -10,5 +10,4 @@ export * from './shops.service'; export * from './webhooks.service'; export * from './payments.service'; export * from './invoices.service'; -export * from './contracts.service'; export * from './payments-dictionary.service'; diff --git a/src/app/api/payments/payments-dictionary.service.ts b/src/app/api/payments/payments-dictionary.service.ts index ee1425537..d063a1b07 100644 --- a/src/app/api/payments/payments-dictionary.service.ts +++ b/src/app/api/payments/payments-dictionary.service.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; import { TranslocoService } from '@jsverse/transloco'; -import { CustomersTopic, InvoicesTopic, PaymentStatus } from '@vality/swag-payments'; +import { InvoicesTopic, PaymentStatus } from '@vality/swag-payments'; import { DictionaryService } from '../utils'; @@ -86,39 +86,6 @@ export class PaymentsDictionaryService { ), })); - customersTopicEventType$ = this.dictionaryService.create(() => ({ - CustomerCreated: this.t.translate( - 'payments.customersTopicEventType.CustomerCreated', - null, - 'dictionary', - ), - CustomerDeleted: this.t.translate( - 'payments.customersTopicEventType.CustomerDeleted', - null, - 'dictionary', - ), - CustomerReady: this.t.translate( - 'payments.customersTopicEventType.CustomerReady', - null, - 'dictionary', - ), - CustomerBindingStarted: this.t.translate( - 'payments.customersTopicEventType.CustomerBindingStarted', - null, - 'dictionary', - ), - CustomerBindingSucceeded: this.t.translate( - 'payments.customersTopicEventType.CustomerBindingSucceeded', - null, - 'dictionary', - ), - CustomerBindingFailed: this.t.translate( - 'payments.customersTopicEventType.CustomerBindingFailed', - null, - 'dictionary', - ), - })); - paymentStatus$ = this.dictionaryService.create(() => ({ pending: this.t.translate('payments.paymentStatus.pending', null, 'dictionary'), processed: this.t.translate('payments.paymentStatus.processed', null, 'dictionary'), diff --git a/src/app/api/url-shortener/index.ts b/src/app/api/url-shortener/index.ts deleted file mode 100644 index 6ad078419..000000000 --- a/src/app/api/url-shortener/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './url-shortener.module'; -export * from './shortener.service'; diff --git a/src/app/api/url-shortener/shortener.service.ts b/src/app/api/url-shortener/shortener.service.ts deleted file mode 100644 index c57adba9c..000000000 --- a/src/app/api/url-shortener/shortener.service.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Injectable } from '@angular/core'; -import { ShortenerService as ApiShortenerService } from '@vality/swag-url-shortener'; - -import { createApi } from '../utils'; - -@Injectable({ - providedIn: 'root', -}) -export class ShortenerService extends createApi(ApiShortenerService) {} diff --git a/src/app/api/url-shortener/url-shortener.module.ts b/src/app/api/url-shortener/url-shortener.module.ts deleted file mode 100644 index 3d2158410..000000000 --- a/src/app/api/url-shortener/url-shortener.module.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { NgModule } from '@angular/core'; -import { Configuration } from '@vality/swag-url-shortener'; - -import { ConfigService } from '../../config'; - -@NgModule({ - providers: [ - { - provide: Configuration, - deps: [ConfigService], - useFactory: (configService: ConfigService) => - new Configuration({ basePath: `${configService.urlShortenerEndpoint}/v1` }), - }, - ], -}) -export class UrlShortenerModule {} diff --git a/src/app/api/wallet/identities.service.ts b/src/app/api/wallet/identities.service.ts deleted file mode 100644 index a9f081e8d..000000000 --- a/src/app/api/wallet/identities.service.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { Injectable } from '@angular/core'; -import { IdentitiesService as ApiIdentitiesService, Identity } from '@vality/swag-wallets'; -import { Subject, defer, switchMap } from 'rxjs'; -import { map, shareReplay, startWith } from 'rxjs/operators'; - -import { PartyIdExtension } from '@dsh/app/api/utils/extensions'; - -import { createApi } from '../utils'; - -@Injectable({ - providedIn: 'root', -}) -export class IdentitiesService extends createApi(ApiIdentitiesService, [PartyIdExtension]) { - identities$ = defer(() => this.reloadIdentities$).pipe( - startWith(undefined), - switchMap(() => this.listIdentities()), - map((r) => r.result as Identity[]), - shareReplay({ refCount: true, bufferSize: 1 }), - ); - - private reloadIdentities$ = new Subject(); - - reloadIdentities() { - this.reloadIdentities$.next(); - } -} diff --git a/src/app/api/wallet/index.ts b/src/app/api/wallet/index.ts index fafe2bac9..24afb2506 100644 --- a/src/app/api/wallet/index.ts +++ b/src/app/api/wallet/index.ts @@ -2,7 +2,6 @@ export * from './wallet.module'; export * from './wallets.service'; export * from './webhooks.service'; export * from './withdrawals.service'; -export * from './identities.service'; export * from './deposits.service'; export * from './wallet-dictionary.service'; export * from './reports.service'; diff --git a/src/app/api/wallet/wallet-dictionary.service.ts b/src/app/api/wallet/wallet-dictionary.service.ts index fa417adf6..82a92839d 100644 --- a/src/app/api/wallet/wallet-dictionary.service.ts +++ b/src/app/api/wallet/wallet-dictionary.service.ts @@ -2,7 +2,6 @@ import { Injectable } from '@angular/core'; import { TranslocoService } from '@jsverse/transloco'; import { Deposit, - DepositRevert, DestinationsTopic, Report, Withdrawal, @@ -55,12 +54,6 @@ export class WalletDictionaryService { }), ); - depositRevertStatus$ = this.dictionaryService.create(() => ({ - Pending: this.t.translate('wallet.depositRevertStatus.Pending', null, 'dictionary'), - Succeeded: this.t.translate('wallet.depositRevertStatus.Succeeded', null, 'dictionary'), - Failed: this.t.translate('wallet.depositRevertStatus.Failed', null, 'dictionary'), - })); - depositStatus$ = this.dictionaryService.create(() => ({ Pending: this.t.translate('wallet.depositStatus.Pending', null, 'dictionary'), Succeeded: this.t.translate('wallet.depositStatus.Succeeded', null, 'dictionary'), diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 397de1ba1..c49803584 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -24,7 +24,6 @@ import { FlexLayoutModule } from 'ng-flex-layout'; import { AnapiModule } from '@dsh/app/api/anapi'; import { PaymentsModule } from '@dsh/app/api/payments'; -import { UrlShortenerModule } from '@dsh/app/api/url-shortener'; import { WalletModule } from '@dsh/app/api/wallet'; import { ErrorModule } from '@dsh/app/shared/services'; import { createDateRangeWithPresetSerializer } from '@dsh/components/date-range-filter'; @@ -64,7 +63,6 @@ import { TranslocoHttpLoaderService } from './transloco-http-loader.service'; AnapiModule, PaymentsModule, OrganizationsModule, - UrlShortenerModule, WalletModule, SpinnerModule, ApiKeysModule, diff --git a/src/app/auth/role-access-groups.ts b/src/app/auth/role-access-groups.ts index 199c5c592..37db264c9 100644 --- a/src/app/auth/role-access-groups.ts +++ b/src/app/auth/role-access-groups.ts @@ -57,10 +57,6 @@ export const ROLE_ACCESS_GROUPS: RoleAccessGroup[] = [ name: RoleAccessName.CreateInvoice, availableRoles: [RoleId.Administrator, RoleId.Manager], }, - { - name: RoleAccessName.PaymentLinks, - availableRoles: [RoleId.Administrator, RoleId.Manager], - }, { name: RoleAccessName.CreateRefund, availableRoles: [RoleId.Administrator, RoleId.Accountant], diff --git a/src/app/auth/types/role-access-name.ts b/src/app/auth/types/role-access-name.ts index 9509e1bb3..5af157f5a 100644 --- a/src/app/auth/types/role-access-name.ts +++ b/src/app/auth/types/role-access-name.ts @@ -4,7 +4,6 @@ export enum RoleAccessName { Reports, Webhooks, ApiKeys, - PaymentLinks, ViewAnalytics, ViewPayments, diff --git a/src/app/home/actionbar/components/user/user.component.ts b/src/app/home/actionbar/components/user/user.component.ts index 1503da065..a651eef23 100644 --- a/src/app/home/actionbar/components/user/user.component.ts +++ b/src/app/home/actionbar/components/user/user.component.ts @@ -34,7 +34,7 @@ export class UserComponent { organization$ = this.contextOrganizationService.organization$; username = this.keycloakService.getUsername(); activeOrg$ = this.contextOrganizationService.organization$; - keycloakAccountEndpoint = `${this.config.keycloakEndpoint}/auth/realms/external/account/#`; + keycloakAccountEndpoint = `${this.config.keycloakEndpoint}/realms/external/account/#`; userLinksConfig$ = this.transloco.selectTranslation('components').pipe( map(() => [ { diff --git a/src/app/sections/organization-section/organization-details/change-roles-table/components/select-role-dialog/services/role-accesses-dictionary.service.ts b/src/app/sections/organization-section/organization-details/change-roles-table/components/select-role-dialog/services/role-accesses-dictionary.service.ts index 99ee0d572..998b16380 100644 --- a/src/app/sections/organization-section/organization-details/change-roles-table/components/select-role-dialog/services/role-accesses-dictionary.service.ts +++ b/src/app/sections/organization-section/organization-details/change-roles-table/components/select-role-dialog/services/role-accesses-dictionary.service.ts @@ -21,11 +21,6 @@ export class RoleAccessesDictionaryService { null, 'organization-section', ), - [RoleAccessName.PaymentLinks]: this.t.translate( - 'roleAccessesDictionary.createPaymentLink', - null, - 'organization-section', - ), [RoleAccessName.CreateRefund]: this.t.translate( 'roleAccessesDictionary.createRefund', null, diff --git a/src/app/sections/organization-section/organizations/organizations.component.html b/src/app/sections/organization-section/organizations/organizations.component.html index 6e3749791..1d1234421 100644 --- a/src/app/sections/organization-section/organizations/organizations.component.html +++ b/src/app/sections/organization-section/organizations/organizations.component.html @@ -6,11 +6,13 @@ >

{{ t('header') }}

-
- -
+ @if (isDev) { +
+ +
+ }
diff --git a/src/app/sections/organization-section/organizations/organizations.component.ts b/src/app/sections/organization-section/organizations/organizations.component.ts index 142053d66..d19884ffa 100644 --- a/src/app/sections/organization-section/organizations/organizations.component.ts +++ b/src/app/sections/organization-section/organizations/organizations.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component, DestroyRef, OnInit } from '@angular/core'; +import { ChangeDetectionStrategy, Component, DestroyRef, OnInit, isDevMode } from '@angular/core'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { MatDialog } from '@angular/material/dialog'; import { filter } from 'rxjs/operators'; @@ -21,6 +21,7 @@ export class OrganizationsComponent implements OnInit { hasMore$ = this.fetchOrganizationsService.hasMore$; isLoading$ = this.fetchOrganizationsService.doSearchAction$; lastUpdated$ = this.fetchOrganizationsService.lastUpdated$; + isDev = isDevMode(); constructor( private fetchOrganizationsService: FetchOrganizationsService, diff --git a/src/app/sections/payment-section/integrations/integrations-routing.module.ts b/src/app/sections/payment-section/integrations/integrations-routing.module.ts index 2c15ef932..43ceeb3e1 100644 --- a/src/app/sections/payment-section/integrations/integrations-routing.module.ts +++ b/src/app/sections/payment-section/integrations/integrations-routing.module.ts @@ -17,13 +17,6 @@ const ROUTES: Routes = [ }, [RoleAccessName.Webhooks], ), - createPrivateRoute( - { - path: 'payment-link', - loadChildren: () => import('./payment-link').then((m) => m.PaymentLinkModule), - }, - [RoleAccessName.PaymentLinks], - ), createPrivateRoute( { path: 'api-keys', diff --git a/src/app/sections/payment-section/integrations/integrations.component.ts b/src/app/sections/payment-section/integrations/integrations.component.ts index ab23306e3..8b2a396b8 100644 --- a/src/app/sections/payment-section/integrations/integrations.component.ts +++ b/src/app/sections/payment-section/integrations/integrations.component.ts @@ -1,6 +1,5 @@ -import { Component, isDevMode } from '@angular/core'; +import { Component } from '@angular/core'; import { TranslocoService } from '@jsverse/transloco'; -import { map } from 'rxjs'; import { RoleAccessName } from '@dsh/app/auth'; @@ -10,13 +9,6 @@ import { RoleAccessName } from '@dsh/app/auth'; }) export class IntegrationsComponent { links = [ - isDevMode() && { - path: 'payment-link', - label$: this.transloco - .selectTranslate('integrations.tabs.payment-link', null, 'payment-section') - .pipe(map((label) => `${label} (dev)`)), - roles: [RoleAccessName.PaymentLinks], - }, { path: 'api-keys', label$: this.transloco.selectTranslate( diff --git a/src/app/sections/payment-section/integrations/payment-link/create-invoice-or-invoice-template/create-invoice-or-invoice-template.component.html b/src/app/sections/payment-section/integrations/payment-link/create-invoice-or-invoice-template/create-invoice-or-invoice-template.component.html deleted file mode 100644 index ee7f0d7a6..000000000 --- a/src/app/sections/payment-section/integrations/payment-link/create-invoice-or-invoice-template/create-invoice-or-invoice-template.component.html +++ /dev/null @@ -1,55 +0,0 @@ -
-
-

{{ c('title') }}

-
-
- {{ c('description') }} -
- - {{ - c('types.personal') - }} - {{ - c('types.reusable') - }} - -
-
- - - - -
-

{{ c('invoiceTitle') }}

- - - - -
-
- -
-
diff --git a/src/app/sections/payment-section/integrations/payment-link/create-invoice-or-invoice-template/create-invoice-or-invoice-template.component.ts b/src/app/sections/payment-section/integrations/payment-link/create-invoice-or-invoice-template/create-invoice-or-invoice-template.component.ts deleted file mode 100644 index 533938d16..000000000 --- a/src/app/sections/payment-section/integrations/payment-link/create-invoice-or-invoice-template/create-invoice-or-invoice-template.component.ts +++ /dev/null @@ -1,101 +0,0 @@ -import { - ChangeDetectionStrategy, - Component, - DestroyRef, - EventEmitter, - Input, - OnInit, - Output, -} from '@angular/core'; -import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; -import { FormControl, UntypedFormBuilder } from '@angular/forms'; -import { TranslocoService } from '@jsverse/transloco'; -import { NotifyLogService } from '@vality/matez'; -import { Invoice, InvoiceTemplateAndToken, Shop } from '@vality/swag-payments'; -import { Subject, merge, throwError } from 'rxjs'; -import { catchError, map } from 'rxjs/operators'; - -import { InvoicesService } from '@dsh/app/api/payments'; - -export enum Type { - Invoice = 'invoice', - Template = 'template', -} - -export type InvoiceOrInvoiceTemplate = - | { invoiceOrInvoiceTemplate: Invoice; type: Type.Invoice } - | { invoiceOrInvoiceTemplate: InvoiceTemplateAndToken; type: Type.Template }; - -@Component({ - selector: 'dsh-create-invoice-or-invoice-template', - templateUrl: 'create-invoice-or-invoice-template.component.html', - changeDetection: ChangeDetectionStrategy.OnPush, - standalone: false, -}) -export class CreateInvoiceOrInvoiceTemplateComponent implements OnInit { - @Input() shops: Shop[]; - @Output() next = new EventEmitter(); - - nextInvoice = new Subject(); - nextTemplate = new Subject(); - - form = this.fb.group({ type: null }); - type = Type; - - createInvoiceFormControl = new FormControl(); - - constructor( - private invoicesService: InvoicesService, - private transloco: TranslocoService, - private fb: UntypedFormBuilder, - private log: NotifyLogService, - private dr: DestroyRef, - ) {} - - ngOnInit(): void { - merge( - this.nextTemplate.pipe( - map( - (template) => - ({ invoiceOrInvoiceTemplate: template, type: Type.Template }) as const, - ), - ), - this.nextInvoice - .pipe( - map( - (invoice) => - ({ invoiceOrInvoiceTemplate: invoice, type: Type.Invoice }) as const, - ), - ) - .pipe(takeUntilDestroyed(this.dr)), - ).subscribe((invoiceOrInvoiceTemplate) => this.next.emit(invoiceOrInvoiceTemplate)); - } - - create(): void { - this.createInvoiceFormControl.disable(); - this.invoicesService - .createInvoice({ - invoiceParams: this.createInvoiceFormControl.value, - }) - .pipe( - takeUntilDestroyed(this.dr), - catchError((err) => { - this.log.error( - err, - this.transloco.selectTranslate( - 'createInvoiceOrInvoiceTemplate.createInvoiceFailed', - null, - 'payment-section', - ), - ); - this.createInvoiceFormControl.enable(); - return throwError(() => err); - }), - ) - .subscribe(({ invoice }) => { - this.nextInvoice.next(invoice); - this.createInvoiceFormControl.reset(); - this.createInvoiceFormControl.enable(); - }); - } -} diff --git a/src/app/sections/payment-section/integrations/payment-link/create-invoice-or-invoice-template/index.ts b/src/app/sections/payment-section/integrations/payment-link/create-invoice-or-invoice-template/index.ts deleted file mode 100644 index d2c111d3d..000000000 --- a/src/app/sections/payment-section/integrations/payment-link/create-invoice-or-invoice-template/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './create-invoice-or-invoice-template.component'; diff --git a/src/app/sections/payment-section/integrations/payment-link/create-invoice-template/create-invoice-template.component.html b/src/app/sections/payment-section/integrations/payment-link/create-invoice-template/create-invoice-template.component.html deleted file mode 100644 index 78e10d812..000000000 --- a/src/app/sections/payment-section/integrations/payment-link/create-invoice-template/create-invoice-template.component.html +++ /dev/null @@ -1,62 +0,0 @@ -
-

{{ c('title') }}

-
- - {{ c('form.shop') }} - - - {{ shop.details.name }} - - - - - - {{ c('form.lifetime') }} - - - - - - - {{ c('form.product') }} - - - - - {{ c('form.cost') }} - - {{ currency }}  - - - -
- -
- -
-
diff --git a/src/app/sections/payment-section/integrations/payment-link/create-invoice-template/create-invoice-template.component.ts b/src/app/sections/payment-section/integrations/payment-link/create-invoice-template/create-invoice-template.component.ts deleted file mode 100644 index 8d6acaaf5..000000000 --- a/src/app/sections/payment-section/integrations/payment-link/create-invoice-template/create-invoice-template.component.ts +++ /dev/null @@ -1,86 +0,0 @@ -import { - ChangeDetectionStrategy, - Component, - DestroyRef, - EventEmitter, - Input, - OnInit, - Output, -} from '@angular/core'; -import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; -import { FormBuilder, UntypedFormGroup } from '@angular/forms'; -import { TranslocoService } from '@jsverse/transloco'; -import { FormGroupSuperclass, NotifyLogService, createControlProviders } from '@vality/matez'; -import { InvoiceTemplateAndToken, Shop } from '@vality/swag-payments'; -import isNil from 'lodash-es/isNil'; -import moment from 'moment'; -import { take } from 'rxjs'; - -import { CreateInvoiceTemplateService } from './create-invoice-template.service'; - -@Component({ - selector: 'dsh-create-invoice-template', - templateUrl: 'create-invoice-template.component.html', - changeDetection: ChangeDetectionStrategy.OnPush, - providers: createControlProviders(() => CreateInvoiceTemplateComponent), - standalone: false, -}) -export class CreateInvoiceTemplateComponent extends FormGroupSuperclass implements OnInit { - @Output() - next = new EventEmitter(); - - @Input() - shops: Shop[]; - - minDate = moment().add('2', 'day').startOf('day').toDate(); - - control: UntypedFormGroup = this.fb.group({}); - - isLoading$ = this.invoiceTemplateFormService.isLoading$; - - get currency() { - return this.shops?.find((s) => s.id === this.control.value.shopID)?.currency; - } - - constructor( - private invoiceTemplateFormService: CreateInvoiceTemplateService, - private log: NotifyLogService, - private transloco: TranslocoService, - private fb: FormBuilder, - private dr: DestroyRef, - ) { - super(); - } - - ngOnInit(): void { - super.ngOnInit(); - - if (isNil(this.shops) || this.shops.length === 0) { - throw new Error('Shops need to be initialized.'); - } - - this.control = this.invoiceTemplateFormService.createForm(this.shops); - - this.invoiceTemplateFormService.errors$ - .pipe(takeUntilDestroyed(this.dr)) - .subscribe((err) => { - this.control.enable(); - this.log.error( - err, - this.transloco.selectTranslate( - 'createInvoiceTemplate.createInvoiceTemplateFailed', - null, - 'payment-section', - ), - ); - }); - this.invoiceTemplateFormService.nextInvoiceTemplateAndToken$ - .pipe(take(1), takeUntilDestroyed(this.dr)) - .subscribe((template) => this.next.emit(template)); - } - - nextStep(): void { - this.control.disable(); - this.invoiceTemplateFormService.create(this.control.value, this.shops); - } -} diff --git a/src/app/sections/payment-section/integrations/payment-link/create-invoice-template/create-invoice-template.module.ts b/src/app/sections/payment-section/integrations/payment-link/create-invoice-template/create-invoice-template.module.ts deleted file mode 100644 index 4e00fd5be..000000000 --- a/src/app/sections/payment-section/integrations/payment-link/create-invoice-template/create-invoice-template.module.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatButtonModule } from '@angular/material/button'; -import { MatCheckboxModule } from '@angular/material/checkbox'; -import { MatDatepickerModule } from '@angular/material/datepicker'; -import { MatDialogModule } from '@angular/material/dialog'; -import { MatDividerModule } from '@angular/material/divider'; -import { MatInputModule } from '@angular/material/input'; -import { MatRadioModule } from '@angular/material/radio'; -import { MatSelectModule } from '@angular/material/select'; -import { MatMomentDateModule } from '@angular/material-moment-adapter'; -import { TranslocoModule } from '@jsverse/transloco'; -import { FlexLayoutModule } from 'ng-flex-layout'; - -import { InvoiceRandomizeAmountModule } from '@dsh/app/shared/components/invoice-randomize-amount-form'; -import { ApiModelTypesModule } from '@dsh/app/shared/pipes'; -import { LayoutModule } from '@dsh/components/layout'; -import { ConfirmActionDialogModule } from '@dsh/components/popups'; - -import { CreateInvoiceTemplateComponent } from './create-invoice-template.component'; -import { CreateInvoiceTemplateService } from './create-invoice-template.service'; - -const EXPORTED_DECLARATIONS = [CreateInvoiceTemplateComponent]; - -@NgModule({ - imports: [ - LayoutModule, - TranslocoModule, - FlexLayoutModule, - ReactiveFormsModule, - CommonModule, - MatInputModule, - MatRadioModule, - MatButtonModule, - MatSelectModule, - MatCheckboxModule, - MatDividerModule, - ConfirmActionDialogModule, - MatDialogModule, - MatDatepickerModule, - MatMomentDateModule, - ApiModelTypesModule, - InvoiceRandomizeAmountModule, - ], - declarations: EXPORTED_DECLARATIONS, - exports: EXPORTED_DECLARATIONS, - providers: [CreateInvoiceTemplateService], -}) -export class CreateInvoiceTemplateModule {} diff --git a/src/app/sections/payment-section/integrations/payment-link/create-invoice-template/create-invoice-template.service.ts b/src/app/sections/payment-section/integrations/payment-link/create-invoice-template/create-invoice-template.service.ts deleted file mode 100644 index 85cbf656d..000000000 --- a/src/app/sections/payment-section/integrations/payment-link/create-invoice-template/create-invoice-template.service.ts +++ /dev/null @@ -1,203 +0,0 @@ -import { Injectable } from '@angular/core'; -import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; -import { toMinor } from '@vality/matez'; -import { - InvoiceLineTaxMode, - InvoiceLineTaxVAT, - InvoiceTemplateAndToken, - InvoiceTemplateCreateParams, - InvoiceTemplateDetails, - InvoiceTemplateLineCost, - InvoiceTemplateLineCostFixed, - InvoiceTemplateLineCostRange, - InvoiceTemplateLineCostUnlim, - InvoiceTemplateMultiLine, - InvoiceTemplateSingleLine, - LifetimeInterval, - Shop, -} from '@vality/swag-payments'; -import moment from 'moment'; -import { Observable, Subject, merge } from 'rxjs'; -import { distinctUntilChanged, share, shareReplay, switchMap, take } from 'rxjs/operators'; - -import { - InvoiceTemplateLineCostType, - InvoiceTemplateType, - InvoiceTemplatesService, -} from '@dsh/app/api/payments'; -import { filterError, filterPayload, progress, replaceError } from '@dsh/app/custom-operators'; - -export const WITHOUT_VAT = Symbol('without VAT'); - -@Injectable() -export class CreateInvoiceTemplateService { - private nextInvoiceTemplate$ = new Subject(); - - invoiceTemplateAndToken$: Observable; - - errors$: Observable; - - isLoading$: Observable; - - nextInvoiceTemplateAndToken$: Observable; - - constructor( - private fb: UntypedFormBuilder, - private invoiceTemplatesService: InvoiceTemplatesService, - ) { - const createInvoiceTemplate$ = this.nextInvoiceTemplate$.pipe( - distinctUntilChanged((x, y) => JSON.stringify(x) === JSON.stringify(y)), - share(), - ); - const notCreatedInvoiceTemplate$ = this.nextInvoiceTemplate$.pipe( - distinctUntilChanged((x, y) => JSON.stringify(x) !== JSON.stringify(y)), - share(), - ); - const invoiceTemplateAndTokenWithErrors$ = createInvoiceTemplate$.pipe( - switchMap((invoiceTemplateCreateParams) => - this.invoiceTemplatesService - .createInvoiceTemplate({ invoiceTemplateCreateParams }) - .pipe(replaceError), - ), - share(), - ); - this.invoiceTemplateAndToken$ = invoiceTemplateAndTokenWithErrors$.pipe( - filterPayload, - shareReplay(1), - ); - this.errors$ = invoiceTemplateAndTokenWithErrors$.pipe(filterError, shareReplay(1)); - this.isLoading$ = progress(createInvoiceTemplate$, invoiceTemplateAndTokenWithErrors$).pipe( - shareReplay(1), - ); - - this.nextInvoiceTemplateAndToken$ = merge( - this.invoiceTemplateAndToken$, - notCreatedInvoiceTemplate$.pipe( - switchMap(() => this.invoiceTemplateAndToken$.pipe(take(1))), - ), - ).pipe(share()); - - merge( - this.invoiceTemplateAndToken$, - this.errors$, - this.isLoading$, - this.nextInvoiceTemplateAndToken$, - ).subscribe(); - } - - create(formValue, shops: Shop[]) { - this.nextInvoiceTemplate$.next(this.getInvoiceTemplateCreateParams(formValue, shops)); - } - - createForm(shops: Shop[]): UntypedFormGroup { - return this.fb.group({ - shopID: shops[0].id, - lifetime: moment().add('1', 'month').endOf('day'), - costType: InvoiceTemplateLineCostType.InvoiceTemplateLineCostFixed, - templateType: InvoiceTemplateType.InvoiceTemplateSingleLine, - product: '', - taxMode: WITHOUT_VAT, - cart: this.fb.array([this.createProductFormGroup()]), - range: this.fb.group({ - lowerBound: null, - upperBound: null, - }), - randomizeAmount: null, - amount: null, - }); - } - - private createProductFormGroup() { - return this.fb.group({ - product: '', - quantity: null, - price: null, - taxMode: WITHOUT_VAT, - }); - } - - private getInvoiceTemplateCreateParams(formValue, shops: Shop[]): InvoiceTemplateCreateParams { - return { - shopID: formValue.shopID, - lifetime: this.getLifetimeInterval(formValue), - details: this.getInvoiceTemplateDetails(formValue, shops), - randomizeAmount: formValue.randomizeAmount || undefined, - }; - } - - private getLifetimeInterval(formValue): LifetimeInterval { - const { lifetime } = formValue; - const diff = moment(lifetime).diff(moment().startOf('day')); - const duration = moment.duration(diff); - return { - days: duration.days(), - months: duration.months(), - years: duration.years(), - }; - } - - private getInvoiceTemplateDetails(formValue, shops: Shop[]): InvoiceTemplateDetails { - const { cart, shopID } = formValue; - const value = formValue; - const currency = this.getCurrencyByShopID(shopID, shops); - switch (value.templateType) { - case InvoiceTemplateType.InvoiceTemplateSingleLine: - return { - templateType: value.templateType, - product: value.product, - price: this.getInvoiceTemplateLineCost(formValue, shops), - ...this.getInvoiceLineTaxMode(value.taxMode), - } as InvoiceTemplateSingleLine; - case InvoiceTemplateType.InvoiceTemplateMultiLine: - return { - templateType: value.templateType, - cart: cart.map((c) => ({ - product: c.product, - quantity: c.quantity, - price: toMinor(c.price, c.currency), - ...this.getInvoiceLineTaxMode(c.taxMode), - })), - currency, - } as InvoiceTemplateMultiLine; - } - } - - private getInvoiceTemplateLineCost(formValue, shops: Shop[]): InvoiceTemplateLineCost { - const { costType, amount, range, shopID } = formValue; - const currency = this.getCurrencyByShopID(shopID, shops); - switch (costType) { - case InvoiceTemplateLineCostType.InvoiceTemplateLineCostUnlim: - return { costType } as InvoiceTemplateLineCostUnlim; - case InvoiceTemplateLineCostType.InvoiceTemplateLineCostFixed: - return { - costType, - currency, - amount: toMinor(amount, currency), - } as InvoiceTemplateLineCostFixed; - case InvoiceTemplateLineCostType.InvoiceTemplateLineCostRange: - return { - costType, - currency, - range: { - lowerBound: toMinor(range.lowerBound, currency), - upperBound: toMinor(range.upperBound, currency), - }, - } as InvoiceTemplateLineCostRange; - } - } - - private getInvoiceLineTaxMode(rate: typeof WITHOUT_VAT | InvoiceLineTaxVAT.RateEnum) { - return rate === WITHOUT_VAT - ? {} - : { - taxMode: { - type: InvoiceLineTaxMode.TypeEnum.InvoiceLineTaxVat, - rate, - }, - }; - } - - private getCurrencyByShopID(shopID: string, shops: Shop[]): string { - return shops.find((s) => s.id === shopID)?.currency; - } -} diff --git a/src/app/sections/payment-section/integrations/payment-link/create-invoice-template/index.ts b/src/app/sections/payment-section/integrations/payment-link/create-invoice-template/index.ts deleted file mode 100644 index 89b1af591..000000000 --- a/src/app/sections/payment-section/integrations/payment-link/create-invoice-template/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './create-invoice-template.component'; -export * from './create-invoice-template.module'; diff --git a/src/app/sections/payment-section/integrations/payment-link/index.ts b/src/app/sections/payment-section/integrations/payment-link/index.ts deleted file mode 100644 index 84788318c..000000000 --- a/src/app/sections/payment-section/integrations/payment-link/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './payment-link.component'; -export * from './payment-link.module'; diff --git a/src/app/sections/payment-section/integrations/payment-link/payment-link-routing.module.ts b/src/app/sections/payment-section/integrations/payment-link/payment-link-routing.module.ts deleted file mode 100644 index 1f8013b8f..000000000 --- a/src/app/sections/payment-section/integrations/payment-link/payment-link-routing.module.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { NgModule } from '@angular/core'; -import { RouterModule, Routes } from '@angular/router'; - -import { PaymentLinkComponent } from './payment-link.component'; - -const ROUTES: Routes = [ - { - path: '', - component: PaymentLinkComponent, - }, -]; - -@NgModule({ - imports: [RouterModule.forChild(ROUTES)], -}) -export class PaymentLinkRoutingModule {} diff --git a/src/app/sections/payment-section/integrations/payment-link/payment-link.component.html b/src/app/sections/payment-section/integrations/payment-link/payment-link.component.html deleted file mode 100644 index f8386e368..000000000 --- a/src/app/sections/payment-section/integrations/payment-link/payment-link.component.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - -
{{ t('noAvailableShops') }}
-
-
- -

- {{ t('title') }} -

-
- - - - - - - - - - - -
-
-
-
diff --git a/src/app/sections/payment-section/integrations/payment-link/payment-link.component.scss b/src/app/sections/payment-section/integrations/payment-link/payment-link.component.scss deleted file mode 100644 index 658f7ee0a..000000000 --- a/src/app/sections/payment-section/integrations/payment-link/payment-link.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -:host { - width: 100%; -} diff --git a/src/app/sections/payment-section/integrations/payment-link/payment-link.component.ts b/src/app/sections/payment-section/integrations/payment-link/payment-link.component.ts deleted file mode 100644 index c156e6c3e..000000000 --- a/src/app/sections/payment-section/integrations/payment-link/payment-link.component.ts +++ /dev/null @@ -1,109 +0,0 @@ -import { Component } from '@angular/core'; -import { FormControl } from '@angular/forms'; -import { ActivatedRoute } from '@angular/router'; -import { TranslocoService } from '@jsverse/transloco'; -import { NotifyLogService } from '@vality/matez'; -import { PaymentMethod } from '@vality/swag-payments'; -import { BehaviorSubject, EMPTY, ReplaySubject, Subject, Subscription, defer, merge } from 'rxjs'; -import { catchError, map, mapTo, shareReplay, switchMap } from 'rxjs/operators'; - -import { InvoiceTemplatesService, InvoicesService } from '@dsh/app/api/payments'; -import { ShopsDataService } from '@dsh/app/shared'; -import { CreatePaymentLinkService } from '@dsh/app/shared/services/create-payment-link'; -import { progressTo } from '@dsh/utils'; - -import { filterShopsByRealm } from '../../operations/operators'; - -import { InvoiceOrInvoiceTemplate, Type } from './create-invoice-or-invoice-template'; - -enum Step { - InvoiceTemplate, - PaymentLink, -} - -@Component({ - selector: 'dsh-payment-link', - templateUrl: 'payment-link.component.html', - styleUrls: ['payment-link.component.scss'], - standalone: false, -}) -export class PaymentLinkComponent { - step = Step; - currentStep$ = new BehaviorSubject(Step.InvoiceTemplate); - invoiceOrInvoiceTemplate: InvoiceOrInvoiceTemplate; - - paymentMethods$ = new ReplaySubject(1); - formControl = new FormControl(); - paymentLink$ = merge( - defer(() => this.create$).pipe( - switchMap(() => - (this.invoiceOrInvoiceTemplate.type === Type.Invoice - ? this.createPaymentLinkService.createPaymentLinkByInvoice( - this.invoiceOrInvoiceTemplate.invoiceOrInvoiceTemplate, - this.formControl.value, - ) - : this.createPaymentLinkService.createPaymentLinkByTemplate( - this.invoiceOrInvoiceTemplate.invoiceOrInvoiceTemplate, - this.formControl.value, - ) - ).pipe( - progressTo(() => this.progress$), - catchError((err) => { - this.log.error( - err, - this.transloco.selectTranslate( - 'paymentLink.errors.createPaymentLinkError', - null, - 'payment-section', - ), - ); - return EMPTY; - }), - ), - ), - ), - this.formControl.valueChanges.pipe(mapTo('')), - ).pipe(shareReplay(1)); - progress$ = new BehaviorSubject(0); - - shops$ = this.route.params.pipe( - map((params) => params?.realm), - filterShopsByRealm(this.shopsDataService.shops$), - shareReplay({ refCount: true, bufferSize: 1 }), - ); - - private create$ = new Subject(); - - constructor( - private invoicesService: InvoicesService, - private invoiceTemplatesService: InvoiceTemplatesService, - private createPaymentLinkService: CreatePaymentLinkService, - private log: NotifyLogService, - private transloco: TranslocoService, - private route: ActivatedRoute, - private shopsDataService: ShopsDataService, - ) {} - - nextInvoiceOrInvoiceTemplate(invoiceOrInvoiceTemplate: InvoiceOrInvoiceTemplate): Subscription { - return ( - invoiceOrInvoiceTemplate.type === Type.Invoice - ? this.invoicesService.getInvoicePaymentMethods({ - invoiceID: invoiceOrInvoiceTemplate.invoiceOrInvoiceTemplate.id, - }) - : this.invoiceTemplatesService.getInvoicePaymentMethodsByTemplateID({ - invoiceTemplateID: - invoiceOrInvoiceTemplate.invoiceOrInvoiceTemplate.invoiceTemplate.id, - }) - ) - .pipe(progressTo(this.progress$)) - .subscribe((paymentMethods) => { - this.paymentMethods$.next(paymentMethods); - this.currentStep$.next(Step.PaymentLink); - this.invoiceOrInvoiceTemplate = invoiceOrInvoiceTemplate; - }); - } - - create(): void { - this.create$.next(); - } -} diff --git a/src/app/sections/payment-section/integrations/payment-link/payment-link.module.ts b/src/app/sections/payment-section/integrations/payment-link/payment-link.module.ts deleted file mode 100644 index e4bb22883..000000000 --- a/src/app/sections/payment-section/integrations/payment-link/payment-link.module.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatButtonModule } from '@angular/material/button'; -import { MatCheckboxModule } from '@angular/material/checkbox'; -import { MatDialogModule } from '@angular/material/dialog'; -import { MatDividerModule } from '@angular/material/divider'; -import { MatInputModule } from '@angular/material/input'; -import { MatRadioModule } from '@angular/material/radio'; -import { MatSelectModule } from '@angular/material/select'; -import { TranslocoModule } from '@jsverse/transloco'; -import { FlexLayoutModule } from 'ng-flex-layout'; - -import { ActionsModule } from '@dsh/app/shared/components/actions'; -import { CreateInvoiceFormModule } from '@dsh/app/shared/components/create-invoice-form'; -import { CreatePaymentLinkFormModule } from '@dsh/app/shared/components/create-payment-link-form'; -import { CreatePaymentLinkModule } from '@dsh/app/shared/services/create-payment-link'; -import { LayoutModule } from '@dsh/components/layout'; -import { ConfirmActionDialogModule } from '@dsh/components/popups'; - -import { CreateInvoiceOrInvoiceTemplateComponent } from './create-invoice-or-invoice-template'; -import { CreateInvoiceTemplateModule } from './create-invoice-template'; -import { PaymentLinkRoutingModule } from './payment-link-routing.module'; -import { PaymentLinkComponent } from './payment-link.component'; - -@NgModule({ - imports: [ - PaymentLinkRoutingModule, - LayoutModule, - TranslocoModule, - FlexLayoutModule, - ReactiveFormsModule, - CommonModule, - MatInputModule, - MatRadioModule, - MatButtonModule, - MatSelectModule, - MatCheckboxModule, - MatDividerModule, - ConfirmActionDialogModule, - MatDialogModule, - CreatePaymentLinkFormModule, - CreateInvoiceTemplateModule, - CreateInvoiceFormModule, - CreatePaymentLinkModule, - ActionsModule, - ], - declarations: [PaymentLinkComponent, CreateInvoiceOrInvoiceTemplateComponent], - exports: [PaymentLinkComponent], -}) -export class PaymentLinkModule {} diff --git a/src/app/sections/payment-section/integrations/webhooks/create-webhook/create-webhook-form/create-webhook-form.component.html b/src/app/sections/payment-section/integrations/webhooks/create-webhook/create-webhook-form/create-webhook-form.component.html index b9ae2adb7..0f73ab056 100644 --- a/src/app/sections/payment-section/integrations/webhooks/create-webhook/create-webhook-form/create-webhook-form.component.html +++ b/src/app/sections/payment-section/integrations/webhooks/create-webhook/create-webhook-form/create-webhook-form.component.html @@ -40,18 +40,20 @@ >{{ t('createWebhook.eventTypes.customers') }} - -
-
{{ t('createWebhook.events') }}
-
{{ t('createWebhook.types') }}
-
-
-
- {{ - (eventType$ | async)?.[eventType.controls.eventName.value] - }} + @if (eventTypes.controls?.length) { + +
+
{{ t('createWebhook.events') }}
+
{{ t('createWebhook.types') }}
-
+
+
+ {{ + (eventType$ | async)?.[eventType.controls.eventName.value] + }} +
+
+ } diff --git a/src/app/sections/payment-section/integrations/webhooks/create-webhook/create-webhook-form/create-webhook-form.component.ts b/src/app/sections/payment-section/integrations/webhooks/create-webhook/create-webhook-form/create-webhook-form.component.ts index f21c2cbbe..54d314b85 100644 --- a/src/app/sections/payment-section/integrations/webhooks/create-webhook/create-webhook-form/create-webhook-form.component.ts +++ b/src/app/sections/payment-section/integrations/webhooks/create-webhook/create-webhook-form/create-webhook-form.component.ts @@ -1,8 +1,7 @@ import { Component, Input, OnInit } from '@angular/core'; import { UntypedFormArray, UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; import { WebhookScope } from '@vality/swag-payments'; -import { BehaviorSubject, combineLatest } from 'rxjs'; -import { map } from 'rxjs/operators'; +import { BehaviorSubject } from 'rxjs'; import { PaymentsDictionaryService } from '@dsh/app/api/payments'; import { ShopsDataService } from '@dsh/app/shared'; @@ -25,10 +24,7 @@ export class CreateWebhookFormComponent implements OnInit { activeTopic$ = new BehaviorSubject('InvoicesTopic'); - eventType$ = combineLatest([ - this.paymentsDictionaryService.invoicesTopicEventType$, - this.paymentsDictionaryService.customersTopicEventType$, - ]).pipe(map(([i, c]) => ({ ...i, ...c }))); + eventType$ = this.paymentsDictionaryService.invoicesTopicEventType$; constructor( private shopsDataService: ShopsDataService, @@ -42,7 +38,7 @@ export class CreateWebhookFormComponent implements OnInit { this.form.addControl( 'eventTypes', this.fb.array( - getEventsByTopic(activeTopic).map((eventName) => + (getEventsByTopic(activeTopic) || []).map((eventName) => this.fb.group({ eventName, selected: false, diff --git a/src/app/sections/payment-section/integrations/webhooks/create-webhook/form-params.ts b/src/app/sections/payment-section/integrations/webhooks/create-webhook/form-params.ts index 8f9cedd2c..d4bfae77d 100644 --- a/src/app/sections/payment-section/integrations/webhooks/create-webhook/form-params.ts +++ b/src/app/sections/payment-section/integrations/webhooks/create-webhook/form-params.ts @@ -1,9 +1,9 @@ -import { CustomersTopic, InvoicesTopic, WebhookScope } from '@vality/swag-payments'; +import { InvoicesTopic, WebhookScope } from '@vality/swag-payments'; import TopicEnum = WebhookScope.TopicEnum; interface EventType { - eventName: InvoicesTopic.EventTypesEnum | CustomersTopic.EventTypesEnum; + eventName: InvoicesTopic.EventTypesEnum; selected: boolean; } diff --git a/src/app/sections/payment-section/integrations/webhooks/create-webhook/get-events-by-topic.ts b/src/app/sections/payment-section/integrations/webhooks/create-webhook/get-events-by-topic.ts index e87461db2..db82d742d 100644 --- a/src/app/sections/payment-section/integrations/webhooks/create-webhook/get-events-by-topic.ts +++ b/src/app/sections/payment-section/integrations/webhooks/create-webhook/get-events-by-topic.ts @@ -1,4 +1,4 @@ -import { CustomersTopic, InvoicesTopic, WebhookScope } from '@vality/swag-payments'; +import { InvoicesTopic, WebhookScope } from '@vality/swag-payments'; import TopicEnum = WebhookScope.TopicEnum; @@ -6,7 +6,5 @@ export const getEventsByTopic = (topic: TopicEnum): string[] => { switch (topic) { case 'InvoicesTopic': return Object.values(InvoicesTopic.EventTypesEnum); - case 'CustomersTopic': - return Object.values(CustomersTopic.EventTypesEnum); } }; diff --git a/src/app/sections/payment-section/integrations/webhooks/get-shop-id-from-scope.ts b/src/app/sections/payment-section/integrations/webhooks/get-shop-id-from-scope.ts index 72a7923c5..8de168598 100644 --- a/src/app/sections/payment-section/integrations/webhooks/get-shop-id-from-scope.ts +++ b/src/app/sections/payment-section/integrations/webhooks/get-shop-id-from-scope.ts @@ -1,4 +1,4 @@ -import { CustomersTopic, InvoicesTopic, WebhookScope } from '@vality/swag-payments'; +import { InvoicesTopic, WebhookScope } from '@vality/swag-payments'; export const getShopIdFromScope = (scope: WebhookScope): string | null => - (scope as InvoicesTopic).shopID || (scope as CustomersTopic).shopID; + (scope as InvoicesTopic)?.shopID; diff --git a/src/app/sections/payment-section/integrations/webhooks/webhook-details/webhook-events/webhook-events.component.ts b/src/app/sections/payment-section/integrations/webhooks/webhook-details/webhook-events/webhook-events.component.ts index 95e3a02f1..59851b5a1 100644 --- a/src/app/sections/payment-section/integrations/webhooks/webhook-details/webhook-events/webhook-events.component.ts +++ b/src/app/sections/payment-section/integrations/webhooks/webhook-details/webhook-events/webhook-events.component.ts @@ -1,7 +1,6 @@ import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; -import { CustomersTopic, InvoicesTopic, WebhookScope } from '@vality/swag-payments'; +import { InvoicesTopic, WebhookScope } from '@vality/swag-payments'; import { combineLatest } from 'rxjs'; -import { map } from 'rxjs/operators'; import { PaymentsDictionaryService } from '@dsh/app/api/payments'; @@ -16,17 +15,12 @@ export class WebhookEventsComponent { @Input() scope: WebhookScope; - eventType$ = combineLatest([ - this.paymentsDictionaryService.invoicesTopicEventType$, - this.paymentsDictionaryService.customersTopicEventType$, - ]).pipe(map(([i, c]) => ({ ...i, ...c }))); + eventType$ = combineLatest([this.paymentsDictionaryService.invoicesTopicEventType$]); - get events(): InvoicesTopic.EventTypesEnum[] | CustomersTopic.EventTypesEnum[] { + get events(): InvoicesTopic.EventTypesEnum[] { switch (this.scope.topic) { case 'InvoicesTopic': return (this.scope as unknown as InvoicesTopic).eventTypes; - case 'CustomersTopic': - return (this.scope as unknown as CustomersTopic).eventTypes; } } diff --git a/src/app/sections/payment-section/operations/invoices/invoices-list/invoice-details/components/invoice-actions/invoice-actions.component.html b/src/app/sections/payment-section/operations/invoices/invoices-list/invoice-details/components/invoice-actions/invoice-actions.component.html index 916311577..6529e4f80 100644 --- a/src/app/sections/payment-section/operations/invoices/invoices-list/invoice-details/components/invoice-actions/invoice-actions.component.html +++ b/src/app/sections/payment-section/operations/invoices/invoices-list/invoice-details/components/invoice-actions/invoice-actions.component.html @@ -8,13 +8,6 @@
- diff --git a/src/app/sections/payment-section/operations/invoices/invoices-list/invoice-details/components/invoice-actions/invoice-actions.component.ts b/src/app/sections/payment-section/operations/invoices/invoices-list/invoice-details/components/invoice-actions/invoice-actions.component.ts index 8e4053149..fdb35c88c 100644 --- a/src/app/sections/payment-section/operations/invoices/invoices-list/invoice-details/components/invoice-actions/invoice-actions.component.ts +++ b/src/app/sections/payment-section/operations/invoices/invoices-list/invoice-details/components/invoice-actions/invoice-actions.component.ts @@ -3,22 +3,13 @@ import { Component, DestroyRef, EventEmitter, - Inject, Input, Output, } from '@angular/core'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; -import { MatDialog } from '@angular/material/dialog'; import { Invoice } from '@vality/swag-payments'; -import { DIALOG_CONFIG, DialogConfig } from '@dsh/app/sections/tokens'; - import { CancelInvoiceService } from '../../cancel-invoice'; -import { - CreatePaymentLinkDialogComponent, - CreatePaymentLinkDialogData, - CreatePaymentLinkDialogResponse, -} from '../../create-payment-link-dialog'; import { FulfillInvoiceService } from '../../fulfill-invoice'; @Component({ @@ -35,22 +26,9 @@ export class InvoiceActionsComponent { constructor( private fulfillInvoiceService: FulfillInvoiceService, private cancelInvoiceService: CancelInvoiceService, - private dialog: MatDialog, - @Inject(DIALOG_CONFIG) private dialogConfig: DialogConfig, private dr: DestroyRef, ) {} - createPaymentLink(): void { - this.dialog.open< - CreatePaymentLinkDialogComponent, - CreatePaymentLinkDialogData, - CreatePaymentLinkDialogResponse - >(CreatePaymentLinkDialogComponent, { - ...this.dialogConfig.large, - data: { invoice: this.invoice }, - }); - } - cancelInvoice(): void { this.cancelInvoiceService .cancelInvoice(this.invoice.id) diff --git a/src/app/sections/payment-section/operations/invoices/invoices-list/invoice-details/create-payment-link-dialog/create-payment-link-dialog.component.html b/src/app/sections/payment-section/operations/invoices/invoices-list/invoice-details/create-payment-link-dialog/create-payment-link-dialog.component.html deleted file mode 100644 index b796c3a70..000000000 --- a/src/app/sections/payment-section/operations/invoices/invoices-list/invoice-details/create-payment-link-dialog/create-payment-link-dialog.component.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - diff --git a/src/app/sections/payment-section/operations/invoices/invoices-list/invoice-details/create-payment-link-dialog/create-payment-link-dialog.component.ts b/src/app/sections/payment-section/operations/invoices/invoices-list/invoice-details/create-payment-link-dialog/create-payment-link-dialog.component.ts deleted file mode 100644 index ddbf13bc8..000000000 --- a/src/app/sections/payment-section/operations/invoices/invoices-list/invoice-details/create-payment-link-dialog/create-payment-link-dialog.component.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { ChangeDetectionStrategy, Component, Inject } from '@angular/core'; -import { FormControl } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; -import { BehaviorSubject, Subject, defer, merge } from 'rxjs'; -import { mapTo, shareReplay, switchMap } from 'rxjs/operators'; - -import { InvoicesService } from '@dsh/app/api/payments'; -import { CreatePaymentLinkService } from '@dsh/app/shared/services/create-payment-link/create-payment-link.service'; - -import { CreatePaymentLinkDialogData } from './types/create-payment-link-dialog-data'; - -@Component({ - selector: 'dsh-create-payment-link-dialog', - templateUrl: 'create-payment-link-dialog.component.html', - changeDetection: ChangeDetectionStrategy.OnPush, - standalone: false, -}) -export class CreatePaymentLinkDialogComponent { - paymentMethods$ = this.invoicesService - .getInvoicePaymentMethods({ invoiceID: this.data.invoice.id }) - .pipe(shareReplay({ refCount: true, bufferSize: 1 })); - - formControl = new FormControl(); - paymentLink$ = merge( - defer(() => this.create$).pipe( - switchMap(() => - this.createPaymentLinkService.createPaymentLinkByInvoice( - this.data.invoice, - this.formControl.value, - ), - ), - ), - this.formControl.valueChanges.pipe(mapTo('')), - ); - inProgress$ = new BehaviorSubject(false); - - private create$ = new Subject(); - - constructor( - private dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: CreatePaymentLinkDialogData, - private createPaymentLinkService: CreatePaymentLinkService, - private invoicesService: InvoicesService, - ) {} - - cancel(): void { - this.dialogRef.close('cancel'); - } - - create(): void { - this.create$.next(); - } -} diff --git a/src/app/sections/payment-section/operations/invoices/invoices-list/invoice-details/create-payment-link-dialog/create-payment-link-dialog.module.ts b/src/app/sections/payment-section/operations/invoices/invoices-list/invoice-details/create-payment-link-dialog/create-payment-link-dialog.module.ts deleted file mode 100644 index 3b58c2e55..000000000 --- a/src/app/sections/payment-section/operations/invoices/invoices-list/invoice-details/create-payment-link-dialog/create-payment-link-dialog.module.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatButtonModule } from '@angular/material/button'; -import { TranslocoModule } from '@jsverse/transloco'; - -import { CreatePaymentLinkFormModule } from '@dsh/app/shared/components/create-payment-link-form'; -import { DialogModule } from '@dsh/app/shared/components/dialog'; -import { CreatePaymentLinkModule } from '@dsh/app/shared/services/create-payment-link'; - -import { CreatePaymentLinkDialogComponent } from './create-payment-link-dialog.component'; - -@NgModule({ - imports: [ - CommonModule, - TranslocoModule, - CreatePaymentLinkFormModule, - DialogModule, - MatButtonModule, - ReactiveFormsModule, - CreatePaymentLinkModule, - ], - declarations: [CreatePaymentLinkDialogComponent], - exports: [CreatePaymentLinkDialogComponent], -}) -export class CreatePaymentLinkDialogModule {} diff --git a/src/app/sections/payment-section/operations/invoices/invoices-list/invoice-details/create-payment-link-dialog/index.ts b/src/app/sections/payment-section/operations/invoices/invoices-list/invoice-details/create-payment-link-dialog/index.ts deleted file mode 100644 index ec4d106e5..000000000 --- a/src/app/sections/payment-section/operations/invoices/invoices-list/invoice-details/create-payment-link-dialog/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './create-payment-link-dialog.module'; -export * from './create-payment-link-dialog.component'; -export * from './types/create-payment-link-dialog-data'; -export * from './types/create-payment-link-dialog-response'; diff --git a/src/app/sections/payment-section/operations/invoices/invoices-list/invoice-details/create-payment-link-dialog/types/create-payment-link-dialog-data.ts b/src/app/sections/payment-section/operations/invoices/invoices-list/invoice-details/create-payment-link-dialog/types/create-payment-link-dialog-data.ts deleted file mode 100644 index e18a8bb45..000000000 --- a/src/app/sections/payment-section/operations/invoices/invoices-list/invoice-details/create-payment-link-dialog/types/create-payment-link-dialog-data.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { Invoice } from '@vality/swag-payments'; - -export interface CreatePaymentLinkDialogData { - invoice: Invoice; -} diff --git a/src/app/sections/payment-section/operations/invoices/invoices-list/invoice-details/create-payment-link-dialog/types/create-payment-link-dialog-response.ts b/src/app/sections/payment-section/operations/invoices/invoices-list/invoice-details/create-payment-link-dialog/types/create-payment-link-dialog-response.ts deleted file mode 100644 index a9fe84c21..000000000 --- a/src/app/sections/payment-section/operations/invoices/invoices-list/invoice-details/create-payment-link-dialog/types/create-payment-link-dialog-response.ts +++ /dev/null @@ -1 +0,0 @@ -export type CreatePaymentLinkDialogResponse = 'create' | 'cancel'; diff --git a/src/app/sections/payment-section/operations/invoices/invoices-list/invoice-details/invoice-details.module.ts b/src/app/sections/payment-section/operations/invoices/invoices-list/invoice-details/invoice-details.module.ts index dbf1c2e41..63d7d8ef5 100644 --- a/src/app/sections/payment-section/operations/invoices/invoices-list/invoice-details/invoice-details.module.ts +++ b/src/app/sections/payment-section/operations/invoices/invoices-list/invoice-details/invoice-details.module.ts @@ -24,7 +24,6 @@ import { InvoiceCartLineComponent } from './components/invoice-cart-info/cart-in import { InvoiceCartInfoComponent } from './components/invoice-cart-info/invoice-cart-info.component'; import { InvoiceMainInfoComponent } from './components/invoice-main-info/invoice-main-info.component'; import { InvoicePaymentsComponent } from './components/invoice-payments/invoice-payments.component'; -import { CreatePaymentLinkDialogModule } from './create-payment-link-dialog'; import { FulfillInvoiceModule } from './fulfill-invoice'; import { InvoiceDetailsComponent } from './invoice-details.component'; import { TaxModeToTaxRatePipe } from './pipes/tax-mode-to-tax-rate/tax-mode-to-tax-rate.pipe'; @@ -43,8 +42,6 @@ import { TaxModeToTaxRatePipe } from './pipes/tax-mode-to-tax-rate/tax-mode-to-t ApiRefundDetailsModule, PaymentDetailsModule, InvoiceInvoiceDetailsModule, - - CreatePaymentLinkDialogModule, CancelInvoiceModule, FulfillInvoiceModule, RouterModule, diff --git a/src/app/sections/payment-section/operations/payments/payments-panels/payments-details/refunds/refunds-list/refunds-list.component.ts b/src/app/sections/payment-section/operations/payments/payments-panels/payments-details/refunds/refunds-list/refunds-list.component.ts index 83db57df5..162691250 100644 --- a/src/app/sections/payment-section/operations/payments/payments-panels/payments-details/refunds/refunds-list/refunds-list.component.ts +++ b/src/app/sections/payment-section/operations/payments/payments-panels/payments-details/refunds/refunds-list/refunds-list.component.ts @@ -1,5 +1,5 @@ import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; -import { RefundSearchResult } from '@vality/swag-payments'; +import { Refund } from '@vality/swag-payments'; import isEmpty from 'lodash-es/isEmpty'; @Component({ @@ -10,7 +10,7 @@ import isEmpty from 'lodash-es/isEmpty'; standalone: false, }) export class RefundsListComponent { - @Input() list: RefundSearchResult[]; + @Input() list: Refund[]; @Input() loading: boolean; @Input() hasMore: boolean; diff --git a/src/app/sections/payment-section/operations/refunds/refunds-expanded-id-manager.service.ts b/src/app/sections/payment-section/operations/refunds/refunds-expanded-id-manager.service.ts index f198a172b..8b8b05681 100644 --- a/src/app/sections/payment-section/operations/refunds/refunds-expanded-id-manager.service.ts +++ b/src/app/sections/payment-section/operations/refunds/refunds-expanded-id-manager.service.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; -import { RefundSearchResult } from '@vality/swag-payments'; +import { Refund } from '@vality/swag-payments'; import { Observable } from 'rxjs'; import { ExpandedIdManager, Fragment } from '@dsh/app/shared/services'; @@ -8,7 +8,7 @@ import { ExpandedIdManager, Fragment } from '@dsh/app/shared/services'; import { FetchRefundsService } from './services/fetch-refunds/fetch-refunds.service'; @Injectable() -export class RefundsExpandedIdManager extends ExpandedIdManager { +export class RefundsExpandedIdManager extends ExpandedIdManager { constructor( protected route: ActivatedRoute, protected router: Router, @@ -17,11 +17,11 @@ export class RefundsExpandedIdManager extends ExpandedIdManager { + protected get dataSet$(): Observable { return this.fetchRefundsService.searchResult$; } } diff --git a/src/app/sections/payment-section/operations/refunds/refunds-list/refund-details/services/receive-payment/receive-payment.service.ts b/src/app/sections/payment-section/operations/refunds/refunds-list/refund-details/services/receive-payment/receive-payment.service.ts index b6b938bb6..d3e627107 100644 --- a/src/app/sections/payment-section/operations/refunds/refunds-list/refund-details/services/receive-payment/receive-payment.service.ts +++ b/src/app/sections/payment-section/operations/refunds/refunds-list/refund-details/services/receive-payment/receive-payment.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; -import { PaymentSearchResult } from '@vality/swag-payments'; +import { Payment } from '@vality/swag-payments'; import { BehaviorSubject, Observable, ReplaySubject, Subject, of } from 'rxjs'; -import { catchError, filter, map, switchMap, tap } from 'rxjs/operators'; +import { catchError, filter, switchMap, tap } from 'rxjs/operators'; import { PaymentsService } from '@dsh/app/api/payments'; @@ -14,12 +14,12 @@ export interface ReceivePaymentParams { export class ReceivePaymentService { isLoading$: Observable; errorOccurred$: Observable; - payment$: Observable; + payment$: Observable; private receivePayment$ = new Subject(); private loading$ = new BehaviorSubject(false); private error$ = new Subject(); - private receivedPayment$ = new ReplaySubject(); + private receivedPayment$ = new ReplaySubject(); constructor(private paymentsService: PaymentsService) { this.isLoading$ = this.loading$.asObservable(); @@ -39,9 +39,8 @@ export class ReceivePaymentService { ), ), filter((result) => result !== 'error'), - map((r) => r as PaymentSearchResult), ) - .subscribe((payment: PaymentSearchResult) => { + .subscribe((payment: Payment) => { this.loading$.next(false); this.receivedPayment$.next(payment); }); diff --git a/src/app/sections/payment-section/operations/refunds/refunds-list/refunds-list.component.ts b/src/app/sections/payment-section/operations/refunds/refunds-list/refunds-list.component.ts index 3ffbcecd8..6511831d9 100644 --- a/src/app/sections/payment-section/operations/refunds/refunds-list/refunds-list.component.ts +++ b/src/app/sections/payment-section/operations/refunds/refunds-list/refunds-list.component.ts @@ -1,5 +1,5 @@ import { Component, EventEmitter, Input, Output } from '@angular/core'; -import { RefundSearchResult } from '@vality/swag-anapi-v2'; +import { Refund } from '@vality/swag-anapi-v2'; @Component({ selector: 'dsh-refunds-list', @@ -7,7 +7,7 @@ import { RefundSearchResult } from '@vality/swag-anapi-v2'; standalone: false, }) export class RefundsListComponent { - @Input() refunds: RefundSearchResult[]; + @Input() refunds: Refund[]; @Input() expandedId: number; @Input() lastUpdated: string; @Output() expandedIdChange = new EventEmitter(); diff --git a/src/app/sections/payment-section/operations/refunds/types/search-filters-params.ts b/src/app/sections/payment-section/operations/refunds/types/search-filters-params.ts index ce0a1fbd7..7e7a84263 100644 --- a/src/app/sections/payment-section/operations/refunds/types/search-filters-params.ts +++ b/src/app/sections/payment-section/operations/refunds/types/search-filters-params.ts @@ -1,4 +1,4 @@ -import { PaymentInstitution, RefundSearchResult } from '@vality/swag-payments'; +import { PaymentInstitution, Refund } from '@vality/swag-payments'; import RealmEnum = PaymentInstitution.RealmEnum; @@ -8,5 +8,5 @@ export interface SearchFiltersParams { toTime: string; invoiceIDs?: string[]; shopIDs?: string[]; - refundStatus?: RefundSearchResult.StatusEnum; + refundStatus?: Refund.StatusEnum; } diff --git a/src/app/sections/payment-section/payment-section-routing.module.ts b/src/app/sections/payment-section/payment-section-routing.module.ts index 31c4aa39a..2439a46c9 100644 --- a/src/app/sections/payment-section/payment-section-routing.module.ts +++ b/src/app/sections/payment-section/payment-section-routing.module.ts @@ -51,13 +51,6 @@ const PAYMENT_SECTION_ROUTES: Routes = [ }, [RoleAccessName.Reports], ), - // createPrivateRoute( - // { - // path: 'payouts', - // loadChildren: () => import('./payouts/payouts.module').then((m) => m.PayoutsModule), - // }, - // [RoleAccessName.ViewPayouts] - // ), createPrivateRoute( { path: 'integrations', @@ -66,7 +59,7 @@ const PAYMENT_SECTION_ROUTES: Routes = [ (m) => m.IntegrationsModule, ), }, - [RoleAccessName.PaymentLinks, RoleAccessName.ApiKeys, RoleAccessName.Webhooks], + [RoleAccessName.ApiKeys, RoleAccessName.Webhooks], ), ], }, diff --git a/src/app/sections/payment-section/payment-section.component.html b/src/app/sections/payment-section/payment-section.component.html index f05f6b521..aeba14c5a 100644 --- a/src/app/sections/payment-section/payment-section.component.html +++ b/src/app/sections/payment-section/payment-section.component.html @@ -15,18 +15,20 @@ {{ item.label }} - {{ t('testEnv') }} + @if ((hasTestShops$ | async) || (isTestRealm$ | async) || isDev) { + {{ t('testEnv') }} + }
diff --git a/src/app/sections/payment-section/payment-section.component.ts b/src/app/sections/payment-section/payment-section.component.ts index c08413fa0..581e74e3a 100644 --- a/src/app/sections/payment-section/payment-section.component.ts +++ b/src/app/sections/payment-section/payment-section.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component, DestroyRef, OnInit } from '@angular/core'; +import { ChangeDetectionStrategy, Component, DestroyRef, OnInit, isDevMode } from '@angular/core'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { ActivatedRoute, Router } from '@angular/router'; import { TranslocoService } from '@jsverse/transloco'; @@ -34,6 +34,8 @@ export class PaymentSectionComponent implements OnInit { .pipe(map(() => toNavbarItemConfig(this.getNavbarItemLabels()))); activeSection$ = defer(() => this.activeSectionChange$).pipe(map((s) => s.label)); noShops$: Observable = this.realmShopsService.shops$.pipe(map((s) => s.length === 0)); + hasTestShops$ = this.realmShopsService.hasTestShops$; + isDev = isDevMode(); private activeSectionChange$ = new ReplaySubject(); private realmChange$ = new Subject(); diff --git a/src/app/sections/payment-section/services/realm-shops.service.ts b/src/app/sections/payment-section/services/realm-shops.service.ts index db07681c1..600a76a50 100644 --- a/src/app/sections/payment-section/services/realm-shops.service.ts +++ b/src/app/sections/payment-section/services/realm-shops.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; -import { Shop } from '@vality/swag-payments'; -import { Observable, combineLatest } from 'rxjs'; -import { map, shareReplay } from 'rxjs/operators'; +import { PaymentInstitution, Shop } from '@vality/swag-payments'; +import { Observable } from 'rxjs'; +import { map, shareReplay, switchMap } from 'rxjs/operators'; import { ShopsDataService } from '@dsh/app/shared'; @@ -11,11 +11,12 @@ import { PaymentInstitutionRealmService } from './payment-institution-realm.serv @Injectable() export class RealmShopsService { - shops$: Observable = combineLatest([ - this.shopsDataService.shops$, - this.realmService.realm$, - ]).pipe( - map(([shops, realm]) => (realm ? getShopsByRealm(shops, realm) : [])), + shops$: Observable = this.realmService.realm$.pipe( + switchMap((realm) => this.getShopsByRealm(realm)), + shareReplay({ refCount: true, bufferSize: 1 }), + ); + hasTestShops$ = this.getShopsByRealm(PaymentInstitution.RealmEnum.Test).pipe( + map((shops) => !!shops?.length), shareReplay({ refCount: true, bufferSize: 1 }), ); @@ -27,4 +28,10 @@ export class RealmShopsService { reloadShops(): void { this.shopsDataService.reloadShops(); } + + getShopsByRealm(realm: PaymentInstitution.RealmEnum) { + return this.shopsDataService.shops$.pipe( + map((shops) => (realm ? getShopsByRealm(shops, realm) : [])), + ); + } } diff --git a/src/app/sections/payment-section/shops/shops-list/shop-details/components/shop-actions/shop-actions.component.html b/src/app/sections/payment-section/shops/shops-list/shop-details/components/shop-actions/shop-actions.component.html deleted file mode 100644 index 86006b553..000000000 --- a/src/app/sections/payment-section/shops/shops-list/shop-details/components/shop-actions/shop-actions.component.html +++ /dev/null @@ -1,25 +0,0 @@ -
- -
{{ p('actions') }}
-
- -
-
- - - - - - - - -
diff --git a/src/app/sections/payment-section/shops/shops-list/shop-details/components/shop-actions/shop-actions.component.ts b/src/app/sections/payment-section/shops/shops-list/shop-details/components/shop-actions/shop-actions.component.ts deleted file mode 100644 index 14465354f..000000000 --- a/src/app/sections/payment-section/shops/shops-list/shop-details/components/shop-actions/shop-actions.component.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; -import { filter, take } from 'rxjs/operators'; - -import { ShopItem } from '../../../../types/shop-item'; -import { isSuccessfulShopAction } from '../../services/shop-actions/is-successful-shop-action'; -import { ShopActionsService } from '../../services/shop-actions/shop-actions.service'; - -@Component({ - selector: 'dsh-shop-actions', - templateUrl: 'shop-actions.component.html', - changeDetection: ChangeDetectionStrategy.OnPush, - providers: [ShopActionsService], - standalone: false, -}) -export class ShopActionsComponent { - @Input() shop: ShopItem; - - @Output() updateData = new EventEmitter(); - - constructor(private shopActions: ShopActionsService) {} - - suspend(id: string): void { - this.shopActions - .suspend(id) - .pipe(take(1), filter(isSuccessfulShopAction)) - .subscribe(() => { - this.updateData.emit(); - }); - } - - activate(id: string): void { - this.shopActions - .activate(id) - .pipe(take(1), filter(isSuccessfulShopAction)) - .subscribe(() => { - this.updateData.emit(); - }); - } -} diff --git a/src/app/sections/payment-section/shops/shops-list/shop-details/components/shop-info/shop-info.component.html b/src/app/sections/payment-section/shops/shops-list/shop-details/components/shop-info/shop-info.component.html index 626f0f3cd..6a9dc861d 100644 --- a/src/app/sections/payment-section/shops/shops-list/shop-details/components/shop-info/shop-info.component.html +++ b/src/app/sections/payment-section/shops/shops-list/shop-details/components/shop-info/shop-info.component.html @@ -11,8 +11,5 @@ - {{ - shop.createdAt | date: 'dd MMMM yyyy, HH:mm:ss' - }} {{ (category$ | async)?.name }} diff --git a/src/app/sections/payment-section/shops/shops-list/shop-details/shop-details.component.html b/src/app/sections/payment-section/shops/shops-list/shop-details/shop-details.component.html index 932ba5d72..e1594642b 100644 --- a/src/app/sections/payment-section/shops/shops-list/shop-details/shop-details.component.html +++ b/src/app/sections/payment-section/shops/shops-list/shop-details/shop-details.component.html @@ -2,10 +2,4 @@ - - - - - - diff --git a/src/app/sections/payment-section/shops/shops-list/shop-details/shop-details.component.ts b/src/app/sections/payment-section/shops/shops-list/shop-details/shop-details.component.ts index 8eb895b7d..46fa979b9 100644 --- a/src/app/sections/payment-section/shops/shops-list/shop-details/shop-details.component.ts +++ b/src/app/sections/payment-section/shops/shops-list/shop-details/shop-details.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; +import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; import { ShopItem } from '../../types/shop-item'; @@ -10,10 +10,4 @@ import { ShopItem } from '../../types/shop-item'; }) export class ShopDetailsComponent { @Input() shop: ShopItem; - - @Output() updateData = new EventEmitter(); - - requestUpdateData(): void { - this.updateData.emit(); - } } diff --git a/src/app/sections/payment-section/shops/shops-list/shop-details/shop-details.module.ts b/src/app/sections/payment-section/shops/shops-list/shop-details/shop-details.module.ts index 7cdf42330..da31e60c7 100644 --- a/src/app/sections/payment-section/shops/shops-list/shop-details/shop-details.module.ts +++ b/src/app/sections/payment-section/shops/shops-list/shop-details/shop-details.module.ts @@ -8,14 +8,10 @@ import { MatSnackBarModule } from '@angular/material/snack-bar'; import { TranslocoModule } from '@jsverse/transloco'; import { FlexLayoutModule } from 'ng-flex-layout'; -import { ContractDetailsModule } from '@dsh/app/shared/components'; -import { ShopContractDetailsModule } from '@dsh/app/shared/services/shop-contract-details'; import { DetailsItemModule } from '@dsh/components/layout'; import { ShopBalanceModule } from '../shop-balance'; -import { ShopActionsComponent } from './components/shop-actions/shop-actions.component'; -import { ShopContractDetailsComponent } from './components/shop-contract-details/shop-contract-details.component'; import { ShopIdComponent } from './components/shop-id/shop-id.component'; import { ShopInfoComponent } from './components/shop-info/shop-info.component'; import { CategoryService } from './services/category/category.service'; @@ -30,19 +26,11 @@ import { ShopDetailsComponent } from './shop-details.component'; MatDividerModule, DetailsItemModule, ClipboardModule, - ContractDetailsModule, ShopBalanceModule, MatSnackBarModule, MatDialogModule, - ShopContractDetailsModule, - ], - declarations: [ - ShopDetailsComponent, - ShopContractDetailsComponent, - ShopActionsComponent, - ShopIdComponent, - ShopInfoComponent, ], + declarations: [ShopDetailsComponent, ShopIdComponent, ShopInfoComponent], exports: [ShopDetailsComponent], providers: [CategoryService], }) diff --git a/src/app/sections/payment-section/shops/shops-list/shops-list.component.html b/src/app/sections/payment-section/shops/shops-list/shops-list.component.html index dec7c0294..acb042e39 100644 --- a/src/app/sections/payment-section/shops/shops-list/shops-list.component.html +++ b/src/app/sections/payment-section/shops/shops-list/shops-list.component.html @@ -29,10 +29,7 @@ (collapse)="accordionItem.collapse($event)" >{{ s('panel.details') }} - + diff --git a/src/app/sections/payment-section/utils/to-navbar-item-config.ts b/src/app/sections/payment-section/utils/to-navbar-item-config.ts index e0b35a486..53b553b33 100644 --- a/src/app/sections/payment-section/utils/to-navbar-item-config.ts +++ b/src/app/sections/payment-section/utils/to-navbar-item-config.ts @@ -58,6 +58,6 @@ export const toNavbarItemConfig = ({ routerLink: NavbarRouterLink.Integrations, icon: BootstrapIconName.Plug, label: integrations, - roles: [RoleAccessName.PaymentLinks, RoleAccessName.ApiKeys, RoleAccessName.Webhooks], + roles: [RoleAccessName.ApiKeys, RoleAccessName.Webhooks], }, ]; diff --git a/src/app/sections/wallet-section/deposits/deposit-panels/deposit-panels.module.ts b/src/app/sections/wallet-section/deposits/deposit-panels/deposit-panels.module.ts index 2c1c81c13..9b8e4c6a2 100644 --- a/src/app/sections/wallet-section/deposits/deposit-panels/deposit-panels.module.ts +++ b/src/app/sections/wallet-section/deposits/deposit-panels/deposit-panels.module.ts @@ -14,7 +14,6 @@ import { DepositRowComponent } from './components/deposit-row/deposit-row.compon import { DepositRowHeaderComponent } from './components/deposit-row-header/deposit-row-header.component'; import { DepositDetailsModule } from './deposit-details'; import { DepositPanelsComponent } from './deposit-panels.component'; -import { DepositRevertsModule } from './deposit-reverts/deposit-reverts.module'; @NgModule({ imports: [ @@ -26,7 +25,6 @@ import { DepositRevertsModule } from './deposit-reverts/deposit-reverts.module'; EmptySearchResultModule, ShowMorePanelModule, IndicatorsModule, - DepositRevertsModule, ApiModelTypesModule, DepositDetailsModule, MatDividerModule, diff --git a/src/app/sections/wallet-section/deposits/deposit-panels/deposit-reverts/deposit-reverts.component.html b/src/app/sections/wallet-section/deposits/deposit-panels/deposit-reverts/deposit-reverts.component.html deleted file mode 100644 index dbec758e1..000000000 --- a/src/app/sections/wallet-section/deposits/deposit-panels/deposit-reverts/deposit-reverts.component.html +++ /dev/null @@ -1,33 +0,0 @@ -
-
- {{ t('reverts') }} -
-
- {{ t('loading') }} -
- -
- {{ t('noReverts') }} -
- -
- -
{{ t('revert') }} #{{ revert.id }}
- -
-
-
- -
diff --git a/src/app/sections/wallet-section/deposits/deposit-panels/deposit-reverts/deposit-reverts.component.ts b/src/app/sections/wallet-section/deposits/deposit-panels/deposit-reverts/deposit-reverts.component.ts deleted file mode 100644 index f40f83444..000000000 --- a/src/app/sections/wallet-section/deposits/deposit-panels/deposit-reverts/deposit-reverts.component.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { Component, Input, OnInit } from '@angular/core'; -import { startWith } from 'rxjs/operators'; - -import { SEARCH_LIMIT } from '@dsh/app/sections/tokens'; - -import { FetchDepositRevertsService } from './services/fetch-deposit-reverts.service'; - -@Component({ - selector: 'dsh-deposit-reverts', - templateUrl: 'deposit-reverts.component.html', - providers: [ - FetchDepositRevertsService, - { - provide: SEARCH_LIMIT, - useValue: 3, - }, - ], - standalone: false, -}) -export class DepositRevertsComponent implements OnInit { - @Input() depositID: string; - - reverts$ = this.fetchDepositRevertsService.searchResult$; - hasMore$ = this.fetchDepositRevertsService.hasMore$; - isLoading$ = this.fetchDepositRevertsService.isLoading$.pipe(startWith(true)); - - constructor(private fetchDepositRevertsService: FetchDepositRevertsService) {} - - ngOnInit(): void { - this.fetchDepositRevertsService.search({ - depositID: this.depositID, - }); - } - - fetchMore() { - this.fetchDepositRevertsService.fetchMore(); - } -} diff --git a/src/app/sections/wallet-section/deposits/deposit-panels/deposit-reverts/deposit-reverts.module.ts b/src/app/sections/wallet-section/deposits/deposit-panels/deposit-reverts/deposit-reverts.module.ts deleted file mode 100644 index e7dac4a73..000000000 --- a/src/app/sections/wallet-section/deposits/deposit-panels/deposit-reverts/deposit-reverts.module.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { MatButtonModule } from '@angular/material/button'; -import { MatDividerModule } from '@angular/material/divider'; -import { TranslocoModule } from '@jsverse/transloco'; -import { FlexModule } from 'ng-flex-layout'; - -import { DepositRevertDetailsModule } from '@dsh/app/shared'; -import { IndicatorsModule } from '@dsh/components/indicators'; -import { ShowMorePanelModule } from '@dsh/components/show-more-panel'; - -import { DepositRevertsComponent } from './deposit-reverts.component'; - -@NgModule({ - declarations: [DepositRevertsComponent], - imports: [ - FlexModule, - CommonModule, - ShowMorePanelModule, - IndicatorsModule, - MatDividerModule, - DepositRevertDetailsModule, - TranslocoModule, - MatButtonModule, - ], - exports: [DepositRevertsComponent], -}) -export class DepositRevertsModule {} diff --git a/src/app/sections/wallet-section/deposits/deposit-panels/deposit-reverts/services/fetch-deposit-reverts.service.ts b/src/app/sections/wallet-section/deposits/deposit-panels/deposit-reverts/services/fetch-deposit-reverts.service.ts deleted file mode 100644 index 87abf2917..000000000 --- a/src/app/sections/wallet-section/deposits/deposit-panels/deposit-reverts/services/fetch-deposit-reverts.service.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { Inject, Injectable } from '@angular/core'; -import { TranslocoService } from '@jsverse/transloco'; -import { NotifyLogService } from '@vality/matez'; -import { DepositRevert, ListDepositRevertsRequestParams } from '@vality/swag-wallets'; -import { Observable, of } from 'rxjs'; -import { catchError, shareReplay } from 'rxjs/operators'; - -import { DepositsService } from '@dsh/app/api/wallet'; -import { SEARCH_LIMIT } from '@dsh/app/sections/tokens'; -import { DEBOUNCE_FETCHER_ACTION_TIME, PartialFetcher } from '@dsh/app/shared'; - -@Injectable() -export class FetchDepositRevertsService extends PartialFetcher< - DepositRevert, - Omit -> { - isLoading$: Observable = this.doAction$.pipe(shareReplay(1)); - - constructor( - private depositsService: DepositsService, - private log: NotifyLogService, - private transloco: TranslocoService, - @Inject(SEARCH_LIMIT) - private searchLimit: number, - @Inject(DEBOUNCE_FETCHER_ACTION_TIME) - debounceActionTime: number, - ) { - super(debounceActionTime); - } - - protected fetch( - params: Omit, - continuationToken: string, - ) { - return this.depositsService - .listDepositReverts({ ...params, limit: this.searchLimit, continuationToken }) - .pipe( - catchError((err) => { - this.log.error( - err, - this.transloco.selectTranslate('shared.httpError', null, 'components'), - ); - return of({ result: [] }); - }), - ); - } -} diff --git a/src/app/sections/wallet-section/deposits/deposits-filters/additional-filters/components/dialog-filters/dialog-filters.component.ts b/src/app/sections/wallet-section/deposits/deposits-filters/additional-filters/components/dialog-filters/dialog-filters.component.ts index 24808a100..35e389edb 100644 --- a/src/app/sections/wallet-section/deposits/deposits-filters/additional-filters/components/dialog-filters/dialog-filters.component.ts +++ b/src/app/sections/wallet-section/deposits/deposits-filters/additional-filters/components/dialog-filters/dialog-filters.component.ts @@ -26,7 +26,6 @@ export class DialogFiltersComponent implements OnInit { main: this.fb.group({ depositID: [''], walletID: [null], - identityID: [''], sourceID: [''], }), depositStatus: [null, depositStatusValidator], @@ -78,7 +77,6 @@ export class DialogFiltersComponent implements OnInit { const { depositID = '', walletID = null, - identityID = '', sourceID = '', depositStatus = null, depositAmountFrom = null, @@ -88,7 +86,6 @@ export class DialogFiltersComponent implements OnInit { main: { depositID, walletID, - identityID, sourceID, }, depositStatus, diff --git a/src/app/sections/wallet-section/deposits/deposits-filters/additional-filters/main-info-filters/main-info-filters.component.html b/src/app/sections/wallet-section/deposits/deposits-filters/additional-filters/main-info-filters/main-info-filters.component.html index d425d8b25..bad5eb138 100644 --- a/src/app/sections/wallet-section/deposits/deposits-filters/additional-filters/main-info-filters/main-info-filters.component.html +++ b/src/app/sections/wallet-section/deposits/deposits-filters/additional-filters/main-info-filters/main-info-filters.component.html @@ -8,10 +8,6 @@ [label]="t('walletID')" formControlName="walletID" > - - {{ t('identityID') }} - - {{ t('sourceID') }} diff --git a/src/app/sections/wallet-section/deposits/deposits-filters/additional-filters/main-info-filters/types/main-info-filters.ts b/src/app/sections/wallet-section/deposits/deposits-filters/additional-filters/main-info-filters/types/main-info-filters.ts index 7d05363b3..254295176 100644 --- a/src/app/sections/wallet-section/deposits/deposits-filters/additional-filters/main-info-filters/types/main-info-filters.ts +++ b/src/app/sections/wallet-section/deposits/deposits-filters/additional-filters/main-info-filters/types/main-info-filters.ts @@ -1,6 +1,5 @@ export interface MainInfoFilters { depositID?: string; walletID?: string; - identityID?: string; sourceID?: string; } diff --git a/src/app/sections/wallet-section/deposits/utils/filters-to-search-params.ts b/src/app/sections/wallet-section/deposits/utils/filters-to-search-params.ts index fa551a1c1..8f7327ed3 100644 --- a/src/app/sections/wallet-section/deposits/utils/filters-to-search-params.ts +++ b/src/app/sections/wallet-section/deposits/utils/filters-to-search-params.ts @@ -10,12 +10,10 @@ export const filtersToSearchParams = ({ depositAmountTo, sourceID, walletID, - identityID, }: DepositsFilters): Omit => ({ createdAtFrom: dateRange.start.clone().utc().format(), createdAtTo: dateRange.end.clone().utc().format(), walletID, - identityID, sourceID, depositID, status: depositStatus, diff --git a/src/app/sections/wallet-section/integrations/webhooks/create-webhook/create-webhook-dialog.service.ts b/src/app/sections/wallet-section/integrations/webhooks/create-webhook/create-webhook-dialog.service.ts index 1b968a350..5a4d2e4e1 100644 --- a/src/app/sections/wallet-section/integrations/webhooks/create-webhook/create-webhook-dialog.service.ts +++ b/src/app/sections/wallet-section/integrations/webhooks/create-webhook/create-webhook-dialog.service.ts @@ -1,9 +1,10 @@ import { Injectable } from '@angular/core'; import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; import { BehaviorSubject, Subject, of } from 'rxjs'; -import { catchError, filter, map, switchMap } from 'rxjs/operators'; +import { catchError, filter, map, switchMap, withLatestFrom } from 'rxjs/operators'; import { WebhooksService } from '@dsh/app/api/wallet'; +import { ContextOrganizationService } from '@dsh/app/shared'; import { oneMustBeSelected } from '@dsh/components/form-controls'; import { FormParams } from './form-params'; @@ -28,10 +29,14 @@ export class CreateWebhookDialogService { constructor( private fb: UntypedFormBuilder, private walletWebhooksService: WebhooksService, + private contextOrganizationService: ContextOrganizationService, ) { this.create$ .pipe( - map(formValuesToWebhook), + withLatestFrom(this.contextOrganizationService.organization$), + map(([formValues, organization]) => + formValuesToWebhook(formValues, organization.party), + ), switchMap((webhookParams) => this.walletWebhooksService.createWebhook({ webhookParams }).pipe( catchError((e) => { @@ -53,7 +58,6 @@ export class CreateWebhookDialogService { private initForm(): UntypedFormGroup { return this.fb.group({ - identityID: ['', Validators.required], url: ['', Validators.required], eventType: ['WithdrawalsTopic', Validators.required], walletID: null, diff --git a/src/app/sections/wallet-section/integrations/webhooks/create-webhook/create-webhook-form/create-webhook-form.component.html b/src/app/sections/wallet-section/integrations/webhooks/create-webhook/create-webhook-form/create-webhook-form.component.html index 92c24ce85..fddd59ed2 100644 --- a/src/app/sections/wallet-section/integrations/webhooks/create-webhook/create-webhook-form/create-webhook-form.component.html +++ b/src/app/sections/wallet-section/integrations/webhooks/create-webhook/create-webhook-form/create-webhook-form.component.html @@ -4,20 +4,10 @@ fxLayout="column" fxLayoutGap="24px" > -
- - {{ t('createWebhook.identity') }} - - - {{ identity.id }} {{ identity.name }} - - - - - {{ t('createWebhook.url') }} - - -
+ + {{ t('createWebhook.url') }} + +
{{ t('createWebhook.eventType') }}
('WithdrawalsTopic'); eventType$ = combineLatest([ @@ -29,7 +28,6 @@ export class CreateWebhookFormComponent implements OnInit { ]).pipe(map(([w, d]) => ({ ...w, ...d }))); constructor( - private identitiesService: IdentitiesService, private fb: UntypedFormBuilder, private walletDictionaryService: WalletDictionaryService, private dr: DestroyRef, diff --git a/src/app/sections/wallet-section/integrations/webhooks/create-webhook/create-webhook.service.ts b/src/app/sections/wallet-section/integrations/webhooks/create-webhook/create-webhook.service.ts index 114be516b..3365451c9 100644 --- a/src/app/sections/wallet-section/integrations/webhooks/create-webhook/create-webhook.service.ts +++ b/src/app/sections/wallet-section/integrations/webhooks/create-webhook/create-webhook.service.ts @@ -1,9 +1,7 @@ import { Injectable } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { Observable, Subject } from 'rxjs'; -import { filter, switchMap, take, takeUntil } from 'rxjs/operators'; - -import { IdentitiesService } from '@dsh/app/api/wallet'; +import { filter, switchMap, takeUntil } from 'rxjs/operators'; import { CreateWebhookDialogComponent } from './create-webhook-dialog.component'; @@ -15,21 +13,15 @@ export class CreateWebhookService { webhookCreated$: Observable = this.created$.asObservable(); - constructor( - private dialog: MatDialog, - private identitiesService: IdentitiesService, - ) {} + constructor(private dialog: MatDialog) {} init() { this.createWebhook$ .pipe( takeUntil(this.destroy$), - switchMap(() => this.identitiesService.identities$.pipe(take(1))), - switchMap((identities) => + switchMap(() => this.dialog - .open(CreateWebhookDialogComponent, { - data: identities, - }) + .open(CreateWebhookDialogComponent) .afterClosed() .pipe(filter((r) => r === 'created')), ), diff --git a/src/app/sections/wallet-section/integrations/webhooks/create-webhook/form-params.ts b/src/app/sections/wallet-section/integrations/webhooks/create-webhook/form-params.ts index e00784ab0..fa6cc2aa6 100644 --- a/src/app/sections/wallet-section/integrations/webhooks/create-webhook/form-params.ts +++ b/src/app/sections/wallet-section/integrations/webhooks/create-webhook/form-params.ts @@ -8,7 +8,6 @@ interface EventType { } export interface FormParams { - identityID: string; url: string; walletID?: string; eventType: TopicEnum; diff --git a/src/app/sections/wallet-section/integrations/webhooks/create-webhook/form-values-to-webhook.ts b/src/app/sections/wallet-section/integrations/webhooks/create-webhook/form-values-to-webhook.ts index 460a92ef1..623c266ad 100644 --- a/src/app/sections/wallet-section/integrations/webhooks/create-webhook/form-values-to-webhook.ts +++ b/src/app/sections/wallet-section/integrations/webhooks/create-webhook/form-values-to-webhook.ts @@ -2,10 +2,10 @@ import { Webhook } from '@vality/swag-wallets'; import { FormParams } from './form-params'; -export const formValuesToWebhook = (v: FormParams): Webhook => +export const formValuesToWebhook = (v: FormParams, partyID: string): Webhook => ({ - identityID: v.identityID, url: v.url, + partyID: partyID, scope: { ...(v.walletID ? { walletID: v.walletID } : {}), eventTypes: v.eventTypes.filter((e) => e.selected).map((e) => e.eventName), diff --git a/src/app/sections/wallet-section/integrations/webhooks/delete-webhook/delete-webhook.service.ts b/src/app/sections/wallet-section/integrations/webhooks/delete-webhook/delete-webhook.service.ts index 4abdf32f7..d7e3f397f 100644 --- a/src/app/sections/wallet-section/integrations/webhooks/delete-webhook/delete-webhook.service.ts +++ b/src/app/sections/wallet-section/integrations/webhooks/delete-webhook/delete-webhook.service.ts @@ -42,8 +42,8 @@ export class DeleteWebhookService { .pipe(filter((r) => r.status === DialogResponseStatus.Success)), ]), ), - switchMap(([{ webhookID, identityID }]) => - this.walletWebhooksService.deleteWebhookByID({ webhookID, identityID }).pipe( + switchMap(([{ webhookID }]) => + this.walletWebhooksService.deleteWebhookByID({ webhookID }).pipe( catchError((e) => { this.log.error( e, diff --git a/src/app/sections/wallet-section/integrations/webhooks/receive-webhooks.service.ts b/src/app/sections/wallet-section/integrations/webhooks/receive-webhooks.service.ts index 0b65d628d..2d771d9a7 100644 --- a/src/app/sections/wallet-section/integrations/webhooks/receive-webhooks.service.ts +++ b/src/app/sections/wallet-section/integrations/webhooks/receive-webhooks.service.ts @@ -3,10 +3,10 @@ import { TranslocoService } from '@jsverse/transloco'; import { NotifyLogService } from '@vality/matez'; import { Webhook } from '@vality/swag-wallets'; import sortBy from 'lodash-es/sortBy'; -import { BehaviorSubject, Observable, Subject, forkJoin, of } from 'rxjs'; +import { BehaviorSubject, Observable, Subject, of } from 'rxjs'; import { catchError, filter, map, shareReplay, switchMap } from 'rxjs/operators'; -import { IdentitiesService, WebhooksService } from '@dsh/app/api/wallet'; +import { WebhooksService } from '@dsh/app/api/wallet'; import { mapToTimestamp, progress } from '../../../../custom-operators'; @@ -29,20 +29,13 @@ export class ReceiveWebhooksService { constructor( private walletWebhooksService: WebhooksService, - private identitiesService: IdentitiesService, private log: NotifyLogService, private transloco: TranslocoService, ) { this.receiveWebhooks$ .pipe( - switchMap(() => this.identitiesService.identities$), - map((identities) => identities.map((identity) => identity.id)), - switchMap((ids) => - forkJoin( - ids.map((identityID) => - this.walletWebhooksService.getWebhooks({ identityID }), - ), - ).pipe( + switchMap(() => + this.walletWebhooksService.getWebhooks().pipe( catchError((err) => { this.log.error( err, @@ -56,7 +49,6 @@ export class ReceiveWebhooksService { }), ), ), - map((webhooks) => webhooks.flat()), ) .subscribe((webhooks) => { this.webhooksState$.next(webhooks); diff --git a/src/app/sections/wallet-section/integrations/webhooks/webhook-details/webhook-actions/delete-webhook-params.ts b/src/app/sections/wallet-section/integrations/webhooks/webhook-details/webhook-actions/delete-webhook-params.ts index 8cb8595cc..30bff976a 100644 --- a/src/app/sections/wallet-section/integrations/webhooks/webhook-details/webhook-actions/delete-webhook-params.ts +++ b/src/app/sections/wallet-section/integrations/webhooks/webhook-details/webhook-actions/delete-webhook-params.ts @@ -1,4 +1,3 @@ export interface DeleteWebhookParams { webhookID: string; - identityID: string; } diff --git a/src/app/sections/wallet-section/integrations/webhooks/webhook-details/webhook-actions/webhook-actions.component.html b/src/app/sections/wallet-section/integrations/webhooks/webhook-details/webhook-actions/webhook-actions.component.html index bbb04a59f..832d01833 100644 --- a/src/app/sections/wallet-section/integrations/webhooks/webhook-details/webhook-actions/webhook-actions.component.html +++ b/src/app/sections/wallet-section/integrations/webhooks/webhook-details/webhook-actions/webhook-actions.component.html @@ -8,7 +8,7 @@ diff --git a/src/app/sections/wallet-section/integrations/webhooks/webhook-details/webhook-actions/webhook-actions.component.ts b/src/app/sections/wallet-section/integrations/webhooks/webhook-details/webhook-actions/webhook-actions.component.ts index 61736f69e..f70b6eda2 100644 --- a/src/app/sections/wallet-section/integrations/webhooks/webhook-details/webhook-actions/webhook-actions.component.ts +++ b/src/app/sections/wallet-section/integrations/webhooks/webhook-details/webhook-actions/webhook-actions.component.ts @@ -10,6 +10,5 @@ import { DeleteWebhookParams } from './delete-webhook-params'; }) export class WebhookActionsComponent { @Input() webhookID: string; - @Input() identityID: string; @Output() deleteWebhook = new EventEmitter(); } diff --git a/src/app/sections/wallet-section/integrations/webhooks/webhook-details/webhook-details.component.html b/src/app/sections/wallet-section/integrations/webhooks/webhook-details/webhook-details.component.html index 28843e315..b727e2809 100644 --- a/src/app/sections/wallet-section/integrations/webhooks/webhook-details/webhook-details.component.html +++ b/src/app/sections/wallet-section/integrations/webhooks/webhook-details/webhook-details.component.html @@ -1,7 +1,5 @@
diff --git a/src/app/sections/wallet-section/integrations/webhooks/webhook-details/webhook-main-info/webhook-main-info.component.html b/src/app/sections/wallet-section/integrations/webhooks/webhook-details/webhook-main-info/webhook-main-info.component.html index cb1e3e590..4ea72823e 100644 --- a/src/app/sections/wallet-section/integrations/webhooks/webhook-details/webhook-main-info/webhook-main-info.component.html +++ b/src/app/sections/wallet-section/integrations/webhooks/webhook-details/webhook-main-info/webhook-main-info.component.html @@ -9,9 +9,6 @@ {{ url }}
- -
{{ identityID }} {{ identityName }}
-
{{ walletName }} diff --git a/src/app/sections/wallet-section/integrations/webhooks/webhook-details/webhook-main-info/webhook-main-info.component.ts b/src/app/sections/wallet-section/integrations/webhooks/webhook-details/webhook-main-info/webhook-main-info.component.ts index b70ba5314..2a9be558e 100644 --- a/src/app/sections/wallet-section/integrations/webhooks/webhook-details/webhook-main-info/webhook-main-info.component.ts +++ b/src/app/sections/wallet-section/integrations/webhooks/webhook-details/webhook-main-info/webhook-main-info.component.ts @@ -10,12 +10,6 @@ export class WebhookMainInfoComponent { @Input() url: string; - @Input() - identityID: string; - - @Input() - identityName: string; - @Input() walletName: string; } diff --git a/src/app/sections/wallet-section/integrations/webhooks/webhook-list/webhook-list.component.html b/src/app/sections/wallet-section/integrations/webhooks/webhook-list/webhook-list.component.html index 7caf7e291..1b7edfb35 100644 --- a/src/app/sections/wallet-section/integrations/webhooks/webhook-list/webhook-list.component.html +++ b/src/app/sections/wallet-section/integrations/webhooks/webhook-list/webhook-list.component.html @@ -8,10 +8,7 @@ (expandedChange)="expandedIdChange.emit($event)" > - + - {{ t('url') }} - {{ t('identity') }} + {{ t('url') }} diff --git a/src/app/sections/wallet-section/integrations/webhooks/webhook-list/webhook-row/webhook-row.component.html b/src/app/sections/wallet-section/integrations/webhooks/webhook-list/webhook-row/webhook-row.component.html index 9d57163cf..f0e026ed1 100644 --- a/src/app/sections/wallet-section/integrations/webhooks/webhook-list/webhook-row/webhook-row.component.html +++ b/src/app/sections/wallet-section/integrations/webhooks/webhook-list/webhook-row/webhook-row.component.html @@ -1,6 +1,5 @@ - + {{ url }} - {{ identityID | identityName }} diff --git a/src/app/sections/wallet-section/integrations/webhooks/webhook-list/webhook-row/webhook-row.component.ts b/src/app/sections/wallet-section/integrations/webhooks/webhook-list/webhook-row/webhook-row.component.ts index c9366fcd5..7dd926e0d 100644 --- a/src/app/sections/wallet-section/integrations/webhooks/webhook-list/webhook-row/webhook-row.component.ts +++ b/src/app/sections/wallet-section/integrations/webhooks/webhook-list/webhook-row/webhook-row.component.ts @@ -9,5 +9,4 @@ import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; }) export class WebhookRowComponent { @Input() url: string; - @Input() identityID: string; } diff --git a/src/app/sections/wallet-section/reports/components/create-report-dialog/create-report-dialog.component.html b/src/app/sections/wallet-section/reports/components/create-report-dialog/create-report-dialog.component.html index c6b274906..a995f0b25 100644 --- a/src/app/sections/wallet-section/reports/components/create-report-dialog/create-report-dialog.component.html +++ b/src/app/sections/wallet-section/reports/components/create-report-dialog/create-report-dialog.component.html @@ -53,7 +53,6 @@ />
- - - - - diff --git a/src/app/shared/components/create-payment-link-form/create-payment-link-form.component.ts b/src/app/shared/components/create-payment-link-form/create-payment-link-form.component.ts deleted file mode 100644 index 32f0d74cc..000000000 --- a/src/app/shared/components/create-payment-link-form/create-payment-link-form.component.ts +++ /dev/null @@ -1,76 +0,0 @@ -import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { TranslocoService } from '@jsverse/transloco'; -import { FormGroupSuperclass, NotifyLogService, createControlProviders } from '@vality/matez'; -import { PaymentMethod } from '@vality/swag-payments'; - -import { PaymentLinkParams } from '@dsh/app/shared/services/create-payment-link/types/payment-link-params'; - -import { HoldExpiration } from '../../services/create-payment-link/types/hold-expiration'; - -import { Controls } from './types/controls'; - -@Component({ - selector: 'dsh-create-payment-link-form', - templateUrl: 'create-payment-link-form.component.html', - changeDetection: ChangeDetectionStrategy.OnPush, - providers: createControlProviders(() => CreatePaymentLinkFormComponent), - standalone: false, -}) -export class CreatePaymentLinkFormComponent extends FormGroupSuperclass< - Partial, - Controls -> { - @Input() paymentMethods: PaymentMethod[]; - @Input() paymentLink: string; - - control: FormGroup = this.fb.group({ - name: '', - description: '', - email: ['', Validators.email], - redirectUrl: '', - cancelUrl: '', - locale: null, - paymentFlowHold: false, - onHoldExpiration: HoldExpiration.Cancel, - }); - - localeCodes = ['ru', 'en', 'ar', 'az', 'pt', 'tj', 'tr', 'uz']; - - constructor( - private log: NotifyLogService, - private transloco: TranslocoService, - private fb: FormBuilder, - ) { - super(); - } - - copied(isCopied: boolean): void { - if (isCopied) { - this.log.success(this.transloco.selectTranslate('shared.copied', null, 'components')); - } else { - this.log.success( - this.transloco.selectTranslate('shared.copyFailed', null, 'components'), - ); - } - } - - protected innerToOuterValue(value: Controls): PaymentLinkParams { - let paymentFlow = null; - if (value.paymentFlowHold) { - paymentFlow = { - type: 'PaymentFlowHold', - onHoldExpiration: value.onHoldExpiration, - }; - } - return { - name: value.name, - description: value.description, - email: value.email, - redirectUrl: value.redirectUrl, - cancelUrl: value.cancelUrl, - locale: value.locale, - paymentFlow, - }; - } -} diff --git a/src/app/shared/components/create-payment-link-form/create-payment-link-form.module.ts b/src/app/shared/components/create-payment-link-form/create-payment-link-form.module.ts deleted file mode 100644 index 7c315893c..000000000 --- a/src/app/shared/components/create-payment-link-form/create-payment-link-form.module.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { ClipboardModule } from '@angular/cdk/clipboard'; -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatButtonModule } from '@angular/material/button'; -import { MatCheckboxModule } from '@angular/material/checkbox'; -import { MatDividerModule } from '@angular/material/divider'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatIconModule } from '@angular/material/icon'; -import { MatInputModule } from '@angular/material/input'; -import { MatMenuModule } from '@angular/material/menu'; -import { MatRadioModule } from '@angular/material/radio'; -import { MatSelectModule } from '@angular/material/select'; -import { MatSnackBarModule } from '@angular/material/snack-bar'; -import { TranslocoModule } from '@jsverse/transloco'; -import { FlexLayoutModule } from 'ng-flex-layout'; - -import { UrlShortenerModule } from '@dsh/app/api/url-shortener'; -import { LayoutModule } from '@dsh/components/layout'; -import { ConfirmActionDialogModule } from '@dsh/components/popups'; - -import { CreatePaymentLinkFormComponent } from './create-payment-link-form.component'; -import { LocaleCode } from './locale-code.pipe'; - -@NgModule({ - imports: [ - LayoutModule, - TranslocoModule, - FlexLayoutModule, - ReactiveFormsModule, - CommonModule, - MatInputModule, - MatRadioModule, - MatButtonModule, - MatCheckboxModule, - MatDividerModule, - UrlShortenerModule, - ClipboardModule, - ConfirmActionDialogModule, - MatSnackBarModule, - MatFormFieldModule, - MatIconModule, - MatSelectModule, - MatMenuModule, - ], - declarations: [CreatePaymentLinkFormComponent, LocaleCode], - exports: [CreatePaymentLinkFormComponent], -}) -export class CreatePaymentLinkFormModule {} diff --git a/src/app/shared/components/create-payment-link-form/index.ts b/src/app/shared/components/create-payment-link-form/index.ts deleted file mode 100644 index e722db21e..000000000 --- a/src/app/shared/components/create-payment-link-form/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './create-payment-link-form.component'; -export * from './create-payment-link-form.module'; -export * from './types/controls'; diff --git a/src/app/shared/components/create-payment-link-form/locale-code.pipe.ts b/src/app/shared/components/create-payment-link-form/locale-code.pipe.ts deleted file mode 100644 index 3cd6305b7..000000000 --- a/src/app/shared/components/create-payment-link-form/locale-code.pipe.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { Pipe, PipeTransform } from '@angular/core'; -import { TranslocoService } from '@jsverse/transloco'; - -@Pipe({ - name: 'localeCode', - standalone: false, -}) -export class LocaleCode implements PipeTransform { - constructor(private t: TranslocoService) {} - - transform(localeCode: string): string { - // Duplications for transloco-keys-manager key detection - switch (localeCode) { - case 'ru': - return this.t.translate('createPaymentLinkForm.localeCodes.ru', null, 'components'); - case 'en': - return this.t.translate('createPaymentLinkForm.localeCodes.en', null, 'components'); - case 'ar': - return this.t.translate('createPaymentLinkForm.localeCodes.ar', null, 'components'); - case 'az': - return this.t.translate('createPaymentLinkForm.localeCodes.az', null, 'components'); - case 'pt': - return this.t.translate('createPaymentLinkForm.localeCodes.pt', null, 'components'); - case 'tj': - return this.t.translate('createPaymentLinkForm.localeCodes.tj', null, 'components'); - case 'tr': - return this.t.translate('createPaymentLinkForm.localeCodes.tr', null, 'components'); - case 'uz': - return this.t.translate('createPaymentLinkForm.localeCodes.uz', null, 'components'); - default: - return localeCode; - } - } -} diff --git a/src/app/shared/components/create-payment-link-form/types/controls.ts b/src/app/shared/components/create-payment-link-form/types/controls.ts deleted file mode 100644 index 7a497e604..000000000 --- a/src/app/shared/components/create-payment-link-form/types/controls.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { HoldExpiration } from '@dsh/app/shared/services/create-payment-link/types/hold-expiration'; - -export type Controls = { - name: string; - description: string; - email: string; - redirectUrl: string; - cancelUrl: string; - locale: null; - paymentFlowHold: false; - onHoldExpiration: HoldExpiration.Cancel; -}; diff --git a/src/app/shared/components/filters/identity-filter/identity-filter.component.html b/src/app/shared/components/filters/identity-filter/identity-filter.component.html deleted file mode 100644 index 1e780d0e1..000000000 --- a/src/app/shared/components/filters/identity-filter/identity-filter.component.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - diff --git a/src/app/shared/components/filters/identity-filter/identity-filter.component.ts b/src/app/shared/components/filters/identity-filter/identity-filter.component.ts deleted file mode 100644 index 3efcb2ccc..000000000 --- a/src/app/shared/components/filters/identity-filter/identity-filter.component.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; -import { createControlProviders } from '@vality/matez'; -import { Identity } from '@vality/swag-wallets'; -import { combineLatest } from 'rxjs'; -import { map, share } from 'rxjs/operators'; - -import { IdentitiesService } from '@dsh/app/api/wallet'; -import { FilterSuperclass } from '@dsh/components/filter'; - -@Component({ - selector: 'dsh-identity-filter', - templateUrl: 'identity-filter.component.html', - changeDetection: ChangeDetectionStrategy.OnPush, - providers: createControlProviders(() => IdentityFilterComponent), - standalone: false, -}) -export class IdentityFilterComponent extends FilterSuperclass { - identity$ = combineLatest([this.identitiesService.identities$, this.savedValue$]).pipe( - map(([identities, value]) => identities.find((i) => i.id === value)), - share(), - ); - - constructor(private identitiesService: IdentitiesService) { - super(); - } -} diff --git a/src/app/shared/components/filters/identity-filter/identity-filter.module.ts b/src/app/shared/components/filters/identity-filter/identity-filter.module.ts deleted file mode 100644 index df374d181..000000000 --- a/src/app/shared/components/filters/identity-filter/identity-filter.module.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatOptionModule } from '@angular/material/core'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatSelectModule } from '@angular/material/select'; -import { TranslocoModule } from '@jsverse/transloco'; -import { FlexModule } from 'ng-flex-layout'; - -import { IdentityFieldComponent } from '@dsh/app/shared/components/inputs/identity-field'; -import { FilterModule } from '@dsh/components/filter'; - -import { IdentityFilterComponent } from './identity-filter.component'; - -@NgModule({ - imports: [ - CommonModule, - TranslocoModule, - ReactiveFormsModule, - FilterModule, - FlexModule, - MatFormFieldModule, - MatOptionModule, - MatSelectModule, - IdentityFieldComponent, - ], - declarations: [IdentityFilterComponent], - exports: [IdentityFilterComponent], -}) -export class IdentityFilterModule {} diff --git a/src/app/shared/components/filters/identity-filter/index.ts b/src/app/shared/components/filters/identity-filter/index.ts deleted file mode 100644 index d16c11345..000000000 --- a/src/app/shared/components/filters/identity-filter/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './identity-filter.component'; -export * from './identity-filter.module'; diff --git a/src/app/shared/components/filters/index.ts b/src/app/shared/components/filters/index.ts index bfafabfe3..79d8274bc 100644 --- a/src/app/shared/components/filters/index.ts +++ b/src/app/shared/components/filters/index.ts @@ -3,4 +3,3 @@ export * from './invoices-filter'; export * from './invoice-status-filter'; export * from './refund-status-filter'; export * from './currency-filter'; -export * from './identity-filter'; diff --git a/src/app/shared/components/inputs/identity-field/identity-field.component.html b/src/app/shared/components/inputs/identity-field/identity-field.component.html deleted file mode 100644 index ec5655c6b..000000000 --- a/src/app/shared/components/inputs/identity-field/identity-field.component.html +++ /dev/null @@ -1,11 +0,0 @@ - - {{ t('label') }} - - - {{ identity.id }} {{ identity.name }} - - - diff --git a/src/app/shared/components/inputs/identity-field/identity-field.component.ts b/src/app/shared/components/inputs/identity-field/identity-field.component.ts deleted file mode 100644 index fe2878aa9..000000000 --- a/src/app/shared/components/inputs/identity-field/identity-field.component.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { CommonModule } from '@angular/common'; -import { Component, Input } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatOptionModule } from '@angular/material/core'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatSelectModule } from '@angular/material/select'; -import { TranslocoModule } from '@jsverse/transloco'; -import { FormControlSuperclass, createControlProviders } from '@vality/matez'; -import { Identity } from '@vality/swag-wallets'; -import { FlexModule } from 'ng-flex-layout'; - -import { IdentitiesService } from '@dsh/app/api/wallet'; - -@Component({ - selector: 'dsh-identity-field', - imports: [ - CommonModule, - FlexModule, - MatFormFieldModule, - MatOptionModule, - MatSelectModule, - ReactiveFormsModule, - TranslocoModule, - ], - templateUrl: './identity-field.component.html', - providers: createControlProviders(() => IdentityFieldComponent), -}) -export class IdentityFieldComponent extends FormControlSuperclass { - @Input() required = false; - - identities$ = this.identitiesService.identities$; - - constructor(private identitiesService: IdentitiesService) { - super(); - } -} diff --git a/src/app/shared/components/inputs/identity-field/index.ts b/src/app/shared/components/inputs/identity-field/index.ts deleted file mode 100644 index 2d33868f6..000000000 --- a/src/app/shared/components/inputs/identity-field/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './identity-field.component'; diff --git a/src/app/shared/pipes/api-model-refs/api-model-refs.module.ts b/src/app/shared/pipes/api-model-refs/api-model-refs.module.ts index 87d374c6a..37a227b0b 100644 --- a/src/app/shared/pipes/api-model-refs/api-model-refs.module.ts +++ b/src/app/shared/pipes/api-model-refs/api-model-refs.module.ts @@ -1,11 +1,10 @@ import { NgModule } from '@angular/core'; -import { IdentityDetailsPipe } from './identity-details.pipe'; import { ShopDetailsPipe } from './shop-details.pipe'; import { WalletDetailsPipe } from './wallet-details.pipe'; @NgModule({ - declarations: [ShopDetailsPipe, WalletDetailsPipe, IdentityDetailsPipe], - exports: [ShopDetailsPipe, WalletDetailsPipe, IdentityDetailsPipe], + declarations: [ShopDetailsPipe, WalletDetailsPipe], + exports: [ShopDetailsPipe, WalletDetailsPipe], }) export class ApiModelRefsModule {} diff --git a/src/app/shared/pipes/api-model-refs/identity-details.pipe.ts b/src/app/shared/pipes/api-model-refs/identity-details.pipe.ts deleted file mode 100644 index 0ace4bfd3..000000000 --- a/src/app/shared/pipes/api-model-refs/identity-details.pipe.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { ChangeDetectorRef, OnDestroy, Pipe, PipeTransform } from '@angular/core'; -import { BehaviorSubject, Subject, combineLatest } from 'rxjs'; -import { distinctUntilChanged, map, pluck, takeUntil } from 'rxjs/operators'; - -import { IdentitiesService } from '@dsh/app/api/wallet'; - -@Pipe({ - name: 'identityDetails', - pure: false, - standalone: false, -}) -export class IdentityDetailsPipe implements PipeTransform, OnDestroy { - private identityName$: BehaviorSubject = new BehaviorSubject(''); - private identityIDChange$: Subject = new Subject(); - private destroy$: Subject = new Subject(); - - constructor( - private identitiesService: IdentitiesService, - private ref: ChangeDetectorRef, - ) { - combineLatest([ - this.identitiesService.identities$, - this.identityIDChange$.pipe(distinctUntilChanged()), - ]) - .pipe( - takeUntil(this.destroy$), - map(([identities, identityID]) => identities.find((s) => s.id === identityID)), - pluck('name'), - ) - .subscribe((v) => { - this.identityName$.next(v); - this.ref.markForCheck(); - }); - } - - transform(identityID: string): string { - this.identityIDChange$.next(identityID); - return this.identityName$.value; - } - - ngOnDestroy(): void { - this.destroy$.next(); - } -} diff --git a/src/app/shared/pipes/identity-name.pipe.ts b/src/app/shared/pipes/identity-name.pipe.ts deleted file mode 100644 index 6360f6825..000000000 --- a/src/app/shared/pipes/identity-name.pipe.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { AsyncPipe } from '@angular/common'; -import { ChangeDetectorRef, Pipe, PipeTransform } from '@angular/core'; -import { Identity } from '@vality/swag-wallets'; -import { map } from 'rxjs/operators'; - -import { IdentitiesService } from '@dsh/app/api/wallet'; - -@Pipe({ - name: 'identityName', - standalone: true, - pure: false, -}) -export class IdentityNamePipe implements PipeTransform { - async = new AsyncPipe(this.cdr); - - constructor( - private cdr: ChangeDetectorRef, - private identitiesService: IdentitiesService, - ) {} - - transform(id: Identity['id']): Identity['name'] { - return this.async.transform( - this.identitiesService.identities$.pipe( - map((identities) => identities.find((identity) => identity.id === id)?.name || id), - ), - ); - } -} diff --git a/src/app/shared/services/create-payment-link/create-payment-link.module.ts b/src/app/shared/services/create-payment-link/create-payment-link.module.ts deleted file mode 100644 index 8bf15fc77..000000000 --- a/src/app/shared/services/create-payment-link/create-payment-link.module.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { NgModule } from '@angular/core'; - -import { CreatePaymentLinkService } from './create-payment-link.service'; - -@NgModule({ - providers: [CreatePaymentLinkService], -}) -export class CreatePaymentLinkModule {} diff --git a/src/app/shared/services/create-payment-link/create-payment-link.service.ts b/src/app/shared/services/create-payment-link/create-payment-link.service.ts deleted file mode 100644 index 2cfd2c343..000000000 --- a/src/app/shared/services/create-payment-link/create-payment-link.service.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Invoice, InvoiceTemplateAndToken } from '@vality/swag-payments'; -import moment from 'moment'; -import { Observable } from 'rxjs'; -import { pluck, switchMap } from 'rxjs/operators'; - -import { InvoicesService } from '@dsh/app/api/payments'; -import { ShortenerService } from '@dsh/app/api/url-shortener'; -import { queryParamsToStr } from '@dsh/utils'; - -import { ConfigService } from '../../../config'; - -import { PaymentLinkParams } from './types/payment-link-params'; -import { getDueDate } from './utils/get-due-date'; - -@Injectable({ - providedIn: 'root', -}) -export class CreatePaymentLinkService { - constructor( - private shortenerService: ShortenerService, - private configService: ConfigService, - private invoicesService: InvoicesService, - ) {} - - createPaymentLinkByTemplate( - { invoiceTemplate, invoiceTemplateAccessToken }: InvoiceTemplateAndToken, - params: PaymentLinkParams, - ): Observable { - return this.shortenerService - .shortenUrl({ - shortenedUrlParams: { - sourceUrl: this.buildUrl({ - ...params, - invoiceTemplateID: invoiceTemplate.id, - invoiceTemplateAccessToken: invoiceTemplateAccessToken.payload, - }), - expiresAt: getDueDate(invoiceTemplate.lifetime).utc().format(), - }, - }) - .pipe(pluck('shortenedUrl')); - } - - createPaymentLinkByInvoice(invoice: Invoice, params: PaymentLinkParams): Observable { - return this.invoicesService.createInvoiceAccessToken({ invoiceID: invoice.id }).pipe( - switchMap(({ payload: invoiceAccessToken }) => - this.shortenerService.shortenUrl({ - shortenedUrlParams: { - sourceUrl: this.buildUrl({ - ...params, - invoiceID: invoice.id, - invoiceAccessToken, - }), - expiresAt: moment(invoice.dueDate).utc().format(), - }, - }), - ), - pluck('shortenedUrl'), - ); - } - - private buildUrl(params: PaymentLinkParams): string { - return `${this.configService.checkoutEndpoint}/v1/checkout.html?${queryParamsToStr( - params, - )}`; - } -} diff --git a/src/app/shared/services/create-payment-link/index.ts b/src/app/shared/services/create-payment-link/index.ts deleted file mode 100644 index ae17fa38c..000000000 --- a/src/app/shared/services/create-payment-link/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './create-payment-link.service'; -export * from './create-payment-link.module'; diff --git a/src/app/shared/services/create-payment-link/types/hold-expiration.ts b/src/app/shared/services/create-payment-link/types/hold-expiration.ts deleted file mode 100644 index 615a8f344..000000000 --- a/src/app/shared/services/create-payment-link/types/hold-expiration.ts +++ /dev/null @@ -1,4 +0,0 @@ -export enum HoldExpiration { - Cancel = 'cancel', - Capture = 'capture', -} diff --git a/src/app/shared/services/create-payment-link/types/payment-link-params.ts b/src/app/shared/services/create-payment-link/types/payment-link-params.ts deleted file mode 100644 index d96d42f1c..000000000 --- a/src/app/shared/services/create-payment-link/types/payment-link-params.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { PaymentFlow } from '@vality/swag-payments'; - -export interface PaymentLinkParams { - invoiceID?: string; - invoiceAccessToken?: string; - invoiceTemplateID?: string; - invoiceTemplateAccessToken?: string; - name?: string; - description?: string; - email?: string; - redirectUrl?: string; - cancelUrl?: string; - locale?: string; - paymentFlow?: PaymentFlow; -} diff --git a/src/app/shared/services/create-payment-link/utils/get-due-date.ts b/src/app/shared/services/create-payment-link/utils/get-due-date.ts deleted file mode 100644 index 1de80fb41..000000000 --- a/src/app/shared/services/create-payment-link/utils/get-due-date.ts +++ /dev/null @@ -1,5 +0,0 @@ -import moment, { DurationInputObject, Moment } from 'moment'; - -export function getDueDate(duration: DurationInputObject): Moment { - return moment().add(moment.duration(duration)); -} diff --git a/src/app/shared/services/shop-contract-details/index.ts b/src/app/shared/services/shop-contract-details/index.ts deleted file mode 100644 index c86c9be6c..000000000 --- a/src/app/shared/services/shop-contract-details/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './shop-contract-details.module'; -export * from './shop-contract-details.service'; diff --git a/src/app/shared/services/shop-contract-details/shop-contract-details.module.ts b/src/app/shared/services/shop-contract-details/shop-contract-details.module.ts deleted file mode 100644 index 4fcd085fa..000000000 --- a/src/app/shared/services/shop-contract-details/shop-contract-details.module.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { NgModule } from '@angular/core'; - -import { ShopContractDetailsService } from './shop-contract-details.service'; - -@NgModule({ - providers: [ShopContractDetailsService], -}) -export class ShopContractDetailsModule {} diff --git a/src/app/shared/services/shop-contract-details/shop-contract-details.service.ts b/src/app/shared/services/shop-contract-details/shop-contract-details.service.ts deleted file mode 100644 index 9cb4dfc32..000000000 --- a/src/app/shared/services/shop-contract-details/shop-contract-details.service.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { DestroyRef, Injectable } from '@angular/core'; -import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; -import { Contract, RussianLegalEntity } from '@vality/swag-payments'; -import { BehaviorSubject, Observable, ReplaySubject, Subject, defer, of } from 'rxjs'; -import { catchError, distinctUntilChanged, filter, switchMap, tap } from 'rxjs/operators'; -import { Overwrite } from 'utility-types'; - -import { ContractsService } from '@dsh/app/api/payments'; - -@Injectable() -export class ShopContractDetailsService { - shopContract$: Observable> = defer(() => - this.contract$.asObservable(), - ); - errorOccurred$: Observable = defer(() => this.error$.asObservable()); - isLoading$: Observable = defer(() => this._isLoading$.asObservable()); - - private contractRequest$: Subject = new Subject(); - // TODO: contract errors not forwarded - private error$ = new BehaviorSubject(false); - private contract$ = new ReplaySubject< - Overwrite - >(); - private _isLoading$ = new BehaviorSubject(false); - - constructor( - private contractsService: ContractsService, - private dr: DestroyRef, - ) { - this.contractRequest$ - .pipe( - tap(() => this.error$.next(false)), - distinctUntilChanged(), - tap(() => this._isLoading$.next(true)), - switchMap((contractID) => - contractID - ? this.contractsService.getContractByIDForParty({ contractID }).pipe( - catchError((e) => { - console.error(e); - this.error$.next(true); - return of('error'); - }), - ) - : of(null), - ), - tap(() => this._isLoading$.next(false)), - filter((result) => result !== 'error'), - takeUntilDestroyed(this.dr), - ) - .subscribe((contract) => - this.contract$.next( - contract as unknown as Overwrite, - ), - ); - } - - requestContract(contractID: string): void { - this.contractRequest$.next(contractID); - } -} diff --git a/src/assets/i18n/components/en.json b/src/assets/i18n/components/en.json index b44557e4c..99d5b4497 100644 --- a/src/assets/i18n/components/en.json +++ b/src/assets/i18n/components/en.json @@ -10,32 +10,6 @@ "selectActiveOrg": "Choose an active organization" } }, - "apiModelDetails": { - "bankAccount": { - "account": "Operating account", - "bankBik": "BIC", - "bankName": "Bank name", - "bankPostAccount": "Corr. account" - }, - "contract": { - "createdAt": "Created at" - }, - "internationalLegalEntity": { - "legalName": "Name", - "registeredNumber": "Registration number", - "registeredOffice": "Registration postal address", - "tradingName": "Trade name" - }, - "russianLegalEntity": { - "actualAddress": "Location postal address", - "inn": "INN", - "registeredName": "Legal entity name", - "registeredNumber": "OGRN/OGRNIP", - "representativeDocument": "EEC/representative document", - "representativeFullName": "EEC/representative full name", - "representativePosition": "Position of EEC/representative" - } - }, "app": { "errors": { "bootstrapAppFailed": "Initialization error" @@ -50,65 +24,17 @@ "shop": "Shop" } }, - "createPaymentLinkForm": { - "description": "Information to display on the payment page", - "form": { - "cancelUrl": "Checkout will redirect to this page if the payer clicks the back button (optional)", - "copy": "Copy", - "description": "Description (optional)", - "email": "Payer's email (optional)", - "link": "Payment link", - "locale": "Localization (optional)", - "name": "Name (optional)", - "paymentFlowHold": "Preliminarily hold the amount of payment from the payer", - "paymentFlowHoldPolicy": "After the retention period", - "redirectUrl": "Redirect URL after successful payment completion (optional)" - }, - "holdExpiration": { - "cancel": "Return to payer", - "capture": "Write off from the payer" - }, - "localeCodes": { - "ar": "ar - Arabic", - "auto": "Automatically determine", - "az": "az - Azerbaijani", - "en": "en - English", - "pt": "pt - Portuguese", - "ru": "ru - Russian", - "tj": "tj - Tajik", - "tr": "tr - Turkish", - "uz": "uz - Uzbek" - } - }, "currencyAutocompleteField": { "label": "Currency" }, "currencyFilter": { "label": "Currency" }, - "depositRevertDetails": { - "amount": "Cancellation amount", - "createdAt": "Created at", - "error": "Error", - "errors": { - "failed": "Error when cancelling" - }, - "status": "Status" - }, "expandableRadioGroup": { "any": "Any", "hideAllStatuses": "Hide all statuses", "showAllStatuses": "Show all statuses" }, - "identityFilter": { - "activeLabel": "Wallet holder: {{name}}", - "label": "Wallet holder" - }, - "inputs": { - "identityField": { - "label": "Wallet holder" - } - }, "invoiceDetails": { "amount": "Amount", "createdAt": "Created at", @@ -177,7 +103,6 @@ "create": "Create", "httpError": "An error occurred in the process of transmitting/receiving data", "loading": "Loading...", - "next": "Next", "save": "Save", "showMore": "Show more" }, diff --git a/src/assets/i18n/components/ru.json b/src/assets/i18n/components/ru.json index 471212148..2133d73ec 100644 --- a/src/assets/i18n/components/ru.json +++ b/src/assets/i18n/components/ru.json @@ -10,32 +10,6 @@ "selectActiveOrg": "Выбрать активную организацию" } }, - "apiModelDetails": { - "bankAccount": { - "account": "Расчетный счет", - "bankBik": "БИК", - "bankName": "Наименование банка", - "bankPostAccount": "Корр. счет" - }, - "contract": { - "createdAt": "Дата и время создания" - }, - "internationalLegalEntity": { - "legalName": "Наименование", - "registeredNumber": "Регистрационный номер", - "registeredOffice": "Адрес места регистрации", - "tradingName": "Торговое наименование" - }, - "russianLegalEntity": { - "actualAddress": "Почтовый адрес места нахождения", - "inn": "ИНН", - "registeredName": "Наименование юр. лица", - "registeredNumber": "ОГРН/ОГРНИП", - "representativeDocument": "Документ ЕИО/представителя", - "representativeFullName": "ФИО ЕИО/представителя", - "representativePosition": "Должность ЕИО/представителя" - } - }, "app": { "errors": { "bootstrapAppFailed": "Ошибка инициализации" @@ -50,65 +24,17 @@ "shop": "Магазин" } }, - "createPaymentLinkForm": { - "description": "Информация для отображения на платежной странице", - "form": { - "cancelUrl": "Checkout перенаправит на эту страницу, если плательщик нажмет кнопку назад (опционально)", - "copy": "Скопировать", - "description": "Описание (опционально)", - "email": "Email плательщика (опционально)", - "link": "Ссылка на оплату", - "locale": "Локализация (опционально)", - "name": "Наименование (опционально)", - "paymentFlowHold": "Предварительно заблокировать сумму платежа у покупателя", - "paymentFlowHoldPolicy": "По истечении срока удержания", - "redirectUrl": "Redirect URL после успешного завершения платежа (опционально)" - }, - "holdExpiration": { - "cancel": "Вернуть покупателю", - "capture": "Списать с покупателя" - }, - "localeCodes": { - "ar": "ar - Арабский", - "auto": "Определить автоматически", - "az": "az - Азербайджанский", - "en": "en - Английский", - "pt": "pt - Португальский", - "ru": "ru - Русский", - "tj": "tj - Таджикский", - "tr": "tr - Турецкий", - "uz": "uz - Узбекский" - } - }, "currencyAutocompleteField": { "label": "Валюта" }, "currencyFilter": { "label": "Валюта" }, - "depositRevertDetails": { - "amount": "Сумма отмены", - "createdAt": "Дата", - "error": "Ошибка", - "errors": { - "failed": "Ошибка при отмене" - }, - "status": "Статус" - }, "expandableRadioGroup": { "any": "Любой", "hideAllStatuses": "Скрыть все статусы", "showAllStatuses": "Показать все статусы" }, - "identityFilter": { - "activeLabel": "Владелец кошелька: {{name}}", - "label": "Владелец кошелька" - }, - "inputs": { - "identityField": { - "label": "Владелец кошелька" - } - }, "invoiceDetails": { "amount": "Стоимость", "createdAt": "Создан", @@ -177,7 +103,6 @@ "create": "Создать", "httpError": "Произошла ошибка в процессе передачи / получения данных", "loading": "Загрузка...", - "next": "Далее", "save": "Сохранить", "showMore": "Показать еще" }, diff --git a/src/assets/i18n/dictionary/en.json b/src/assets/i18n/dictionary/en.json index 82caad0fd..bf95a2b46 100644 --- a/src/assets/i18n/dictionary/en.json +++ b/src/assets/i18n/dictionary/en.json @@ -105,14 +105,6 @@ } }, "payments": { - "customersTopicEventType": { - "CustomerBindingFailed": "CustomerBindingFailed (customer binding failed)", - "CustomerBindingStarted": "CustomerBindingStarted (customer binding started)", - "CustomerBindingSucceeded": "CustomerBindingSucceeded (customer binding successfully completed)", - "CustomerCreated": "CustomerCreated (customer created)", - "CustomerDeleted": "CustomerDeleted (customer deleted)", - "CustomerReady": "CustomerReady (customer ready)" - }, "invoicesTopicEventType": { "InvoiceCancelled": "InvoiceCancelled (invoice cancelled upon expiration of validity period)", "InvoiceCreated": "InvoiceCreated (new invoice created)", @@ -140,11 +132,6 @@ } }, "wallet": { - "depositRevertStatus": { - "Failed": "Failed", - "Pending": "Pending", - "Succeeded": "Succeeded" - }, "depositStatus": { "Failed": "Failed", "Pending": "Pending", diff --git a/src/assets/i18n/dictionary/ru.json b/src/assets/i18n/dictionary/ru.json index 5576ac007..c9e982227 100644 --- a/src/assets/i18n/dictionary/ru.json +++ b/src/assets/i18n/dictionary/ru.json @@ -105,14 +105,6 @@ } }, "payments": { - "customersTopicEventType": { - "CustomerBindingFailed": "CustomerBindingFailed (привязка к плательщику завершена с неудачей)", - "CustomerBindingStarted": "CustomerBindingStarted (привязка к плательщику запущена)", - "CustomerBindingSucceeded": "CustomerBindingSucceeded (привязка к плательщику успешно завершена)", - "CustomerCreated": "CustomerCreated (плательщик создан)", - "CustomerDeleted": "CustomerDeleted (плательщик удален)", - "CustomerReady": "CustomerReady (плательщик готов)" - }, "invoicesTopicEventType": { "InvoiceCancelled": "InvoiceCancelled (инвойс отменен по истечению срока давности)", "InvoiceCreated": "InvoiceCreated (создан новый инвойс)", @@ -140,11 +132,6 @@ } }, "wallet": { - "depositRevertStatus": { - "Failed": "Неуспешно", - "Pending": "В процессе", - "Succeeded": "Успешно" - }, "depositStatus": { "Failed": "Неуспешно", "Pending": "В процессе", diff --git a/src/assets/i18n/organization-section/en.json b/src/assets/i18n/organization-section/en.json index 1ce174f41..19ac2a514 100644 --- a/src/assets/i18n/organization-section/en.json +++ b/src/assets/i18n/organization-section/en.json @@ -108,7 +108,6 @@ "roleAccessesDictionary": { "claims": "Claims", "createInvoice": "Create invoice", - "createPaymentLink": "Create a payment link", "createRefund": "Make a refund", "manageOrganizations": "Managing organizations and members", "manageReports": "Manage reports", diff --git a/src/assets/i18n/organization-section/ru.json b/src/assets/i18n/organization-section/ru.json index d97393102..d39a3e1f8 100644 --- a/src/assets/i18n/organization-section/ru.json +++ b/src/assets/i18n/organization-section/ru.json @@ -108,7 +108,6 @@ "roleAccessesDictionary": { "claims": "Заявки", "createInvoice": "Создать инвойс", - "createPaymentLink": "Создать платежную ссылку", "createRefund": "Совершить возврат", "manageOrganizations": "Управление организациями и сотрудниками", "manageReports": "Управление отчетами", diff --git a/src/assets/i18n/payment-section/en.json b/src/assets/i18n/payment-section/en.json index 93324fdb8..32c705b0f 100644 --- a/src/assets/i18n/payment-section/en.json +++ b/src/assets/i18n/payment-section/en.json @@ -59,37 +59,12 @@ "createInvoiceDialog": { "title": "Creating an invoice" }, - "createInvoiceOrInvoiceTemplate": { - "createInvoiceFailed": "Failed to create invoice. Check the console for details.", - "description": "Payment link is a tool for accepting payments according to a set invoice template. Here you can generate an invoice template with the required parameters and then generate a payment link for the payment. The link can be placed both on the website and in social networks and allows you to make multiple payments, each time creating a unique invoice for the client. This tool is designed to pay for a single item or service.", - "invoiceTitle": "Creating an invoice", - "title": "Payment link", - "types": { - "personal": "Create a personal payment link to pay for a specific order", - "reusable": "Create a reusable payment link to pay for multiple customer orders" - } - }, - "createInvoiceTemplate": { - "createInvoiceTemplateFailed": "Failed to create invoice template. Check the console for details.", - "form": { - "cost": "Cost of the offered goods or services", - "lifetime": "End of validity of the invoice", - "product": "Name of the offered goods or services", - "shop": "Shop" - }, - "title": "Creating an invoice template" - }, - "createPaymentLinkDialog": { - "create": "Create payment link", - "title": "Creating payment link" - }, "digitalWallet": { "DigitalWalletDetailsQIWI": "QIWI" }, "integrations": { "tabs": { "api-keys": "API KEYS", - "payment-link": "PAYMENT LINK", "webhooks": "WEBHOOKS" } }, @@ -105,7 +80,6 @@ "actions": { "cancelInvoice": "Cancel invoice", "confirm": "Confirm", - "createPaymentLink": "Create payment link", "fulfillInvoice": "Redeem the invoice", "invoiceCancelled": "Invoice was cancelled successfully", "invoiceCreated": "Invoice was created successfully", @@ -314,16 +288,6 @@ "timeout": "Exceeded timeout", "unknownError": "Unknown error" }, - "paymentLink": { - "back": "Back", - "clearForm": "Clear", - "create": "Create payment link", - "errors": { - "createPaymentLinkError": "Failed to create a payment link" - }, - "noAvailableShops": "No available shops", - "title": "Creating payment link" - }, "paymentSection": { "nav": { "analytics": "Analytics", @@ -398,15 +362,11 @@ }, "emptySearchResult": "There are no shops yet", "panel": { - "actions": "Actions", - "activate": "Activate the shop", "category": "Shop category", "copy": "Copy", - "createdAt": "Created at", "details": "Shop details", "id": "Shop ID", "name": "Shop name", - "suspend": "Suspend the shop", "url": "Website URL" }, "shopContract": { @@ -464,6 +424,6 @@ "publicKey": "Content of the public key used to check the authoritativeness of\nnotifications coming to `url`", "title": "Public key" }, - "webhook": "Missing value for 'paymentSection.webhook.webhook'" + "webhook": "Webhook" } } diff --git a/src/assets/i18n/payment-section/ru.json b/src/assets/i18n/payment-section/ru.json index 2bfe283a1..2d4cb763c 100644 --- a/src/assets/i18n/payment-section/ru.json +++ b/src/assets/i18n/payment-section/ru.json @@ -59,37 +59,12 @@ "createInvoiceDialog": { "title": "Создание инвойса" }, - "createInvoiceOrInvoiceTemplate": { - "createInvoiceFailed": "Не удалось создать инвойс. Проверьте консоль для получения подробностей.", - "description": "Платежная ссылка — это инструмент приема платежей по установленному шаблону инвойса. Здесь вы можете сформировать шаблон инвойса с нужными параметрами и далее сгенерировать платежную ссылку для оплаты. Ссылку можно размещать как на сайте, так и в соцсетях, она позволяет вносить оплату многократно, каждый раз создавая уникальный инвойс для клиента. Данный инструмент предназначен для оплаты одного товара или услуги.", - "invoiceTitle": "Создание инвойса", - "title": "Платежная ссылка", - "types": { - "personal": "Создать персональную платежную ссылку для оплаты конкретного заказа", - "reusable": "Создать многоразовую платежную ссылку для оплаты заказов нескольких клиентов" - } - }, - "createInvoiceTemplate": { - "createInvoiceTemplateFailed": "Не удалось создать шаблон инвойса. Проверьте консоль для получения подробностей.", - "form": { - "cost": "Стоимость предлагаемых товаров или услуг", - "lifetime": "Окончание срока действия инвойса", - "product": "Наименование предлагаемых товаров или услуг", - "shop": "Магазин" - }, - "title": "Создание шаблона инвойса" - }, - "createPaymentLinkDialog": { - "create": "Сформировать ссылку на оплату", - "title": "Создание платежной ссылки" - }, "digitalWallet": { "DigitalWalletDetailsQIWI": "QIWI" }, "integrations": { "tabs": { "api-keys": "API КЛЮЧИ", - "payment-link": "ПЛАТЕЖНАЯ ССЫЛКА", "webhooks": "WEBHOOKS" } }, @@ -105,7 +80,6 @@ "actions": { "cancelInvoice": "Отменить инвойс", "confirm": "Подтвердить", - "createPaymentLink": "Сформировать ссылку на оплату", "fulfillInvoice": "Погасить инвойс", "invoiceCancelled": "Инвойс успешно отменен", "invoiceCreated": "Инвойс успешно создан", @@ -314,16 +288,6 @@ "timeout": "Превышен лимит ожидания", "unknownError": "Неизвестная ошибка" }, - "paymentLink": { - "back": "Назад", - "clearForm": "Очистить форму", - "create": "Сформировать ссылку на оплату", - "errors": { - "createPaymentLinkError": "Не удалось создать платежную ссылку" - }, - "noAvailableShops": "Отсутствуют доступные магазины", - "title": "Создание платежной ссылки" - }, "paymentSection": { "nav": { "analytics": "Аналитика", @@ -398,15 +362,11 @@ }, "emptySearchResult": "Магазины отсутствуют", "panel": { - "actions": "Действия", - "activate": "Активировать магазин", "category": "Категория магазина", "copy": "Скопировать", - "createdAt": "Дата и время создания", "details": "Детали магазина", "id": "Идентификатор магазина", "name": "Название магазина", - "suspend": "Заморозить магазин", "url": "URL адрес сайта" }, "shopContract": { @@ -464,6 +424,6 @@ "publicKey": "Содержимое публичного ключа, служащего для проверки авторитативности приходящих на url оповещений", "title": "Публичный ключ" }, - "webhook": "Missing value for 'paymentSection.webhook.webhook'" + "webhook": "Webhook" } } diff --git a/src/assets/i18n/wallet-section/en.json b/src/assets/i18n/wallet-section/en.json index 95e5012bc..141a6f5c3 100644 --- a/src/assets/i18n/wallet-section/en.json +++ b/src/assets/i18n/wallet-section/en.json @@ -12,12 +12,6 @@ "depositPanels": { "header": "Deposit" }, - "depositReverts": { - "loading": "Loading...", - "noReverts": "No reverts", - "revert": "Cancel", - "reverts": "Reverts" - }, "depositRowHeader": { "amount": "Amount", "createdAt": "Created at", @@ -39,7 +33,6 @@ }, "mainInfoFilters": { "depositID": "Deposit ID", - "identityID": "Identity ID", "sourceID": "Source identifier", "walletID": "Wallet" }, @@ -57,8 +50,7 @@ "createdAt": "Created at", "dateRangeDescription": "Report creation period", "errors": { - "downloadReportError": "Failed to load documents", - "identityNotSpecified": "Wallet holder not specified" + "downloadReportError": "Failed to load documents" }, "openCreateReport": "Create report", "period": "Reporting period", @@ -96,7 +88,6 @@ "name": "Name" }, "mainInfo": { - "createdAt": "Created at", "fetchWalletAccountError": "Balance loading error", "name": "Name" }, @@ -141,7 +132,6 @@ "withdrawal": "Withdrawal events" }, "events": "Events", - "identity": "Wallet holder", "successfullyCreated": "Webhook created successfully", "title": "Set up a new webhook", "types": "Set of event types to be notified about", @@ -149,7 +139,6 @@ "wallet": "Wallet (optional)" }, "details": { - "identity": "Wallet holder", "url": "The URL that will receive notifications of events that have occurred", "wallet": "Wallet" }, @@ -161,7 +150,6 @@ "title": "A set of events" }, "headerRow": { - "identity": "Wallet holder", "url": "URL" }, "webhook": "Webhook" @@ -187,7 +175,6 @@ "amountTo": "Deposit amount to", "destinationID": "Identifier of the funds recipient", "externalID": "External ID'", - "identityID": "Identity ID", "status": "Withdrawal status", "walletID": "Wallet", "withdrawalID": "Withdrawal ID" diff --git a/src/assets/i18n/wallet-section/ru.json b/src/assets/i18n/wallet-section/ru.json index 24b6b9fc2..e8c591d43 100644 --- a/src/assets/i18n/wallet-section/ru.json +++ b/src/assets/i18n/wallet-section/ru.json @@ -12,12 +12,6 @@ "depositPanels": { "header": "Пополнение" }, - "depositReverts": { - "loading": "Загрузка...", - "noReverts": "Отмены отсутствуют", - "revert": "Отмена", - "reverts": "Отмены" - }, "depositRowHeader": { "amount": "Сумма", "createdAt": "Дата", @@ -39,7 +33,6 @@ }, "mainInfoFilters": { "depositID": "Идентификатор пополнения", - "identityID": "Идентификатор владельца", "sourceID": "Идентификатор источника", "walletID": "Кошелек" }, @@ -57,8 +50,7 @@ "createdAt": "Дата и время создания", "dateRangeDescription": "Период создания отчетов", "errors": { - "downloadReportError": "Не удалось загрузить документы", - "identityNotSpecified": "Владелец кошелька не указан" + "downloadReportError": "Не удалось загрузить документы" }, "openCreateReport": "Создать отчет", "period": "Период отчетности", @@ -96,7 +88,6 @@ "name": "Название" }, "mainInfo": { - "createdAt": "Дата и время создания", "fetchWalletAccountError": "Ошибка загрузки баланса", "name": "Название" }, @@ -141,7 +132,6 @@ "withdrawal": "События выплаты" }, "events": "События", - "identity": "Владелец кошелька", "successfullyCreated": "Webhook успешно создан", "title": "Установить новый webhook", "types": "Набор типов событий, о которых следует оповещать", @@ -149,7 +139,6 @@ "wallet": "Кошелек (не обязательно)" }, "details": { - "identity": "Владелец кошелька", "url": "URL, на который будут поступать оповещения о произошедших событиях", "wallet": "Кошелек" }, @@ -161,7 +150,6 @@ "title": "Набор событий" }, "headerRow": { - "identity": "Владелец кошелька", "url": "URL" }, "webhook": "Webhook" @@ -187,7 +175,6 @@ "amountTo": "Макс. сумма", "destinationID": "Идентификатор приёмника средств", "externalID": "Внешний идентификатор", - "identityID": "Идентификатор владельца", "status": "Статус вывода", "walletID": "Кошелек", "withdrawalID": "Идентификатор вывода"