diff --git a/angular.json b/angular.json index 43b57471..f1778846 100644 --- a/angular.json +++ b/angular.json @@ -46,7 +46,6 @@ "@vality/machinegun-proto", "@vality/magista-proto", "@vality/messages-proto", - "@vality/payout-manager-proto", "@vality/repairer-proto", "@vality/fistful-proto", "@vality/file-storage-proto", diff --git a/package-lock.json b/package-lock.json index 9c581df3..b0aee448 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,14 +21,13 @@ "@angular/router": "18.2.4", "@ngneat/input-mask": "6.0.0", "@vality/deanonimus-proto": "2.0.1-2a02d87.0", - "@vality/domain-proto": "2.0.1-e5d3c83.0", + "@vality/domain-proto": "2.0.1-7762f6c.0", "@vality/dominator-proto": "1.0.1-41bee97.0", "@vality/fistful-proto": "2.0.1-88e69a5.0", "@vality/machinegun-proto": "1.0.0", "@vality/magista-proto": "2.0.2-ec1bdb9.0", "@vality/ng-core": "18.3.1-pr-68-2c4891d.0", "@vality/ng-thrift": "18.0.1-pr-13-bdb6d51.0", - "@vality/payout-manager-proto": "2.0.1-eb4091a.0", "@vality/repairer-proto": "2.0.2-07b73e9.0", "@vality/scrooge-proto": "0.1.1-9ce7fc6.0", "@vality/thrift-ts": "2.4.1-8ad5123.0", @@ -5926,9 +5925,9 @@ "integrity": "sha512-mokuK6w+ExASdDE6+L9bM2SaS0yVPSyBvXavY8rRtNzZgVdmj7KSRiyGmXz41grhS6jcvD8aR85Nj4o7/iogmQ==" }, "node_modules/@vality/domain-proto": { - "version": "2.0.1-e5d3c83.0", - "resolved": "https://registry.npmjs.org/@vality/domain-proto/-/domain-proto-2.0.1-e5d3c83.0.tgz", - "integrity": "sha512-G6FpLCyx7kZZIox90PFUe0FsiAzUTtHZ42gqK7pTyHn2mOzampUuQyyn9MwPkQv6atGLXXiSzEY+qmZIWWkvHQ==" + "version": "2.0.1-7762f6c.0", + "resolved": "https://registry.npmjs.org/@vality/domain-proto/-/domain-proto-2.0.1-7762f6c.0.tgz", + "integrity": "sha512-QYwo9fnw6Yx7L55+FRMNAmWNPYB+7QgXDrPAhdOkd/6knn0qVXdvN0/f676zAtUjOkfDGAddBn/zRF+/e7A6KQ==" }, "node_modules/@vality/dominator-proto": { "version": "1.0.1-41bee97.0", @@ -6018,11 +6017,6 @@ "utility-types": "^3.0.0" } }, - "node_modules/@vality/payout-manager-proto": { - "version": "2.0.1-eb4091a.0", - "resolved": "https://registry.npmjs.org/@vality/payout-manager-proto/-/payout-manager-proto-2.0.1-eb4091a.0.tgz", - "integrity": "sha512-hP8sKbNxmBHXP64eUK6FPXFB1sJQ8eIwnfz6sqObmNbeyZDRh0UYufyTJAgAmtjOWhAxievWyoU8OG6glgoEuw==" - }, "node_modules/@vality/prettier-config": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@vality/prettier-config/-/prettier-config-3.1.0.tgz", diff --git a/package.json b/package.json index c315caf9..679d5fb4 100644 --- a/package.json +++ b/package.json @@ -30,14 +30,13 @@ "@angular/router": "18.2.4", "@ngneat/input-mask": "6.0.0", "@vality/deanonimus-proto": "2.0.1-2a02d87.0", - "@vality/domain-proto": "2.0.1-e5d3c83.0", + "@vality/domain-proto": "2.0.1-7762f6c.0", "@vality/dominator-proto": "1.0.1-41bee97.0", "@vality/fistful-proto": "2.0.1-88e69a5.0", "@vality/machinegun-proto": "1.0.0", "@vality/magista-proto": "2.0.2-ec1bdb9.0", "@vality/ng-core": "18.3.1-pr-68-2c4891d.0", "@vality/ng-thrift": "18.0.1-pr-13-bdb6d51.0", - "@vality/payout-manager-proto": "2.0.1-eb4091a.0", "@vality/repairer-proto": "2.0.2-07b73e9.0", "@vality/scrooge-proto": "0.1.1-9ce7fc6.0", "@vality/thrift-ts": "2.4.1-8ad5123.0", diff --git a/src/app/api/payout-manager/index.ts b/src/app/api/payout-manager/index.ts deleted file mode 100644 index 3c13bf4b..00000000 --- a/src/app/api/payout-manager/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './payout-management.service'; diff --git a/src/app/api/payout-manager/payout-management.service.ts b/src/app/api/payout-manager/payout-management.service.ts deleted file mode 100644 index f07e57d0..00000000 --- a/src/app/api/payout-manager/payout-management.service.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { Injectable } from '@angular/core'; -import { - payout_manager_PayoutManagementCodegenClient, - ThriftAstMetadata, - payout_manager_PayoutManagement, -} from '@vality/payout-manager-proto'; -import { PayoutParams, Payout, PayoutID } from '@vality/payout-manager-proto/payout_manager'; -import { combineLatest, from, map, Observable, switchMap } from 'rxjs'; - -import { KeycloakTokenInfoService, toWachterHeaders } from '@cc/app/shared/services'; -import { environment } from '@cc/environments/environment'; - -import { ConfigService } from '../../core/config.service'; - -@Injectable({ providedIn: 'root' }) -export class PayoutManagementService { - private client$: Observable; - - constructor( - private keycloakTokenInfoService: KeycloakTokenInfoService, - configService: ConfigService, - ) { - const headers$ = this.keycloakTokenInfoService.info$.pipe( - map(toWachterHeaders('PayoutManagement')), - ); - const metadata$ = from( - import('@vality/payout-manager-proto/metadata.json').then( - (m) => m.default as ThriftAstMetadata[], - ), - ); - this.client$ = combineLatest([metadata$, headers$]).pipe( - switchMap(([metadata, headers]) => - payout_manager_PayoutManagement({ - metadata, - headers, - logging: environment.logging.requests, - ...configService.config.api.wachter, - }), - ), - ); - } - - // eslint-disable-next-line @typescript-eslint/naming-convention - CreatePayout(payoutParams: PayoutParams): Observable { - return this.client$.pipe(switchMap((c) => c.CreatePayout(payoutParams))); - } - - // eslint-disable-next-line @typescript-eslint/naming-convention - GetPayout(payoutId: PayoutID): Observable { - return this.client$.pipe(switchMap((c) => c.GetPayout(payoutId))); - } - - // eslint-disable-next-line @typescript-eslint/naming-convention - ConfirmPayout(payoutId: PayoutID): Observable { - return this.client$.pipe(switchMap((c) => c.ConfirmPayout(payoutId))); - } - - // eslint-disable-next-line @typescript-eslint/naming-convention - CancelPayout(payoutId: PayoutID, details: string): Observable { - return this.client$.pipe(switchMap((c) => c.CancelPayout(payoutId, details))); - } -} diff --git a/src/app/sections/claim/claim.component.html b/src/app/sections/claim/claim.component.html index 4461d477..850ad056 100644 --- a/src/app/sections/claim/claim.component.html +++ b/src/app/sections/claim/claim.component.html @@ -92,7 +92,10 @@ Change status - + + diff --git a/src/app/sections/claim/claim.component.ts b/src/app/sections/claim/claim.component.ts index 18c25bff..af7cc9f7 100644 --- a/src/app/sections/claim/claim.component.ts +++ b/src/app/sections/claim/claim.component.ts @@ -115,13 +115,13 @@ export class ClaimComponent { }); } - createShop() { + createShop(withoutPayout = true) { combineLatest([this.party$, this.claim$]) .pipe( first(), switchMap(([party, claim]) => this.dialogService - .open(CreateShopDialogComponent, { party, claim }) + .open(CreateShopDialogComponent, { party, claim, withoutPayout }) .afterClosed(), ), takeUntilDestroyed(this.destroyRef), diff --git a/src/app/sections/claim/components/create-shop-dialog/create-shop-dialog.component.ts b/src/app/sections/claim/components/create-shop-dialog/create-shop-dialog.component.ts index 43dcb8a8..48773acb 100644 --- a/src/app/sections/claim/components/create-shop-dialog/create-shop-dialog.component.ts +++ b/src/app/sections/claim/components/create-shop-dialog/create-shop-dialog.component.ts @@ -74,7 +74,10 @@ const DEFAULT_SHOP_LOCATION: ShopLocation = { styles: ``, }) export class CreateShopDialogComponent - extends DialogSuperclass + extends DialogSuperclass< + CreateShopDialogComponent, + { party: Party; claim: Claim; withoutPayout: boolean } + > implements OnInit { static defaultDialogConfig = DEFAULT_DIALOG_CONFIG.large; @@ -185,27 +188,31 @@ export class CreateShopDialogComponent }, }, }, - { - party_modification: { - contract_modification: { - id: contractId, - modification: { - payout_tool_modification: { - payout_tool_id: payoutToolId, - modification: { - creation: { - currency: currency, - tool_info: { - russian_bank_account: - DEFAULT_RUSSIAN_BANK_ACCOUNT, - }, - }, - }, - }, - }, - }, - }, - }, + ...(this.dialogData.withoutPayout + ? [] + : [ + { + party_modification: { + contract_modification: { + id: contractId, + modification: { + payout_tool_modification: { + payout_tool_id: payoutToolId, + modification: { + creation: { + currency: currency, + tool_info: { + russian_bank_account: + DEFAULT_RUSSIAN_BANK_ACCOUNT, + }, + }, + }, + }, + }, + }, + }, + }, + ]), { party_modification: { shop_modification: { @@ -216,7 +223,9 @@ export class CreateShopDialogComponent category: category, location: DEFAULT_SHOP_LOCATION, contract_id: contractId, - payout_tool_id: payoutToolId, + ...(this.dialogData.withoutPayout + ? {} + : { payout_tool_id: payoutToolId }), }, }, }, diff --git a/src/app/shared/components/index.ts b/src/app/shared/components/index.ts index 9f78fcde..a815ed28 100644 --- a/src/app/shared/components/index.ts +++ b/src/app/shared/components/index.ts @@ -1,7 +1,5 @@ export * from './status'; export * from './shop-field'; export * from './shop-details'; -export * from './payout-tool-details'; -export * from './payout-tool-field'; export * from './page-layout'; export * from './wallet-field'; diff --git a/src/app/shared/components/payout-tool-details/components/international-bank-account-details/international-bank-account-details.component.html b/src/app/shared/components/payout-tool-details/components/international-bank-account-details/international-bank-account-details.component.html deleted file mode 100644 index 439c2b1b..00000000 --- a/src/app/shared/components/payout-tool-details/components/international-bank-account-details/international-bank-account-details.component.html +++ /dev/null @@ -1,11 +0,0 @@ -
- {{ internationalBankAccount.bank.bic }} - {{ internationalBankAccount.bank.country }} - {{ internationalBankAccount.bank.address }} - {{ internationalBankAccount.bank.aba_rtn }} - {{ - internationalBankAccount.account_holder - }} - {{ internationalBankAccount.iban }} - {{ internationalBankAccount.number }} -
diff --git a/src/app/shared/components/payout-tool-details/components/international-bank-account-details/international-bank-account-details.component.ts b/src/app/shared/components/payout-tool-details/components/international-bank-account-details/international-bank-account-details.component.ts deleted file mode 100644 index b90543a9..00000000 --- a/src/app/shared/components/payout-tool-details/components/international-bank-account-details/international-bank-account-details.component.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Component, Input } from '@angular/core'; -import { InternationalBankAccount } from '@vality/domain-proto/domain'; - -@Component({ - selector: 'cc-international-bank-account-details', - templateUrl: './international-bank-account-details.component.html', -}) -export class InternationalBankAccountDetailsComponent { - @Input() internationalBankAccount: InternationalBankAccount; -} diff --git a/src/app/shared/components/payout-tool-details/components/russian-bank-account-details/russian-bank-account-details.component.html b/src/app/shared/components/payout-tool-details/components/russian-bank-account-details/russian-bank-account-details.component.html deleted file mode 100644 index 9d044b49..00000000 --- a/src/app/shared/components/payout-tool-details/components/russian-bank-account-details/russian-bank-account-details.component.html +++ /dev/null @@ -1,8 +0,0 @@ -
- {{ russianBankAccount.bank_name }} - {{ russianBankAccount.bank_bik }} - {{ - russianBankAccount.bank_post_account - }} - {{ russianBankAccount.account }} -
diff --git a/src/app/shared/components/payout-tool-details/components/russian-bank-account-details/russian-bank-account-details.component.ts b/src/app/shared/components/payout-tool-details/components/russian-bank-account-details/russian-bank-account-details.component.ts deleted file mode 100644 index 0896ef98..00000000 --- a/src/app/shared/components/payout-tool-details/components/russian-bank-account-details/russian-bank-account-details.component.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Component, Input } from '@angular/core'; -import { RussianBankAccount } from '@vality/domain-proto/domain'; - -@Component({ - selector: 'cc-russian-bank-account-details', - templateUrl: './russian-bank-account-details.component.html', -}) -export class RussianBankAccountDetailsComponent { - @Input() russianBankAccount: RussianBankAccount; -} diff --git a/src/app/shared/components/payout-tool-details/index.ts b/src/app/shared/components/payout-tool-details/index.ts deleted file mode 100644 index ceb9cd3e..00000000 --- a/src/app/shared/components/payout-tool-details/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './payout-tool-details.module'; diff --git a/src/app/shared/components/payout-tool-details/payout-tool-details.component.html b/src/app/shared/components/payout-tool-details/payout-tool-details.component.html deleted file mode 100644 index 9ecac4b8..00000000 --- a/src/app/shared/components/payout-tool-details/payout-tool-details.component.html +++ /dev/null @@ -1,48 +0,0 @@ -
-
- {{ payoutTool.id }} - {{ payoutTool.created_at }} - {{ payoutTool.currency?.symbolic_code }} -
- - -

