Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@angular/router": "^20.1.0",
"@ngneat/input-mask": "^6.1.0",
"@tailwindcss/postcss": "^4.1.11",
"@vality/domain-proto": "^2.0.1-f831d3a.0",
"@vality/domain-proto": "^2.0.1-7a97267.0",
"@vality/fistful-proto": "^2.0.1-7c61ac5.0",
"@vality/machinegun-proto": "^1.0.1-cc2c27c.0",
"@vality/magista-proto": "^2.0.2-f3b4b14.0",
Expand Down
44 changes: 27 additions & 17 deletions src/api/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { metadata$ as scroogeMetadata$ } from '@vality/scrooge-proto';

import { DomainMetadataFormExtensionsService } from '~/components/thrift-api-crud';
import { DomainMetadataViewExtensionsService } from '~/components/thrift-api-crud/domain/domain-thrift-viewer/services/domain-metadata-view-extensions';
import { Services as WachterServices } from '~/services';
import { Service } from '~/services';
import { ThriftService, createThriftServices } from '~/utils';

export interface MetadataThriftService extends ThriftService {
Expand All @@ -34,15 +34,15 @@ export const services = [
// Domain
{
...domainData,
name: 'DMT',
name: Service.DMT,
loader: () => import('@vality/domain-proto/domain_config_v2').then((m) => m.Repository),
namespace: 'domain_config_v2',
service: 'Repository',
public: 'Repository',
},
{
...domainData,
name: 'DMTClient',
name: Service.DMTClient,
loader: () =>
import('@vality/domain-proto/domain_config_v2').then((m) => m.RepositoryClient),
namespace: 'domain_config_v2',
Expand All @@ -51,7 +51,7 @@ export const services = [
},
{
...domainData,
name: 'DMTAuthor',
name: Service.DMTAuthor,
loader: () =>
import('@vality/domain-proto/domain_config_v2').then((m) => m.AuthorManagement),
namespace: 'domain_config_v2',
Expand All @@ -60,15 +60,15 @@ export const services = [
},
{
...domainData,
name: 'Invoicing',
name: Service.Invoicing,
loader: () => import('@vality/domain-proto/payment_processing').then((m) => m.Invoicing),
namespace: 'payment_processing',
service: 'Invoicing',
public: 'Invoicing',
},
{
...domainData,
name: 'PartyManagement',
name: Service.PartyManagement,
loader: () =>
import('@vality/domain-proto/payment_processing').then((m) => m.PartyManagement),
namespace: 'payment_processing',
Expand All @@ -77,23 +77,32 @@ export const services = [
},
{
...domainData,
name: 'WebhookManager',
name: Service.WebhookManager,
loader: () => import('@vality/domain-proto/webhooker').then((m) => m.WebhookManager),
namespace: 'webhooker',
service: 'WebhookManager',
public: 'WebhookManager',
},
{
...domainData,
name: 'Accounter',
name: Service.Accounter,
loader: () => import('@vality/domain-proto/accounter').then((m) => m.Accounter),
namespace: 'accounter',
service: 'Accounter',
public: 'Accounter',
},
{
...domainData,
name: Service.InvoiceTemplating,
loader: () =>
import('@vality/domain-proto/api_extensions').then((m) => m.InvoiceTemplating),
namespace: 'api_extensions',
service: 'InvoiceTemplating',
public: 'InvoiceTemplating',
},
// Repairer
{
name: 'RepairManagement',
name: Service.RepairManagement,
loader: () => import('@vality/repairer-proto/repairer').then((m) => m.RepairManagement),
metadata$: repairerMetadata$,
namespace: 'repairer',
Expand All @@ -102,7 +111,7 @@ export const services = [
},
// Scrooge
{
name: 'Scrooge',
name: Service.Scrooge,
loader: () => import('@vality/scrooge-proto/account_balance').then((m) => m.AccountService),
metadata$: scroogeMetadata$,
namespace: 'account_balance',
Expand All @@ -111,7 +120,7 @@ export const services = [
},
// Magista
{
name: 'MerchantStatistics',
name: Service.MerchantStatistics,
loader: () =>
import('@vality/magista-proto/magista').then((m) => m.MerchantStatisticsService),
metadata$: magistaMetadata$,
Expand All @@ -121,7 +130,7 @@ export const services = [
},
// Machinegun
{
name: 'Automaton',
name: Service.Automaton,
loader: () => import('@vality/machinegun-proto/state_processing').then((m) => m.Automaton),
metadata$: machinegunMetadata$,
namespace: 'state_processing',
Expand All @@ -130,39 +139,39 @@ export const services = [
},
// Fistful
{
name: 'DepositManagement',
name: Service.DepositManagement,
loader: () => import('@vality/fistful-proto/deposit').then((m) => m.Management),
metadata$: fistfulMetadata$,
namespace: 'deposit',
service: 'Management',
public: 'DepositManagement',
},
{
name: 'FistfulStatistics',
name: Service.FistfulStatistics,
loader: () => import('@vality/fistful-proto/fistful_stat').then((m) => m.FistfulStatistics),
metadata$: fistfulMetadata$,
namespace: 'fistful_stat',
service: 'FistfulStatistics',
public: 'FistfulStatistics',
},
{
name: 'WithdrawalManagement',
name: Service.WithdrawalManagement,
loader: () => import('@vality/fistful-proto/withdrawal').then((m) => m.Management),
metadata$: fistfulMetadata$,
namespace: 'withdrawal',
service: 'Management',
public: 'WithdrawalManagement',
},
{
name: 'SourceManagement',
name: Service.SourceManagement,
loader: () => import('@vality/fistful-proto/source').then((m) => m.Management),
metadata$: fistfulMetadata$,
namespace: 'source',
service: 'Management',
public: 'SourceManagement',
},
{
name: WachterServices.WalletsWebhookManager,
name: Service.WalletsWebhookManager,
loader: () => import('@vality/fistful-proto/webhooker').then((m) => m.WebhookManager),
metadata$: fistfulMetadata$,
namespace: 'webhooker',
Expand Down Expand Up @@ -191,4 +200,5 @@ export const {
WebhookManager: ThriftShopWebhooksManagementService,
WalletsWebhookManager: ThriftWalletWebhooksManagementService,
Accounter: ThriftAccountManagementService,
InvoiceTemplating: ThriftInvoiceTemplatingService,
} = injectableServices;
6 changes: 3 additions & 3 deletions src/app/app-routes.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import { z } from 'zod';

import { Route, Services } from '~/services';
import { Route, Service } from '~/services';

type SectionPageRoutes = Record<string, Record<string, Route>>;

export const APP_ROUTES = {
domain: {
root: new Route('domain', {
services: [Services.DMT],
services: [Service.DMT],
loadComponent: () => import('./domain-config').then((m) => m.DomainConfigComponent),
queryParams: z.object({ type: z.string() }),
}),
},
parties: {
root: new Route('parties', {
services: [Services.DMT],
services: [Service.DMT],
loadComponent: () => import('./parties').then((m) => m.PartiesComponent),
queryParams: z.object({ type: z.string() }),
}),
Expand Down
4 changes: 2 additions & 2 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { ThriftRepositoryService } from '~/api/services';
import { SidenavInfoModule, SidenavInfoService } from '~/components/sidenav-info';
import { getLimitedDomainObjectDetails } from '~/components/thrift-api-crud';
import { DomainObjectCardComponent } from '~/components/thrift-api-crud/domain';
import { KeycloakUserService, Services } from '~/services';
import { KeycloakUserService, Service } from '~/services';
import { LOGGING } from '~/utils';

import { APP_ROUTES } from './app-routes';
Expand All @@ -40,7 +40,7 @@ import { ROUTING_CONFIG as TERMS_ROUTING_CONFIG } from './terms/routing-config';
import { ROUTING_CONFIG as WALLETS_ROUTING_CONFIG } from './wallets/routing-config';
import { ROUTING_CONFIG as WITHDRAWALS_ROUTING_CONFIG } from './withdrawals/routing-config';

function isHidden(services: Services[]): BaseLink['isHidden'] {
function isHidden(services: Service[]): BaseLink['isHidden'] {
const keycloakUserService = inject(KeycloakUserService);
return !keycloakUserService.hasServiceRole(...services);
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/deposits/deposit/routing-config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RoutingConfig, Services } from '~/services';
import { RoutingConfig, Service } from '~/services';

export const ROUTING_CONFIG: RoutingConfig = {
services: [Services.FistfulStatistics],
services: [Service.FistfulStatistics],
};
4 changes: 2 additions & 2 deletions src/app/deposits/routing-config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RoutingConfig, Services } from '~/services';
import { RoutingConfig, Service } from '~/services';

export const ROUTING_CONFIG: RoutingConfig = {
services: [Services.FistfulStatistics],
services: [Service.FistfulStatistics],
};
4 changes: 2 additions & 2 deletions src/app/machines/routing-config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RoutingConfig, Services } from '~/services';
import { RoutingConfig, Service } from '~/services';

export const ROUTING_CONFIG: RoutingConfig = {
services: [Services.RepairManagement],
services: [Service.RepairManagement],
};
4 changes: 2 additions & 2 deletions src/app/parties/party/routing-config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RoutingConfig, Services } from '~/services';
import { RoutingConfig, Service } from '~/services';

export const ROUTING_CONFIG: RoutingConfig = {
services: [Services.DMT],
services: [Service.DMT],
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RoutingConfig, Services } from '~/services';
import { RoutingConfig, Service } from '~/services';

export const ROUTING_CONFIG: RoutingConfig = {
services: [Services.DMT],
services: [Service.DMT],
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RoutingConfig, Services } from '~/services';
import { RoutingConfig, Service } from '~/services';

export const ROUTING_CONFIG: RoutingConfig = {
services: [Services.DMT],
services: [Service.DMT],
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RoutingConfig, Services } from '~/services';
import { RoutingConfig, Service } from '~/services';

export const ROUTING_CONFIG: RoutingConfig = {
services: [Services.DMT],
services: [Service.DMT],
};
4 changes: 2 additions & 2 deletions src/app/parties/party/shops/routing-config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RoutingConfig, Services } from '~/services';
import { RoutingConfig, Service } from '~/services';

export const ROUTING_CONFIG: RoutingConfig = {
services: [Services.DMT],
services: [Service.DMT],
};
4 changes: 2 additions & 2 deletions src/app/parties/party/wallet-webhooks/routing-config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RoutingConfig, Services } from '~/services';
import { RoutingConfig, Service } from '~/services';

export const ROUTING_CONFIG: RoutingConfig = {
services: [Services.WalletsWebhookManager],
services: [Service.WalletsWebhookManager],
};
4 changes: 2 additions & 2 deletions src/app/parties/party/webhooks/routing-config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RoutingConfig, Services } from '~/services';
import { RoutingConfig, Service } from '~/services';

export const ROUTING_CONFIG: RoutingConfig = {
services: [Services.WebhookManager],
services: [Service.WebhookManager],
};
4 changes: 2 additions & 2 deletions src/app/payments/payment/routing-config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RoutingConfig, Services } from '~/services';
import { RoutingConfig, Service } from '~/services';

export const ROUTING_CONFIG: RoutingConfig = {
services: [Services.MerchantStatistics],
services: [Service.MerchantStatistics],
};
26 changes: 19 additions & 7 deletions src/app/payments/payments.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,28 @@
(selectedChange)="selected$.next($event)"
(update)="reload($event ?? {})"
>
<button [disabled]="!(selected$ | async)?.length" mat-button (click)="failMachines()">
Fail machines
</button>
<button mat-button (click)="createPaymentAdjustments()">Create adjustments by file</button>
<button
[disabled]="!(selected$ | async)?.length"
mat-flat-button
(click)="createPaymentAdjustment()"
[matBadge]="(selected$ | async)?.length || ''"
mat-button
(click)="failMachines()"
>
Create adjustments
Fail machines
</button>
<button mat-button (click)="createInvoiceTemplate()">Create invoice template</button>
@if ((selected$ | async)?.length) {
<button
[disabled]="!(selected$ | async)?.length"
[matBadge]="(selected$ | async)?.length"
mat-flat-button
(click)="createPaymentAdjustment()"
>
Create adjustments
</button>
} @else {
<button mat-flat-button matBadge="CSV" (click)="createPaymentAdjustments()">
Create adjustments
</button>
}
</cc-payments-table>
</cc-page-layout>
7 changes: 7 additions & 0 deletions src/app/payments/payments.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { CommonModule } from '@angular/common';
import { Component, DestroyRef, OnInit, inject } from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { FormsModule, NonNullableFormBuilder, ReactiveFormsModule } from '@angular/forms';
import { MatBadgeModule } from '@angular/material/badge';
import { MatButtonModule } from '@angular/material/button';

import { StatPayment } from '@vality/magista-proto/magista';
Expand All @@ -33,6 +34,7 @@ import {
} from '@vality/matez';
import { ThriftFormExtension, ThriftFormModule, isTypeWithAliases } from '@vality/ng-thrift';

import { CreateInvoiceTemplateDialogComponent } from '~/components/create-invoice-template-dialog';
import { FailMachinesDialogComponent, Type } from '~/components/fail-machines-dialog';
import { MerchantFieldModule } from '~/components/merchant-field/merchant-field.module';
import { PageLayoutModule } from '~/components/page-layout';
Expand Down Expand Up @@ -71,6 +73,7 @@ interface Filters {
FormsModule,
MagistaThriftFormComponent,
PaymentsTableComponent,
MatBadgeModule,
],
})
export class PaymentsComponent implements OnInit {
Expand Down Expand Up @@ -222,4 +225,8 @@ export class PaymentsComponent implements OnInit {
}
});
}

createInvoiceTemplate() {
this.dialogService.open(CreateInvoiceTemplateDialogComponent);
}
}
Loading
Loading