822bf96966
- 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.
54 lines
1.6 KiB
TypeScript
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);
|
|
}
|
|
}
|