From f6fad3f15cdd4b83099fcd43e67193b5df3108e9 Mon Sep 17 00:00:00 2001 From: Rinat Arsaev <11846445+A77AY@users.noreply.github.com> Date: Wed, 21 Jan 2026 15:31:00 +0700 Subject: [PATCH 01/10] bump domain --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index ec7ee2f9b..a870c9138 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,7 +22,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", @@ -5955,9 +5955,9 @@ } }, "node_modules/@vality/domain-proto": { - "version": "2.0.1-f831d3a.0", - "resolved": "https://registry.npmjs.org/@vality/domain-proto/-/domain-proto-2.0.1-f831d3a.0.tgz", - "integrity": "sha512-pmgYCVo/rr/J5ACotPBg+i1ZcoQ4gtbl/ssLWi4/GGuYbzBuJHi/dm5d6z6k05e0VvEUTp0ucJN5Lk0q0P9Q8g==", + "version": "2.0.1-7a97267.0", + "resolved": "https://registry.npmjs.org/@vality/domain-proto/-/domain-proto-2.0.1-7a97267.0.tgz", + "integrity": "sha512-77vfl9TEjn2ZTSWLNAQNsgDSWhr6oWr5gLze98HPMUGgCC2Sg886e0VWe7KXZcluZ+mgy7G6cSChvE7D925v8g==", "license": "Apache-2.0" }, "node_modules/@vality/fistful-proto": { diff --git a/package.json b/package.json index baafe5ef2..49a421ecd 100644 --- a/package.json +++ b/package.json @@ -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", From 05bcec7391e23b96592e58086d1a7fce8da84fef Mon Sep 17 00:00:00 2001 From: Rinat Arsaev <11846445+A77AY@users.noreply.github.com> Date: Wed, 21 Jan 2026 16:34:07 +0700 Subject: [PATCH 02/10] init InvoiceTemplating --- src/api/services.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/api/services.ts b/src/api/services.ts index 7d410cfc5..c3e76ea19 100644 --- a/src/api/services.ts +++ b/src/api/services.ts @@ -91,6 +91,15 @@ export const services = [ service: 'Accounter', public: 'Accounter', }, + { + ...domainData, + name: 'InvoiceTemplating', + loader: () => + import('@vality/domain-proto/api_extensions').then((m) => m.InvoiceTemplating), + namespace: 'api_extensions', + service: 'InvoiceTemplating', + public: 'InvoiceTemplating', + }, // Repairer { name: 'RepairManagement', @@ -191,4 +200,5 @@ export const { WebhookManager: ThriftShopWebhooksManagementService, WalletsWebhookManager: ThriftWalletWebhooksManagementService, Accounter: ThriftAccountManagementService, + InvoiceTemplating: ThriftInvoiceTemplatingService, } = injectableServices; From 82aab3feb32c936180502e112a10eaaf28c3ab2a Mon Sep 17 00:00:00 2001 From: Rinat Arsaev <11846445+A77AY@users.noreply.github.com> Date: Wed, 21 Jan 2026 16:44:11 +0700 Subject: [PATCH 03/10] upd service enum --- src/api/services.ts | 3 +-- src/app/app.component.ts | 4 ++-- src/app/invoice-templates/routing-config.ts | 5 +++++ src/app/terms/routing-config.ts | 2 +- src/services/app-auth-guard/services.ts | 22 +++++++++---------- .../app-auth-guard/types/routing-config.ts | 4 ++-- src/services/navigate/models/route.ts | 4 ++-- 7 files changed, 24 insertions(+), 20 deletions(-) create mode 100644 src/app/invoice-templates/routing-config.ts diff --git a/src/api/services.ts b/src/api/services.ts index c3e76ea19..1ff38dcab 100644 --- a/src/api/services.ts +++ b/src/api/services.ts @@ -12,7 +12,6 @@ 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 { ThriftService, createThriftServices } from '~/utils'; export interface MetadataThriftService extends ThriftService { @@ -171,7 +170,7 @@ export const services = [ public: 'SourceManagement', }, { - name: WachterServices.WalletsWebhookManager, + name: 'WalletsWebhookManager', loader: () => import('@vality/fistful-proto/webhooker').then((m) => m.WebhookManager), metadata$: fistfulMetadata$, namespace: 'webhooker', diff --git a/src/app/app.component.ts b/src/app/app.component.ts index eb80c99a6..84e0589d1 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -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'; @@ -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); } diff --git a/src/app/invoice-templates/routing-config.ts b/src/app/invoice-templates/routing-config.ts new file mode 100644 index 000000000..c911a0d45 --- /dev/null +++ b/src/app/invoice-templates/routing-config.ts @@ -0,0 +1,5 @@ +import { RoutingConfig, Services } from '~/services'; + +export const ROUTING_CONFIG: RoutingConfig = { + services: [Services.Invoicing], +}; diff --git a/src/app/terms/routing-config.ts b/src/app/terms/routing-config.ts index b929e8b80..919ab96d5 100644 --- a/src/app/terms/routing-config.ts +++ b/src/app/terms/routing-config.ts @@ -1,5 +1,5 @@ import { RoutingConfig, Services } from '~/services'; export const ROUTING_CONFIG: RoutingConfig = { - services: [Services.Dominator], + services: [Services.DMT], }; diff --git a/src/services/app-auth-guard/services.ts b/src/services/app-auth-guard/services.ts index 7ea9502e0..d061e4862 100644 --- a/src/services/app-auth-guard/services.ts +++ b/src/services/app-auth-guard/services.ts @@ -1,11 +1,11 @@ -export enum Services { - DMT = 'DMT', - FistfulStatistics = 'FistfulStatistics', - MerchantStatistics = 'MerchantStatistics', - ClaimManagement = 'ClaimManagement', - Invoicing = 'Invoicing', - RepairManagement = 'RepairManagement', - Dominator = 'Dominator', - WebhookManager = 'WebhookManager', - WalletsWebhookManager = 'WalletsWebhookManager', -} +import { services } from '~/api/services'; + +export const Services = services.reduce( + (acc, service) => { + acc[service.name] = service.name; + return acc; + }, + {} as Record<(typeof services)[number]['name'], (typeof services)[number]['name']>, +); + +export type Service = (typeof services)[number]['name']; diff --git a/src/services/app-auth-guard/types/routing-config.ts b/src/services/app-auth-guard/types/routing-config.ts index ffa19c2ba..f609967d1 100644 --- a/src/services/app-auth-guard/types/routing-config.ts +++ b/src/services/app-auth-guard/types/routing-config.ts @@ -1,5 +1,5 @@ -import { Services } from '../services'; +import { Service } from '../services'; export interface RoutingConfig { - services?: Services[]; + services?: Service[]; } diff --git a/src/services/navigate/models/route.ts b/src/services/navigate/models/route.ts index 6c87089e9..58a363428 100644 --- a/src/services/navigate/models/route.ts +++ b/src/services/navigate/models/route.ts @@ -3,7 +3,7 @@ import { ZodObject, ZodRawShape } from 'zod'; import { Route as NgRoute } from '@angular/router'; -import { RoutingConfig, Services, canActivateAuthRole } from '../../app-auth-guard'; +import { RoutingConfig, Service, canActivateAuthRole } from '../../app-auth-guard'; export class Route< const TPath extends string = string, @@ -12,7 +12,7 @@ export class Route< constructor( public readonly path: TPath, public readonly config: { - services?: Services[]; + services?: Service[]; queryParams?: TQpSchema; } & NgRoute = {}, ) {} From 5d934aa533c879b08ef73a2d0f1f6520da80fee8 Mon Sep 17 00:00:00 2001 From: Rinat Arsaev <11846445+A77AY@users.noreply.github.com> Date: Thu, 22 Jan 2026 13:04:57 +0700 Subject: [PATCH 04/10] init create invoice tpl --- src/app/invoice-templates/routing-config.ts | 5 --- src/app/payments/payments.component.html | 1 + src/app/payments/payments.component.ts | 19 ++++++++++ ...ate-invoice-template-dialog.component.html | 10 +++++ ...reate-invoice-template-dialog.component.ts | 38 +++++++++++++++++++ .../create-invoice-template-dialog/index.ts | 1 + 6 files changed, 69 insertions(+), 5 deletions(-) delete mode 100644 src/app/invoice-templates/routing-config.ts create mode 100644 src/components/create-invoice-template-dialog/create-invoice-template-dialog.component.html create mode 100644 src/components/create-invoice-template-dialog/create-invoice-template-dialog.component.ts create mode 100644 src/components/create-invoice-template-dialog/index.ts diff --git a/src/app/invoice-templates/routing-config.ts b/src/app/invoice-templates/routing-config.ts deleted file mode 100644 index c911a0d45..000000000 --- a/src/app/invoice-templates/routing-config.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { RoutingConfig, Services } from '~/services'; - -export const ROUTING_CONFIG: RoutingConfig = { - services: [Services.Invoicing], -}; diff --git a/src/app/payments/payments.component.html b/src/app/payments/payments.component.html index 4867c7b2f..70f66cb51 100644 --- a/src/app/payments/payments.component.html +++ b/src/app/payments/payments.component.html @@ -54,5 +54,6 @@ > Create adjustments + diff --git a/src/app/payments/payments.component.ts b/src/app/payments/payments.component.ts index 6265ee3eb..233e01ab7 100644 --- a/src/app/payments/payments.component.ts +++ b/src/app/payments/payments.component.ts @@ -222,4 +222,23 @@ export class PaymentsComponent implements OnInit { } }); } + + createInvoiceTemplate() { + this.dialogService + .open(FailMachinesDialogComponent, { + ids: uniq(this.selected$.value.map((s) => s.invoice_id)), + type: Type.Invoice, + }) + .afterClosed() + .subscribe((res) => { + if (res.status === DialogResponseStatus.Success) { + this.reload(); + this.selected$.next([]); + } else if (res.data?.errors?.length) { + this.selected$.next( + res.data.errors.map(({ index }) => this.selected$.value[index]), + ); + } + }); + } } diff --git a/src/components/create-invoice-template-dialog/create-invoice-template-dialog.component.html b/src/components/create-invoice-template-dialog/create-invoice-template-dialog.component.html new file mode 100644 index 000000000..6901fe92b --- /dev/null +++ b/src/components/create-invoice-template-dialog/create-invoice-template-dialog.component.html @@ -0,0 +1,10 @@ + + + + + + diff --git a/src/components/create-invoice-template-dialog/create-invoice-template-dialog.component.ts b/src/components/create-invoice-template-dialog/create-invoice-template-dialog.component.ts new file mode 100644 index 000000000..487811372 --- /dev/null +++ b/src/components/create-invoice-template-dialog/create-invoice-template-dialog.component.ts @@ -0,0 +1,38 @@ +import { Component, DestroyRef, inject, signal } from '@angular/core'; +import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; +import { FormControl, ReactiveFormsModule } from '@angular/forms'; + +import { InvoiceTemplateCreateParams } from '@vality/domain-proto/api_extensions'; +import { DialogModule, DialogSuperclass, NotifyLogService, progressTo } from '@vality/matez'; + +import { ThriftInvoiceTemplatingService } from '~/api/services'; + +import { DomainThriftFormComponent } from '../thrift-api-crud'; + +@Component({ + templateUrl: './create-invoice-template-dialog.component.html', + imports: [DialogModule, DomainThriftFormComponent, ReactiveFormsModule], +}) +export class CreateInvoiceTemplateDialogComponent extends DialogSuperclass { + private invoiceTemplatingService = inject(ThriftInvoiceTemplatingService); + private log = inject(NotifyLogService); + private dr = inject(DestroyRef); + + control = new FormControl(null, { nonNullable: true }); + progress = signal(0); + + create() { + this.invoiceTemplatingService + .Create(this.control.value) + .pipe(progressTo(this.progress), takeUntilDestroyed(this.dr)) + .subscribe({ + next: () => { + this.log.success('Invoice template created'); + this.closeWithSuccess(); + }, + error: (err) => { + this.log.error('Failed to create invoice template', err); + }, + }); + } +} diff --git a/src/components/create-invoice-template-dialog/index.ts b/src/components/create-invoice-template-dialog/index.ts new file mode 100644 index 000000000..bbe98fe34 --- /dev/null +++ b/src/components/create-invoice-template-dialog/index.ts @@ -0,0 +1 @@ +export * from './create-invoice-template-dialog.component'; From 54dd215ba5f3c04ed2b08f59fbf5efb31a44d7a5 Mon Sep 17 00:00:00 2001 From: Rinat Arsaev <11846445+A77AY@users.noreply.github.com> Date: Thu, 22 Jan 2026 13:11:21 +0700 Subject: [PATCH 05/10] fix services --- src/api/services.ts | 35 ++++++++++--------- src/app/app-routes.ts | 6 ++-- src/app/deposits/deposit/routing-config.ts | 4 +-- src/app/deposits/routing-config.ts | 4 +-- src/app/machines/routing-config.ts | 4 +-- src/app/parties/party/routing-config.ts | 4 +-- .../party-delegate-rulesets/routing-config.ts | 4 +-- .../party-routing-ruleset/routing-config.ts | 4 +-- .../routing-ruleset/routing-config.ts | 4 +-- src/app/parties/party/shops/routing-config.ts | 4 +-- .../party/wallet-webhooks/routing-config.ts | 4 +-- .../parties/party/webhooks/routing-config.ts | 4 +-- src/app/payments/payment/routing-config.ts | 4 +-- src/app/payments/routing-config.ts | 4 +-- src/app/shops/shops-routing-config.ts | 4 +-- src/app/sources/routing-config.ts | 4 +-- src/app/terminals/routing-config.ts | 4 +-- src/app/terms/routing-config.ts | 4 +-- src/app/wallets/routing-config.ts | 4 +-- src/app/withdrawals/routing-config.ts | 4 +-- src/services/app-auth-guard/services.ts | 31 +++++++++++----- 21 files changed, 79 insertions(+), 65 deletions(-) diff --git a/src/api/services.ts b/src/api/services.ts index 1ff38dcab..98efb1250 100644 --- a/src/api/services.ts +++ b/src/api/services.ts @@ -12,6 +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 { Service } from '~/services'; import { ThriftService, createThriftServices } from '~/utils'; export interface MetadataThriftService extends ThriftService { @@ -33,7 +34,7 @@ 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', @@ -41,7 +42,7 @@ export const services = [ }, { ...domainData, - name: 'DMTClient', + name: Service.DMTClient, loader: () => import('@vality/domain-proto/domain_config_v2').then((m) => m.RepositoryClient), namespace: 'domain_config_v2', @@ -50,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', @@ -59,7 +60,7 @@ 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', @@ -67,7 +68,7 @@ export const services = [ }, { ...domainData, - name: 'PartyManagement', + name: Service.PartyManagement, loader: () => import('@vality/domain-proto/payment_processing').then((m) => m.PartyManagement), namespace: 'payment_processing', @@ -76,7 +77,7 @@ export const services = [ }, { ...domainData, - name: 'WebhookManager', + name: Service.WebhookManager, loader: () => import('@vality/domain-proto/webhooker').then((m) => m.WebhookManager), namespace: 'webhooker', service: 'WebhookManager', @@ -84,7 +85,7 @@ export const services = [ }, { ...domainData, - name: 'Accounter', + name: Service.Accounter, loader: () => import('@vality/domain-proto/accounter').then((m) => m.Accounter), namespace: 'accounter', service: 'Accounter', @@ -92,7 +93,7 @@ export const services = [ }, { ...domainData, - name: 'InvoiceTemplating', + name: Service.InvoiceTemplating, loader: () => import('@vality/domain-proto/api_extensions').then((m) => m.InvoiceTemplating), namespace: 'api_extensions', @@ -101,7 +102,7 @@ export const services = [ }, // Repairer { - name: 'RepairManagement', + name: Service.RepairManagement, loader: () => import('@vality/repairer-proto/repairer').then((m) => m.RepairManagement), metadata$: repairerMetadata$, namespace: 'repairer', @@ -110,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', @@ -119,7 +120,7 @@ export const services = [ }, // Magista { - name: 'MerchantStatistics', + name: Service.MerchantStatistics, loader: () => import('@vality/magista-proto/magista').then((m) => m.MerchantStatisticsService), metadata$: magistaMetadata$, @@ -129,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', @@ -138,7 +139,7 @@ export const services = [ }, // Fistful { - name: 'DepositManagement', + name: Service.DepositManagement, loader: () => import('@vality/fistful-proto/deposit').then((m) => m.Management), metadata$: fistfulMetadata$, namespace: 'deposit', @@ -146,7 +147,7 @@ export const services = [ public: 'DepositManagement', }, { - name: 'FistfulStatistics', + name: Service.FistfulStatistics, loader: () => import('@vality/fistful-proto/fistful_stat').then((m) => m.FistfulStatistics), metadata$: fistfulMetadata$, namespace: 'fistful_stat', @@ -154,7 +155,7 @@ export const services = [ public: 'FistfulStatistics', }, { - name: 'WithdrawalManagement', + name: Service.WithdrawalManagement, loader: () => import('@vality/fistful-proto/withdrawal').then((m) => m.Management), metadata$: fistfulMetadata$, namespace: 'withdrawal', @@ -162,7 +163,7 @@ export const services = [ public: 'WithdrawalManagement', }, { - name: 'SourceManagement', + name: Service.SourceManagement, loader: () => import('@vality/fistful-proto/source').then((m) => m.Management), metadata$: fistfulMetadata$, namespace: 'source', @@ -170,7 +171,7 @@ export const services = [ public: 'SourceManagement', }, { - name: 'WalletsWebhookManager', + name: Service.WalletsWebhookManager, loader: () => import('@vality/fistful-proto/webhooker').then((m) => m.WebhookManager), metadata$: fistfulMetadata$, namespace: 'webhooker', diff --git a/src/app/app-routes.ts b/src/app/app-routes.ts index 5cfc1be66..0dd160bdb 100644 --- a/src/app/app-routes.ts +++ b/src/app/app-routes.ts @@ -1,20 +1,20 @@ import { z } from 'zod'; -import { Route, Services } from '~/services'; +import { Route, Service } from '~/services'; type SectionPageRoutes = Record>; 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() }), }), diff --git a/src/app/deposits/deposit/routing-config.ts b/src/app/deposits/deposit/routing-config.ts index 4f3207ab4..d4b513cd0 100644 --- a/src/app/deposits/deposit/routing-config.ts +++ b/src/app/deposits/deposit/routing-config.ts @@ -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], }; diff --git a/src/app/deposits/routing-config.ts b/src/app/deposits/routing-config.ts index 4f3207ab4..d4b513cd0 100644 --- a/src/app/deposits/routing-config.ts +++ b/src/app/deposits/routing-config.ts @@ -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], }; diff --git a/src/app/machines/routing-config.ts b/src/app/machines/routing-config.ts index 6aa0a8552..ea975fef2 100644 --- a/src/app/machines/routing-config.ts +++ b/src/app/machines/routing-config.ts @@ -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], }; diff --git a/src/app/parties/party/routing-config.ts b/src/app/parties/party/routing-config.ts index 919ab96d5..fa8001e6f 100644 --- a/src/app/parties/party/routing-config.ts +++ b/src/app/parties/party/routing-config.ts @@ -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], }; diff --git a/src/app/parties/party/routing-rules/party-delegate-rulesets/routing-config.ts b/src/app/parties/party/routing-rules/party-delegate-rulesets/routing-config.ts index 919ab96d5..fa8001e6f 100644 --- a/src/app/parties/party/routing-rules/party-delegate-rulesets/routing-config.ts +++ b/src/app/parties/party/routing-rules/party-delegate-rulesets/routing-config.ts @@ -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], }; diff --git a/src/app/parties/party/routing-rules/party-routing-ruleset/routing-config.ts b/src/app/parties/party/routing-rules/party-routing-ruleset/routing-config.ts index 919ab96d5..fa8001e6f 100644 --- a/src/app/parties/party/routing-rules/party-routing-ruleset/routing-config.ts +++ b/src/app/parties/party/routing-rules/party-routing-ruleset/routing-config.ts @@ -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], }; diff --git a/src/app/parties/party/routing-rules/routing-ruleset/routing-config.ts b/src/app/parties/party/routing-rules/routing-ruleset/routing-config.ts index 919ab96d5..fa8001e6f 100644 --- a/src/app/parties/party/routing-rules/routing-ruleset/routing-config.ts +++ b/src/app/parties/party/routing-rules/routing-ruleset/routing-config.ts @@ -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], }; diff --git a/src/app/parties/party/shops/routing-config.ts b/src/app/parties/party/shops/routing-config.ts index 919ab96d5..fa8001e6f 100644 --- a/src/app/parties/party/shops/routing-config.ts +++ b/src/app/parties/party/shops/routing-config.ts @@ -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], }; diff --git a/src/app/parties/party/wallet-webhooks/routing-config.ts b/src/app/parties/party/wallet-webhooks/routing-config.ts index b2852f4d0..0ef5d2367 100644 --- a/src/app/parties/party/wallet-webhooks/routing-config.ts +++ b/src/app/parties/party/wallet-webhooks/routing-config.ts @@ -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], }; diff --git a/src/app/parties/party/webhooks/routing-config.ts b/src/app/parties/party/webhooks/routing-config.ts index 08cdf470b..40458dccf 100644 --- a/src/app/parties/party/webhooks/routing-config.ts +++ b/src/app/parties/party/webhooks/routing-config.ts @@ -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], }; diff --git a/src/app/payments/payment/routing-config.ts b/src/app/payments/payment/routing-config.ts index 81f470cbb..ef9973dcb 100644 --- a/src/app/payments/payment/routing-config.ts +++ b/src/app/payments/payment/routing-config.ts @@ -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], }; diff --git a/src/app/payments/routing-config.ts b/src/app/payments/routing-config.ts index 81f470cbb..ef9973dcb 100644 --- a/src/app/payments/routing-config.ts +++ b/src/app/payments/routing-config.ts @@ -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], }; diff --git a/src/app/shops/shops-routing-config.ts b/src/app/shops/shops-routing-config.ts index a87171a1e..799f63ef6 100644 --- a/src/app/shops/shops-routing-config.ts +++ b/src/app/shops/shops-routing-config.ts @@ -1,5 +1,5 @@ -import { RoutingConfig, Services } from '~/services'; +import { RoutingConfig, Service } from '~/services'; export const SHOPS_ROUTING_CONFIG: RoutingConfig = { - services: [Services.DMT], + services: [Service.DMT], }; diff --git a/src/app/sources/routing-config.ts b/src/app/sources/routing-config.ts index 4f3207ab4..d4b513cd0 100644 --- a/src/app/sources/routing-config.ts +++ b/src/app/sources/routing-config.ts @@ -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], }; diff --git a/src/app/terminals/routing-config.ts b/src/app/terminals/routing-config.ts index 919ab96d5..fa8001e6f 100644 --- a/src/app/terminals/routing-config.ts +++ b/src/app/terminals/routing-config.ts @@ -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], }; diff --git a/src/app/terms/routing-config.ts b/src/app/terms/routing-config.ts index 919ab96d5..fa8001e6f 100644 --- a/src/app/terms/routing-config.ts +++ b/src/app/terms/routing-config.ts @@ -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], }; diff --git a/src/app/wallets/routing-config.ts b/src/app/wallets/routing-config.ts index 4f3207ab4..d4b513cd0 100644 --- a/src/app/wallets/routing-config.ts +++ b/src/app/wallets/routing-config.ts @@ -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], }; diff --git a/src/app/withdrawals/routing-config.ts b/src/app/withdrawals/routing-config.ts index 4f3207ab4..d4b513cd0 100644 --- a/src/app/withdrawals/routing-config.ts +++ b/src/app/withdrawals/routing-config.ts @@ -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], }; diff --git a/src/services/app-auth-guard/services.ts b/src/services/app-auth-guard/services.ts index d061e4862..bcf85c6c0 100644 --- a/src/services/app-auth-guard/services.ts +++ b/src/services/app-auth-guard/services.ts @@ -1,11 +1,24 @@ -import { services } from '~/api/services'; +export enum Service { + DMT = 'DMT', + DMTClient = 'DMTClient', + DMTAuthor = 'DMTAuthor', + Invoicing = 'Invoicing', + PartyManagement = 'PartyManagement', + WebhookManager = 'WebhookManager', + Accounter = 'Accounter', + InvoiceTemplating = 'InvoiceTemplating', -export const Services = services.reduce( - (acc, service) => { - acc[service.name] = service.name; - return acc; - }, - {} as Record<(typeof services)[number]['name'], (typeof services)[number]['name']>, -); + RepairManagement = 'RepairManagement', -export type Service = (typeof services)[number]['name']; + Scrooge = 'Scrooge', + + MerchantStatistics = 'MerchantStatistics', + + Automaton = 'Automaton', + + DepositManagement = 'DepositManagement', + FistfulStatistics = 'FistfulStatistics', + WithdrawalManagement = 'WithdrawalManagement', + SourceManagement = 'SourceManagement', + WalletsWebhookManager = 'WalletsWebhookManager', +} From 817037cbbd1974f857bebd6a32513ed22e47e64d Mon Sep 17 00:00:00 2001 From: Rinat Arsaev <11846445+A77AY@users.noreply.github.com> Date: Thu, 22 Jan 2026 13:28:43 +0700 Subject: [PATCH 06/10] fix --- src/app/payments/payments.component.html | 27 +++++++++++++------ src/app/payments/payments.component.ts | 20 +++----------- ...ate-invoice-template-dialog.component.html | 4 +-- ...reate-invoice-template-dialog.component.ts | 3 ++- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/app/payments/payments.component.html b/src/app/payments/payments.component.html index 70f66cb51..7802d9850 100644 --- a/src/app/payments/payments.component.html +++ b/src/app/payments/payments.component.html @@ -43,17 +43,28 @@ (selectedChange)="selected$.next($event)" (update)="reload($event ?? {})" > - - - + + @if ((selected$ | async)?.length) { + + } @else { + + } diff --git a/src/app/payments/payments.component.ts b/src/app/payments/payments.component.ts index 233e01ab7..d8ac337fc 100644 --- a/src/app/payments/payments.component.ts +++ b/src/app/payments/payments.component.ts @@ -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'; @@ -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'; @@ -71,6 +73,7 @@ interface Filters { FormsModule, MagistaThriftFormComponent, PaymentsTableComponent, + MatBadgeModule, ], }) export class PaymentsComponent implements OnInit { @@ -224,21 +227,6 @@ export class PaymentsComponent implements OnInit { } createInvoiceTemplate() { - this.dialogService - .open(FailMachinesDialogComponent, { - ids: uniq(this.selected$.value.map((s) => s.invoice_id)), - type: Type.Invoice, - }) - .afterClosed() - .subscribe((res) => { - if (res.status === DialogResponseStatus.Success) { - this.reload(); - this.selected$.next([]); - } else if (res.data?.errors?.length) { - this.selected$.next( - res.data.errors.map(({ index }) => this.selected$.value[index]), - ); - } - }); + this.dialogService.open(CreateInvoiceTemplateDialogComponent); } } diff --git a/src/components/create-invoice-template-dialog/create-invoice-template-dialog.component.html b/src/components/create-invoice-template-dialog/create-invoice-template-dialog.component.html index 6901fe92b..dbdf1ec1a 100644 --- a/src/components/create-invoice-template-dialog/create-invoice-template-dialog.component.html +++ b/src/components/create-invoice-template-dialog/create-invoice-template-dialog.component.html @@ -1,10 +1,10 @@ - + - + diff --git a/src/components/create-invoice-template-dialog/create-invoice-template-dialog.component.ts b/src/components/create-invoice-template-dialog/create-invoice-template-dialog.component.ts index 487811372..e203d45b8 100644 --- a/src/components/create-invoice-template-dialog/create-invoice-template-dialog.component.ts +++ b/src/components/create-invoice-template-dialog/create-invoice-template-dialog.component.ts @@ -1,6 +1,7 @@ import { Component, DestroyRef, inject, signal } from '@angular/core'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { FormControl, ReactiveFormsModule } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; import { InvoiceTemplateCreateParams } from '@vality/domain-proto/api_extensions'; import { DialogModule, DialogSuperclass, NotifyLogService, progressTo } from '@vality/matez'; @@ -11,7 +12,7 @@ import { DomainThriftFormComponent } from '../thrift-api-crud'; @Component({ templateUrl: './create-invoice-template-dialog.component.html', - imports: [DialogModule, DomainThriftFormComponent, ReactiveFormsModule], + imports: [DialogModule, DomainThriftFormComponent, ReactiveFormsModule, MatButtonModule], }) export class CreateInvoiceTemplateDialogComponent extends DialogSuperclass { private invoiceTemplatingService = inject(ThriftInvoiceTemplatingService); From 63986e7eb224423ac8cc41ac0b99aeaccbbf06e9 Mon Sep 17 00:00:00 2001 From: Rinat Arsaev <11846445+A77AY@users.noreply.github.com> Date: Thu, 22 Jan 2026 13:36:49 +0700 Subject: [PATCH 07/10] fix --- .../create-invoice-template-dialog.component.html | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/create-invoice-template-dialog/create-invoice-template-dialog.component.html b/src/components/create-invoice-template-dialog/create-invoice-template-dialog.component.html index dbdf1ec1a..7f2b0c2af 100644 --- a/src/components/create-invoice-template-dialog/create-invoice-template-dialog.component.html +++ b/src/components/create-invoice-template-dialog/create-invoice-template-dialog.component.html @@ -2,6 +2,7 @@ From 5bf0ca433f1db05f79bbc95578ac8c3eab3fdcd5 Mon Sep 17 00:00:00 2001 From: Rinat Arsaev <11846445+A77AY@users.noreply.github.com> Date: Thu, 22 Jan 2026 23:12:09 +0700 Subject: [PATCH 08/10] copy link --- ...ate-invoice-template-dialog.component.html | 30 ++++++-- ...reate-invoice-template-dialog.component.ts | 76 +++++++++++++++---- src/services/config/types/app-config.ts | 3 +- 3 files changed, 88 insertions(+), 21 deletions(-) diff --git a/src/components/create-invoice-template-dialog/create-invoice-template-dialog.component.html b/src/components/create-invoice-template-dialog/create-invoice-template-dialog.component.html index 7f2b0c2af..9faf27141 100644 --- a/src/components/create-invoice-template-dialog/create-invoice-template-dialog.component.html +++ b/src/components/create-invoice-template-dialog/create-invoice-template-dialog.component.html @@ -1,11 +1,27 @@ +@let template = template$ | async; + - + @if (template) { +
+ + Link + + + +
+ } @else { + + } - + @if (template) { + + } @else { + + }
diff --git a/src/components/create-invoice-template-dialog/create-invoice-template-dialog.component.ts b/src/components/create-invoice-template-dialog/create-invoice-template-dialog.component.ts index e203d45b8..f57e39c39 100644 --- a/src/components/create-invoice-template-dialog/create-invoice-template-dialog.component.ts +++ b/src/components/create-invoice-template-dialog/create-invoice-template-dialog.component.ts @@ -1,39 +1,89 @@ +import { Subject, catchError, combineLatest, map, of, shareReplay, switchMap, tap } from 'rxjs'; + +import { Clipboard } from '@angular/cdk/clipboard'; +import { CommonModule } from '@angular/common'; import { Component, DestroyRef, inject, signal } from '@angular/core'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { FormControl, ReactiveFormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; import { InvoiceTemplateCreateParams } from '@vality/domain-proto/api_extensions'; import { DialogModule, DialogSuperclass, NotifyLogService, progressTo } from '@vality/matez'; import { ThriftInvoiceTemplatingService } from '~/api/services'; +import { ConfigService } from '~/services'; import { DomainThriftFormComponent } from '../thrift-api-crud'; @Component({ templateUrl: './create-invoice-template-dialog.component.html', - imports: [DialogModule, DomainThriftFormComponent, ReactiveFormsModule, MatButtonModule], + imports: [ + CommonModule, + DialogModule, + DomainThriftFormComponent, + ReactiveFormsModule, + MatButtonModule, + MatFormFieldModule, + MatInputModule, + MatIconModule, + ], }) export class CreateInvoiceTemplateDialogComponent extends DialogSuperclass { private invoiceTemplatingService = inject(ThriftInvoiceTemplatingService); private log = inject(NotifyLogService); private dr = inject(DestroyRef); + private createTemplate$ = new Subject(); + private configService = inject(ConfigService); + private clipboard = inject(Clipboard); + template$ = this.createTemplate$.pipe( + switchMap(() => + this.invoiceTemplatingService.Create(this.control.value).pipe( + progressTo(this.progress), + tap(() => { + this.log.success('Invoice template created successfully'); + }), + catchError((err) => { + this.log.error('Failed to create invoice template', err); + return of(null); + }), + ), + ), + takeUntilDestroyed(this.dr), + shareReplay(1), + ); control = new FormControl(null, { nonNullable: true }); progress = signal(0); + link$ = combineLatest([this.template$, this.configService.config.value$]).pipe( + map(([template, config]) => { + const url = new URL( + `http${(config.checkout.https ?? true) ? 's' : ''}://${config.checkout.hostname}${config.checkout.path ?? '/v1/checkout'}`, + ); + url.searchParams.set('invoiceTemplateID', template.invoice_template.id); + url.searchParams.set( + 'invoiceTemplateAccessToken', + template.invoice_template_access_token.payload, + ); + return url.toString(); + }), + shareReplay({ refCount: true, bufferSize: 1 }), + ); create() { - this.invoiceTemplatingService - .Create(this.control.value) - .pipe(progressTo(this.progress), takeUntilDestroyed(this.dr)) - .subscribe({ - next: () => { - this.log.success('Invoice template created'); - this.closeWithSuccess(); - }, - error: (err) => { - this.log.error('Failed to create invoice template', err); - }, - }); + this.createTemplate$.next(null); + } + + confirm() { + this.closeWithSuccess(); + } + + copyLink() { + this.link$.pipe(takeUntilDestroyed(this.dr)).subscribe((link) => { + this.clipboard.copy(link); + this.log.success('Link copied to clipboard'); + }); } } diff --git a/src/services/config/types/app-config.ts b/src/services/config/types/app-config.ts index 73c6e1882..11380887b 100644 --- a/src/services/config/types/app-config.ts +++ b/src/services/config/types/app-config.ts @@ -1,6 +1,6 @@ interface Endpoint { hostname: string; - path: string; + path?: string; port?: string; https?: boolean; } @@ -9,4 +9,5 @@ export interface AppConfig { api: { wachter: Endpoint; }; + checkout: Endpoint; } From d207caeeeff8d2a2be739b7b3dde8501a18ad3a9 Mon Sep 17 00:00:00 2001 From: Rinat Arsaev <11846445+A77AY@users.noreply.github.com> Date: Thu, 22 Jan 2026 23:28:06 +0700 Subject: [PATCH 09/10] prepare link --- ...ate-invoice-template-dialog.component.html | 11 ++++- ...reate-invoice-template-dialog.component.ts | 47 +++++++++++++++++-- 2 files changed, 52 insertions(+), 6 deletions(-) diff --git a/src/components/create-invoice-template-dialog/create-invoice-template-dialog.component.html b/src/components/create-invoice-template-dialog/create-invoice-template-dialog.component.html index 9faf27141..2c325becb 100644 --- a/src/components/create-invoice-template-dialog/create-invoice-template-dialog.component.html +++ b/src/components/create-invoice-template-dialog/create-invoice-template-dialog.component.html @@ -2,10 +2,19 @@ @if (template) { +
+ + + + + + +
+
Link - +
diff --git a/src/components/create-invoice-template-dialog/create-invoice-template-dialog.component.ts b/src/components/create-invoice-template-dialog/create-invoice-template-dialog.component.ts index f57e39c39..3d324b3d2 100644 --- a/src/components/create-invoice-template-dialog/create-invoice-template-dialog.component.ts +++ b/src/components/create-invoice-template-dialog/create-invoice-template-dialog.component.ts @@ -1,17 +1,35 @@ -import { Subject, catchError, combineLatest, map, of, shareReplay, switchMap, tap } from 'rxjs'; +import { + Subject, + catchError, + combineLatest, + debounceTime, + map, + of, + shareReplay, + switchMap, + tap, +} from 'rxjs'; import { Clipboard } from '@angular/cdk/clipboard'; import { CommonModule } from '@angular/common'; import { Component, DestroyRef, inject, signal } from '@angular/core'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; -import { FormControl, ReactiveFormsModule } from '@angular/forms'; +import { FormBuilder, FormControl, ReactiveFormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; +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 { InvoiceTemplateCreateParams } from '@vality/domain-proto/api_extensions'; -import { DialogModule, DialogSuperclass, NotifyLogService, progressTo } from '@vality/matez'; +import { + DialogModule, + DialogSuperclass, + InputFieldModule, + NotifyLogService, + getValueChanges, + progressTo, +} from '@vality/matez'; import { ThriftInvoiceTemplatingService } from '~/api/services'; import { ConfigService } from '~/services'; @@ -29,6 +47,8 @@ import { DomainThriftFormComponent } from '../thrift-api-crud'; MatFormFieldModule, MatInputModule, MatIconModule, + InputFieldModule, + MatDividerModule, ], }) export class CreateInvoiceTemplateDialogComponent extends DialogSuperclass { @@ -38,7 +58,16 @@ export class CreateInvoiceTemplateDialogComponent extends DialogSuperclass(); private configService = inject(ConfigService); private clipboard = inject(Clipboard); + private fb = inject(FormBuilder); + linkForm = this.fb.group({ + name: null, + description: null, + email: null, + redirectUrl: null, + cancelUrl: null, + locale: null, + }); template$ = this.createTemplate$.pipe( switchMap(() => this.invoiceTemplatingService.Create(this.control.value).pipe( @@ -57,8 +86,12 @@ export class CreateInvoiceTemplateDialogComponent extends DialogSuperclass(null, { nonNullable: true }); progress = signal(0); - link$ = combineLatest([this.template$, this.configService.config.value$]).pipe( - map(([template, config]) => { + link$ = combineLatest([ + this.template$, + this.configService.config.value$, + getValueChanges(this.linkForm).pipe(debounceTime(1000)), + ]).pipe( + map(([template, config, linkValues]) => { const url = new URL( `http${(config.checkout.https ?? true) ? 's' : ''}://${config.checkout.hostname}${config.checkout.path ?? '/v1/checkout'}`, ); @@ -67,6 +100,10 @@ export class CreateInvoiceTemplateDialogComponent extends DialogSuperclass !!v); + for (const [key, value] of nonEmptyLinkValues) { + url.searchParams.set(key, value as string); + } return url.toString(); }), shareReplay({ refCount: true, bufferSize: 1 }), From 5b72302812dab476afc0404f84f59b4506828e53 Mon Sep 17 00:00:00 2001 From: Rinat Arsaev <11846445+A77AY@users.noreply.github.com> Date: Thu, 22 Jan 2026 23:33:21 +0700 Subject: [PATCH 10/10] hide invoice context --- .../create-invoice-template-dialog.component.ts | 5 ++++- .../domain-metadata-form-extensions.service.ts | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/create-invoice-template-dialog/create-invoice-template-dialog.component.ts b/src/components/create-invoice-template-dialog/create-invoice-template-dialog.component.ts index 3d324b3d2..ea4cf57ac 100644 --- a/src/components/create-invoice-template-dialog/create-invoice-template-dialog.component.ts +++ b/src/components/create-invoice-template-dialog/create-invoice-template-dialog.component.ts @@ -84,7 +84,10 @@ export class CreateInvoiceTemplateDialogComponent extends DialogSuperclass(null, { nonNullable: true }); + control = new FormControl( + { context: { type: '', data: '' } } as InvoiceTemplateCreateParams, + { nonNullable: true }, + ); progress = signal(0); link$ = combineLatest([ this.template$, diff --git a/src/components/thrift-api-crud/domain/services/domain-metadata-form-extensions/domain-metadata-form-extensions.service.ts b/src/components/thrift-api-crud/domain/services/domain-metadata-form-extensions/domain-metadata-form-extensions.service.ts index 46ee806b6..b599c5178 100644 --- a/src/components/thrift-api-crud/domain/services/domain-metadata-form-extensions/domain-metadata-form-extensions.service.ts +++ b/src/components/thrift-api-crud/domain/services/domain-metadata-form-extensions/domain-metadata-form-extensions.service.ts @@ -97,6 +97,10 @@ export class DomainMetadataFormExtensionsService { generate: () => of('authorization_failed:unknown'), }), }, + { + determinant: (data) => of(isTypeWithAliases(data, 'InvoiceContext', 'domain')), + extension: () => of({ hidden: true }), + }, ]), shareReplay({ refCount: true, bufferSize: 1 }), );