Files
psp_panel/src/app/domains/superAdmin/modules/consumers/views/single.component.ts
T
ahasani 822bf96966 feat: add new form field components for company details and consumer management
- Implemented CompanyNameComponent, DescriptionComponent, DeviceIdComponent, EconomicCodeComponent, EmailComponent, FirstNameComponent, FiscalCodeComponent, GuildIdComponent, LastNameComponent, LegalNameComponent, LicenseStartsAtComponent, MobileComponent, MobileNumberComponent, ModelComponent, NameComponent, NationalCodeComponent, NationalIdComponent, PartnerTokenComponent, PosTypeComponent, PostalCodeComponent, ProviderIdComponent, QuantityComponent, RegistrationCodeComponent, RegistrationNumberComponent, SerialNumberComponent, SetOffComponent, SkuComponent, TerminalComponent, UnitPriceComponent, UsernameComponent.
- Added field control configurations for new fields in the form.
- Updated routing and branding configurations for TIS tenant.
- Created consumer type models for handling individual and legal consumer data.
2026-04-27 21:53:11 +03:30

54 lines
1.6 KiB
TypeScript

import { BreadcrumbService } from '@/core/services';
import { AppCardComponent, KeyValueComponent } from '@/shared/components';
import { Component, computed, effect, inject, signal } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { ConsumerAccountListComponent } from '../components/accounts/list.component';
import { ConsumerBusinessActivitiesComponent } from '../components/businessActivities/list.component';
import { ConsumerUserFormComponent } from '../components/form.component';
import { ConsumerStore } from '../store/consumer.store';
@Component({
selector: 'consumer-user',
templateUrl: './single.component.html',
imports: [
AppCardComponent,
KeyValueComponent,
ConsumerUserFormComponent,
ConsumerAccountListComponent,
ConsumerBusinessActivitiesComponent,
],
})
export class ConsumerComponent {
private readonly store = inject(ConsumerStore);
private readonly route = inject(ActivatedRoute);
private readonly breadcrumbService = inject(BreadcrumbService);
readonly consumerId = signal<string>(this.route.snapshot.paramMap.get('consumerId')!);
editMode = signal<boolean>(false);
visibleLicenseForm = signal(false);
readonly loading = computed(() => this.store.loading());
readonly consumer = computed(() => this.store.entity());
constructor() {
effect(() => {
if (this.consumer()?.id) {
this.setBreadcrumb();
}
});
}
getData() {
this.store.getData(this.consumerId());
}
setBreadcrumb() {
this.breadcrumbService.setItems(this.store.breadcrumbItems());
}
openLicenseForm() {
this.visibleLicenseForm.set(true);
}
}