International bank account

- - -

Correspondent account

-
- -
-
-
- - -

Russian bank account

- -
- - -

Wallet

- {{ - payoutTool.payout_tool_info.wallet_info.wallet_id - }} -
- - -

Payment institution account

-
-
diff --git a/src/app/shared/components/payout-tool-details/payout-tool-details.component.ts b/src/app/shared/components/payout-tool-details/payout-tool-details.component.ts deleted file mode 100644 index 0481bdda..00000000 --- a/src/app/shared/components/payout-tool-details/payout-tool-details.component.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Component, Input } from '@angular/core'; -import { PayoutTool } from '@vality/domain-proto/domain'; - -@Component({ - selector: 'cc-payout-tool-details', - templateUrl: './payout-tool-details.component.html', -}) -export class PayoutToolDetailsComponent { - @Input() payoutTool: PayoutTool; -} diff --git a/src/app/shared/components/payout-tool-details/payout-tool-details.module.ts b/src/app/shared/components/payout-tool-details/payout-tool-details.module.ts deleted file mode 100644 index 2a33d9a6..00000000 --- a/src/app/shared/components/payout-tool-details/payout-tool-details.module.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { ThriftPipesModule } from '@vality/ng-thrift'; - -import { DetailsItemModule } from '@cc/components/details-item'; - -import { InternationalBankAccountDetailsComponent } from './components/international-bank-account-details/international-bank-account-details.component'; -import { RussianBankAccountDetailsComponent } from './components/russian-bank-account-details/russian-bank-account-details.component'; -import { PayoutToolDetailsComponent } from './payout-tool-details.component'; - -@NgModule({ - declarations: [ - PayoutToolDetailsComponent, - RussianBankAccountDetailsComponent, - InternationalBankAccountDetailsComponent, - ], - imports: [CommonModule, DetailsItemModule, ThriftPipesModule], - exports: [PayoutToolDetailsComponent], -}) -export class PayoutToolDetailsModule {} diff --git a/src/app/shared/components/payout-tool-field/index.ts b/src/app/shared/components/payout-tool-field/index.ts deleted file mode 100644 index 417a0d28..00000000 --- a/src/app/shared/components/payout-tool-field/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './payout-tool-field.module'; diff --git a/src/app/shared/components/payout-tool-field/payout-tool-field.component.html b/src/app/shared/components/payout-tool-field/payout-tool-field.component.html deleted file mode 100644 index fd0953f7..00000000 --- a/src/app/shared/components/payout-tool-field/payout-tool-field.component.html +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/src/app/shared/components/payout-tool-field/payout-tool-field.component.ts b/src/app/shared/components/payout-tool-field/payout-tool-field.component.ts deleted file mode 100644 index 1572dc97..00000000 --- a/src/app/shared/components/payout-tool-field/payout-tool-field.component.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { Component, Input, OnInit, booleanAttribute } from '@angular/core'; -import { PayoutTool } from '@vality/domain-proto/domain'; -import { PartyID, ShopID } from '@vality/domain-proto/payment_processing'; -import { - FormControlSuperclass, - Option, - createControlProviders, - NotifyLogService, - handleError, -} from '@vality/ng-core'; -import { BehaviorSubject, combineLatest, defer, Observable, of, switchMap } from 'rxjs'; -import { map, shareReplay } from 'rxjs/operators'; - -import { PartyManagementService } from '@cc/app/api/payment-processing'; - -@Component({ - selector: 'cc-payout-tool-field', - templateUrl: 'payout-tool-field.component.html', - providers: createControlProviders(() => PayoutToolFieldComponent), -}) -export class PayoutToolFieldComponent - extends FormControlSuperclass - implements OnInit -{ - @Input() label: string; - @Input({ transform: booleanAttribute }) required: boolean; - @Input() set partyId(partyId: PartyID) { - this.partyId$.next(partyId); - } - @Input() set shopId(shopId: ShopID) { - this.shopId$.next(shopId); - } - - partyId$ = new BehaviorSubject(null); - shopId$ = new BehaviorSubject(null); - options$: Observable[]> = defer(() => this.payoutTools$).pipe( - map((payoutTools) => - payoutTools.map((t) => ({ label: t.id, value: t.id, description: t.id })), - ), - shareReplay({ refCount: true, bufferSize: 1 }), - ); - - private payoutTools$ = combineLatest([this.partyId$, this.shopId$]).pipe( - switchMap(([partyId, shopId]) => - partyId && shopId - ? this.partyManagementService - .GetShop(partyId, shopId) - .pipe( - switchMap(({ contract_id }) => - this.partyManagementService.GetContract(partyId, contract_id), - ), - map((contract) => contract.payout_tools), - ) - .pipe(handleError(this.log.error, [])) - : of([]), - ), - shareReplay({ refCount: true, bufferSize: 1 }), - ); - - constructor( - private partyManagementService: PartyManagementService, - private log: NotifyLogService, - ) { - super(); - } -} diff --git a/src/app/shared/components/payout-tool-field/payout-tool-field.module.ts b/src/app/shared/components/payout-tool-field/payout-tool-field.module.ts deleted file mode 100644 index 4acac148..00000000 --- a/src/app/shared/components/payout-tool-field/payout-tool-field.module.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatAutocompleteModule } from '@angular/material/autocomplete'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatInputModule } from '@angular/material/input'; -import { SelectFieldModule } from '@vality/ng-core'; - -import { PayoutToolFieldComponent } from './payout-tool-field.component'; - -@NgModule({ - imports: [ - MatFormFieldModule, - ReactiveFormsModule, - MatAutocompleteModule, - MatInputModule, - CommonModule, - SelectFieldModule, - ], - declarations: [PayoutToolFieldComponent], - exports: [PayoutToolFieldComponent], -}) -export class PayoutToolFieldModule {} diff --git a/src/app/shared/services/app-auth-guard/services.ts b/src/app/shared/services/app-auth-guard/services.ts index a738c4bc..58afd890 100644 --- a/src/app/shared/services/app-auth-guard/services.ts +++ b/src/app/shared/services/app-auth-guard/services.ts @@ -7,6 +7,5 @@ export enum Services { ClaimManagement = 'ClaimManagement', Invoicing = 'Invoicing', RepairManagement = 'RepairManagement', - PayoutManagement = 'PayoutManagement', Dominator = 'Dominator', }