mirror of
https://github.com/valitydev/control-center.git
synced 2024-11-06 02:25:17 +00:00
IMP-230: Init tariffs api (#358)
This commit is contained in:
parent
ba159b62df
commit
4e3e09e257
6
package-lock.json
generated
6
package-lock.json
generated
@ -22,6 +22,7 @@
|
||||
"@ngneat/input-mask": "6.0.0",
|
||||
"@vality/deanonimus-proto": "2.0.1-2a02d87.0",
|
||||
"@vality/domain-proto": "2.0.1-b04aba8.0",
|
||||
"@vality/dominator-proto": "1.0.0",
|
||||
"@vality/fistful-proto": "2.0.1-6600be9.0",
|
||||
"@vality/machinegun-proto": "1.0.0",
|
||||
"@vality/magista-proto": "2.0.2-28d11b9.0",
|
||||
@ -6421,6 +6422,11 @@
|
||||
"resolved": "https://registry.npmjs.org/@vality/domain-proto/-/domain-proto-2.0.1-b04aba8.0.tgz",
|
||||
"integrity": "sha512-AKD5RkqiS+31hTUaLfh7I3vgYZ2yytwxp8J1jQZ7iPWURz/m5+6Yg4YKNj8Vyyxu3yzO13FxxPUnkTh/poCDWg=="
|
||||
},
|
||||
"node_modules/@vality/dominator-proto": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@vality/dominator-proto/-/dominator-proto-1.0.0.tgz",
|
||||
"integrity": "sha512-N7gTGnr419mwnZH3FB4kTIJUgbFoVzKUHKNIyzjjJuPiSnOEaWr/sj8cFfDdyuHUkpHb4CKXJ+QdF686UtGKGw=="
|
||||
},
|
||||
"node_modules/@vality/eslint-config": {
|
||||
"version": "8.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@vality/eslint-config/-/eslint-config-8.2.0.tgz",
|
||||
|
@ -30,6 +30,7 @@
|
||||
"@ngneat/input-mask": "6.0.0",
|
||||
"@vality/deanonimus-proto": "2.0.1-2a02d87.0",
|
||||
"@vality/domain-proto": "2.0.1-b04aba8.0",
|
||||
"@vality/dominator-proto": "1.0.0",
|
||||
"@vality/fistful-proto": "2.0.1-6600be9.0",
|
||||
"@vality/machinegun-proto": "1.0.0",
|
||||
"@vality/magista-proto": "2.0.2-28d11b9.0",
|
||||
|
57
src/app/api/dominator/dominator.service.ts
Normal file
57
src/app/api/dominator/dominator.service.ts
Normal file
@ -0,0 +1,57 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import {
|
||||
dominator_DominatorServiceCodegenClient,
|
||||
ThriftAstMetadata,
|
||||
dominator_DominatorService,
|
||||
dominator,
|
||||
} from '@vality/dominator-proto';
|
||||
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 DominatorService {
|
||||
private client$: Observable<dominator_DominatorServiceCodegenClient>;
|
||||
|
||||
constructor(
|
||||
private keycloakTokenInfoService: KeycloakTokenInfoService,
|
||||
configService: ConfigService,
|
||||
) {
|
||||
const headers$ = this.keycloakTokenInfoService.info$.pipe(
|
||||
map(toWachterHeaders('Dominator')),
|
||||
);
|
||||
const metadata$ = from(
|
||||
import('@vality/fistful-proto/metadata.json').then(
|
||||
(m) => m.default as ThriftAstMetadata[],
|
||||
),
|
||||
);
|
||||
this.client$ = combineLatest([metadata$, headers$]).pipe(
|
||||
switchMap(([metadata, headers]) =>
|
||||
dominator_DominatorService({
|
||||
metadata,
|
||||
headers,
|
||||
logging: environment.logging.requests,
|
||||
...configService.config.api.wachter,
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
SearchShopTermSets(shopSearchQuery: dominator.ShopSearchQuery) {
|
||||
return this.client$.pipe(switchMap((c) => c.SearchShopTermSets(shopSearchQuery)));
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
SearchWalletTermSets(walletSearchQuery: dominator.WalletSearchQuery) {
|
||||
return this.client$.pipe(switchMap((c) => c.SearchWalletTermSets(walletSearchQuery)));
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
SearchTerminalTermSets(terminalSearchQuery: dominator.TerminalSearchQuery) {
|
||||
return this.client$.pipe(switchMap((c) => c.SearchTerminalTermSets(terminalSearchQuery)));
|
||||
}
|
||||
}
|
1
src/app/api/dominator/index.ts
Normal file
1
src/app/api/dominator/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export * from './dominator.service';
|
@ -36,7 +36,7 @@
|
||||
>
|
||||
<ng-container
|
||||
*ngSwitchCase="'party_modification'"
|
||||
[ngSwitch]="modificationUnit.modification | ccUnionValue | ngtUnionKey"
|
||||
[ngSwitch]="modificationUnit.modification | ngtUnionValue | ngtUnionKey"
|
||||
>
|
||||
<cc-shop-modification-timeline-item
|
||||
*ngSwitchCase="'shop_modification'"
|
||||
@ -55,7 +55,7 @@
|
||||
</ng-container>
|
||||
<ng-container
|
||||
*ngSwitchCase="'claim_modification'"
|
||||
[ngSwitch]="modificationUnit.modification | ccUnionValue | ngtUnionKey"
|
||||
[ngSwitch]="modificationUnit.modification | ngtUnionValue | ngtUnionKey"
|
||||
>
|
||||
<cc-status-modification-timeline-item
|
||||
*ngSwitchCase="'status_modification'"
|
||||
|
Loading…
Reference in New Issue
Block a user