feedback updates
This commit is contained in:
parent
3a147ce26b
commit
0c863458d3
@ -47,7 +47,7 @@ export class CheckoutComponent {
|
|||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.currentApplicationDetails = this.storageService.get<{ headerid: number, applicationName: string, applicationType: string }>('currentapplication')
|
this.currentApplicationDetails = this.storageService.get<{ headerid: number, applicationName: string, applicationType: string }>('currentapplication')
|
||||||
this.orderDetails.description = ` 'Carnet Application - ${this.currentApplicationDetails?.applicationName}`
|
this.orderDetails.description = ` 'Carnet Application - ${this.currentApplicationDetails?.headerid} - ${this.currentApplicationDetails?.applicationName}`
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
@ -114,8 +114,6 @@ export class CheckoutComponent {
|
|||||||
// data.orderID is the ID of the transaction from PayPal
|
// data.orderID is the ID of the transaction from PayPal
|
||||||
const captureDetails = await this.paymentService.completePayment(data.orderID);
|
const captureDetails = await this.paymentService.completePayment(data.orderID);
|
||||||
|
|
||||||
// console.log('Capture details:', captureDetails);
|
|
||||||
|
|
||||||
// You can now redirect the user or update the UI
|
// You can now redirect the user or update the UI
|
||||||
this.changeInProgress = true;
|
this.changeInProgress = true;
|
||||||
this.carnetService.submitApplication(this.currentApplicationDetails?.headerid!).pipe(finalize(() => {
|
this.carnetService.submitApplication(this.currentApplicationDetails?.headerid!).pipe(finalize(() => {
|
||||||
@ -146,6 +144,7 @@ export class CheckoutComponent {
|
|||||||
|
|
||||||
// 4. Handle cancellation
|
// 4. Handle cancellation
|
||||||
onCancel: (data: any) => {
|
onCancel: (data: any) => {
|
||||||
|
this.onCancel();
|
||||||
}
|
}
|
||||||
}).render(this.paypalElement.nativeElement)
|
}).render(this.paypalElement.nativeElement)
|
||||||
.catch((error: any) => {
|
.catch((error: any) => {
|
||||||
@ -158,5 +157,29 @@ export class CheckoutComponent {
|
|||||||
(fee): fee is number => typeof fee === 'number'
|
(fee): fee is number => typeof fee === 'number'
|
||||||
);
|
);
|
||||||
this.orderTotal = validFees.reduce((total, fee) => total + fee, 0);
|
this.orderTotal = validFees.reduce((total, fee) => total + fee, 0);
|
||||||
|
this.orderDetails.price = this.orderTotal?.toString() ?? '0.00';
|
||||||
|
}
|
||||||
|
|
||||||
|
onCancel(): void {
|
||||||
|
this.storageService.removeItem('currentapplication');
|
||||||
|
|
||||||
|
let route: string = 'edit-carnet';
|
||||||
|
if (this.currentApplicationDetails?.applicationType === 'duplicate') {
|
||||||
|
route = 'duplicate-carnet';
|
||||||
|
}
|
||||||
|
else if (this.currentApplicationDetails?.applicationType === 'extend') {
|
||||||
|
route = 'extend-carnet';
|
||||||
|
} else if (this.currentApplicationDetails?.applicationType === 'additional') {
|
||||||
|
route = 'additional-sets';
|
||||||
|
}
|
||||||
|
|
||||||
|
this.navigationService.navigate([route, this.currentApplicationDetails?.headerid],
|
||||||
|
{
|
||||||
|
state: { isEditMode: true },
|
||||||
|
queryParams: {
|
||||||
|
applicationname: this.currentApplicationDetails?.applicationName,
|
||||||
|
return: 'shipping'
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -289,7 +289,7 @@
|
|||||||
<mat-error *ngIf="shippingForm.get('deliveryType')?.errors?.['required']">
|
<mat-error *ngIf="shippingForm.get('deliveryType')?.errors?.['required']">
|
||||||
Delivery Type is required
|
Delivery Type is required
|
||||||
</mat-error>
|
</mat-error>
|
||||||
<mat-hint align="start" *ngIf="deliveryEstimate" class="delivery-estimate">
|
<mat-hint align="start" *ngIf="deliveryEstimate && !isViewMode" class="delivery-estimate">
|
||||||
<span>{{ deliveryEstimate }}</span>
|
<span>{{ deliveryEstimate }}</span>
|
||||||
</mat-hint>
|
</mat-hint>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|||||||
@ -129,7 +129,7 @@ export class TravelPlanComponent {
|
|||||||
title: 'For your information',
|
title: 'For your information',
|
||||||
message: country.actionMessage,
|
message: country.actionMessage,
|
||||||
confirmText: 'Ok',
|
confirmText: 'Ok',
|
||||||
cancelText: 'Cancel'
|
hideCancel: true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -147,8 +147,8 @@ export class TravelPlanComponent {
|
|||||||
data: {
|
data: {
|
||||||
title: 'Warning',
|
title: 'Warning',
|
||||||
message: country.actionMessage,
|
message: country.actionMessage,
|
||||||
confirmText: 'Ok',
|
confirmText: 'Yes',
|
||||||
cancelText: 'Cancel'
|
cancelText: 'No'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -171,8 +171,8 @@ export class TravelPlanComponent {
|
|||||||
data: {
|
data: {
|
||||||
title: 'Act',
|
title: 'Act',
|
||||||
message: country.actionMessage,
|
message: country.actionMessage,
|
||||||
confirmText: 'Ok',
|
confirmText: 'Yes',
|
||||||
cancelText: 'Cancel'
|
cancelText: 'No'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="copyright">
|
<div class="copyright">
|
||||||
© {{ currentYear }} {{currentServiceProviderName}}. All rights reserved.
|
© {{ currentYear }} alpha Omega Infosys. All rights reserved.
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
@ -1,8 +1,6 @@
|
|||||||
import { Component, effect, inject, Input } from '@angular/core';
|
import { Component, Input } from '@angular/core';
|
||||||
import { AngularMaterialModule } from '../../shared/module/angular-material.module';
|
import { AngularMaterialModule } from '../../shared/module/angular-material.module';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { User } from '../../core/models/user';
|
|
||||||
import { UserService } from '../../core/services/common/user.service';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-footer',
|
selector: 'app-footer',
|
||||||
@ -12,20 +10,5 @@ import { UserService } from '../../core/services/common/user.service';
|
|||||||
})
|
})
|
||||||
export class FooterComponent {
|
export class FooterComponent {
|
||||||
currentYear = new Date().getFullYear();
|
currentYear = new Date().getFullYear();
|
||||||
currentServiceProviderName: string = '';
|
|
||||||
userDetails: User | null = {};
|
|
||||||
|
|
||||||
@Input() isUserLoggedIn = false;
|
@Input() isUserLoggedIn = false;
|
||||||
|
|
||||||
private userService = inject(UserService);
|
|
||||||
|
|
||||||
constructor(
|
|
||||||
) {
|
|
||||||
effect(() => {
|
|
||||||
this.userDetails = this.userService.userDetailsSignal();
|
|
||||||
if (this.userDetails?.userDetails) {
|
|
||||||
this.currentServiceProviderName = this.userDetails.userDetails.serviceProviderName || '';
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
5
src/app/core/models/industry-type.ts
Normal file
5
src/app/core/models/industry-type.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
export interface IndustryType {
|
||||||
|
name: string;
|
||||||
|
id: string;
|
||||||
|
value: string;
|
||||||
|
}
|
||||||
@ -11,4 +11,5 @@ export interface BasicDetail {
|
|||||||
zip: string;
|
zip: string;
|
||||||
carnetIssuingRegion: string;
|
carnetIssuingRegion: string;
|
||||||
revenueLocation: string;
|
revenueLocation: string;
|
||||||
|
industryType: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,8 +13,13 @@ export class PaymentService {
|
|||||||
private http = inject(HttpClient);
|
private http = inject(HttpClient);
|
||||||
|
|
||||||
createOrder(orderDetails: any): Promise<string> {
|
createOrder(orderDetails: any): Promise<string> {
|
||||||
|
const data = {
|
||||||
|
P_PRICE: orderDetails.price,
|
||||||
|
P_DESCRIPTION: orderDetails.description
|
||||||
|
}
|
||||||
|
|
||||||
return firstValueFrom(
|
return firstValueFrom(
|
||||||
this.http.post<{ id: string }>(`${this.apiUrl}/${this.apiDb}/InitiatePayment`, {})
|
this.http.post<{ id: string }>(`${this.apiUrl}/${this.apiDb}/InitiatePayment`, data)
|
||||||
).then(order => order.id);
|
).then(order => order.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -14,6 +14,7 @@ import { ApiErrorHandlerService } from './api-error-handler.service';
|
|||||||
})
|
})
|
||||||
export class AuthService {
|
export class AuthService {
|
||||||
private apiUrl = environment.apiUrl;
|
private apiUrl = environment.apiUrl;
|
||||||
|
private applicationName = environment.appType;
|
||||||
|
|
||||||
private http = inject(HttpClient);
|
private http = inject(HttpClient);
|
||||||
private userService = inject(UserService);
|
private userService = inject(UserService);
|
||||||
@ -24,7 +25,7 @@ export class AuthService {
|
|||||||
private errorHandler = inject(ApiErrorHandlerService);
|
private errorHandler = inject(ApiErrorHandlerService);
|
||||||
|
|
||||||
login(username: string, password: string): Observable<any> {
|
login(username: string, password: string): Observable<any> {
|
||||||
return this.http.post(`${this.apiUrl}/login`, { p_emailaddr: username, p_password: password });
|
return this.http.post(`${this.apiUrl}/login`, { p_emailaddr: username, p_password: password, P_APPLICATIONNAME: this.applicationName });
|
||||||
}
|
}
|
||||||
|
|
||||||
refreshToken(): Observable<any> {
|
refreshToken(): Observable<any> {
|
||||||
|
|||||||
@ -18,6 +18,7 @@ import { FormOfSecurity } from '../../models/formofsecurity';
|
|||||||
import { PaymentType } from '../../models/payment-type';
|
import { PaymentType } from '../../models/payment-type';
|
||||||
import { UnitOfMeasure } from '../../models/unitofmeasure';
|
import { UnitOfMeasure } from '../../models/unitofmeasure';
|
||||||
import { ExtensionReason } from '../../models/extension-reason';
|
import { ExtensionReason } from '../../models/extension-reason';
|
||||||
|
import { IndustryType } from '../../models/industry-type';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@ -59,7 +60,7 @@ export class CommonService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getRegions(): Observable<Region[]> {
|
getRegions(): Observable<Region[]> {
|
||||||
return this.http.get<any[]>(`${this.apiUrl}/${this.apiDb}/GetRegions`).pipe(
|
return this.http.get<any[]>(`${this.apiUrl}/${this.apiDb}/GetRegions/${this.userService.getUserSpid()}`).pipe(
|
||||||
map((response) =>
|
map((response) =>
|
||||||
response.map((item) => ({
|
response.map((item) => ({
|
||||||
id: item.REGIONID,
|
id: item.REGIONID,
|
||||||
@ -218,6 +219,18 @@ export class CommonService {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getIndustryTypes(): Observable<IndustryType[]> {
|
||||||
|
return this.http.get<any[]>(`${this.apiUrl}/${this.apiDb}/GetParamValues?P_PARAMTYPE=018&P_SPID=${this.userService.getUserSpid()}`).pipe(
|
||||||
|
map((response) =>
|
||||||
|
response.map((item) => ({
|
||||||
|
name: item.PARAMDESC,
|
||||||
|
id: item.PARAMID,
|
||||||
|
value: item.PARAMVALUE,
|
||||||
|
}))
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
formatUSDate(datetime: Date): string {
|
formatUSDate(datetime: Date): string {
|
||||||
const date = new Date(datetime);
|
const date = new Date(datetime);
|
||||||
const month = String(date.getUTCMonth() + 1).padStart(2, '0');
|
const month = String(date.getUTCMonth() + 1).padStart(2, '0');
|
||||||
|
|||||||
@ -34,6 +34,7 @@ export class BasicDetailService {
|
|||||||
carnetIssuingRegion: basicDetails.ISSUINGREGION,
|
carnetIssuingRegion: basicDetails.ISSUINGREGION,
|
||||||
revenueLocation: basicDetails.REVENUELOCATION,
|
revenueLocation: basicDetails.REVENUELOCATION,
|
||||||
zip: basicDetails.ZIP,
|
zip: basicDetails.ZIP,
|
||||||
|
industryType: ""// basicDetails.INDUSTRYTYPE
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -50,6 +51,7 @@ export class BasicDetailService {
|
|||||||
P_ZIP: data.zip,
|
P_ZIP: data.zip,
|
||||||
P_ISSUINGREGION: data.carnetIssuingRegion,
|
P_ISSUINGREGION: data.carnetIssuingRegion,
|
||||||
P_REVENUELOCATION: data.revenueLocation,
|
P_REVENUELOCATION: data.revenueLocation,
|
||||||
|
P_INDUSTRYTYPE: data.industryType,
|
||||||
P_USERID: this.userService.getUser(),
|
P_USERID: this.userService.getUser(),
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,6 +71,7 @@ export class BasicDetailService {
|
|||||||
P_COUNTRY: data.country,
|
P_COUNTRY: data.country,
|
||||||
P_ZIP: data.zip,
|
P_ZIP: data.zip,
|
||||||
P_REVENUELOCATION: data.revenueLocation,
|
P_REVENUELOCATION: data.revenueLocation,
|
||||||
|
P_INDUSTRYTYPE: data.industryType,
|
||||||
P_USERID: this.userService.getUser(),
|
P_USERID: this.userService.getUser(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -35,6 +35,7 @@ export class ClientService {
|
|||||||
carnetIssuingRegion: basicDetails.ISSUINGREGION,
|
carnetIssuingRegion: basicDetails.ISSUINGREGION,
|
||||||
revenueLocation: basicDetails.REVENUELOCATION,
|
revenueLocation: basicDetails.REVENUELOCATION,
|
||||||
zip: basicDetails.ZIP,
|
zip: basicDetails.ZIP,
|
||||||
|
industryType: ""
|
||||||
// createdBy: basicDetails.CREATEDBY || null,
|
// createdBy: basicDetails.CREATEDBY || null,
|
||||||
// dateCreated: basicDetails.DATECREATED || null,
|
// dateCreated: basicDetails.DATECREATED || null,
|
||||||
// lastUpdatedBy: basicDetails.LASTUPDATEDBY || null,
|
// lastUpdatedBy: basicDetails.LASTUPDATEDBY || null,
|
||||||
|
|||||||
@ -103,4 +103,8 @@ export class ContactService {
|
|||||||
reactivateContact(clientContactId: string): Observable<any> {
|
reactivateContact(clientContactId: string): Observable<any> {
|
||||||
return this.http.patch(`${this.apiUrl}/${this.apiDb}/ReactivateClientContacts/${this.userService.getUserSpid()}/${clientContactId}/${this.userService.getUser()}`, null);
|
return this.http.patch(`${this.apiUrl}/${this.apiDb}/ReactivateClientContacts/${this.userService.getUserSpid()}/${clientContactId}/${this.userService.getUser()}`, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setDefaultServiceProviderContact(clientContactId: string): Observable<any> {
|
||||||
|
return this.http.patch(`${this.apiUrl}/${this.apiDb}/ReactivateClientContacts/${this.userService.getUserSpid()}/${clientContactId}/${this.userService.getUser()}`, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,6 +15,7 @@ import { BasicDetail } from '../../core/models/holder/basic-detail';
|
|||||||
import { StorageService } from '../../core/services/common/storage.service';
|
import { StorageService } from '../../core/services/common/storage.service';
|
||||||
import { NavigationService } from '../../core/services/common/navigation.service';
|
import { NavigationService } from '../../core/services/common/navigation.service';
|
||||||
import { environment } from '../../../environments/environment';
|
import { environment } from '../../../environments/environment';
|
||||||
|
import { HolderService } from '../../core/services/carnet/holder.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-basic-detail',
|
selector: 'app-basic-detail',
|
||||||
@ -49,6 +50,7 @@ export class BasicDetailComponent implements OnInit, OnDestroy {
|
|||||||
private errorHandler = inject(ApiErrorHandlerService);
|
private errorHandler = inject(ApiErrorHandlerService);
|
||||||
private storageService = inject(StorageService);
|
private storageService = inject(StorageService);
|
||||||
private navigationService = inject(NavigationService);
|
private navigationService = inject(NavigationService);
|
||||||
|
private carnetHolderService = inject(HolderService);
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.basicDetailsForm = this.createForm();
|
this.basicDetailsForm = this.createForm();
|
||||||
@ -133,6 +135,9 @@ export class BasicDetailComponent implements OnInit, OnDestroy {
|
|||||||
if (!this.isEditMode) {
|
if (!this.isEditMode) {
|
||||||
this.holderIdCreated.emit(basicData.HOLDERID);
|
this.holderIdCreated.emit(basicData.HOLDERID);
|
||||||
|
|
||||||
|
// save the created holder for the current application
|
||||||
|
this.saveHolderToApplication(basicData.HOLDERID);
|
||||||
|
|
||||||
// change to edit mode after creation
|
// change to edit mode after creation
|
||||||
this.isEditMode = true;
|
this.isEditMode = true;
|
||||||
this.holderid = basicData.HOLDERID;
|
this.holderid = basicData.HOLDERID;
|
||||||
@ -226,4 +231,22 @@ export class BasicDetailComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
saveHolderToApplication(holderid: number): void {
|
||||||
|
this.changeInProgress = true;
|
||||||
|
const saveObservable = this.carnetHolderService.saveApplicationHolder(this.currentApplicationDetails?.headerid!, holderid);
|
||||||
|
|
||||||
|
saveObservable.pipe(finalize(() => {
|
||||||
|
this.changeInProgress = false;
|
||||||
|
})).subscribe({
|
||||||
|
next: (basicData: any) => {
|
||||||
|
},
|
||||||
|
error: (error: any) => {
|
||||||
|
let errorMessage = this.errorHandler.handleApiError(error, `Failed to save holder details`);
|
||||||
|
this.notificationService.showError(errorMessage);
|
||||||
|
console.error('Error saving holder details:', error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -85,8 +85,9 @@
|
|||||||
<mat-icon>chevron_right</mat-icon>
|
<mat-icon>chevron_right</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button mat-icon-button color="primary" *ngIf="isParamRecord" (click)="onEditParam(client)"
|
<button mat-icon-button color="primary" *ngIf="isParamRecord
|
||||||
[matTooltip]="'edit'">
|
&& allowEdit"
|
||||||
|
(click)="onEditParam(client)" [matTooltip]="'edit'">
|
||||||
<mat-icon>edit</mat-icon>
|
<mat-icon>edit</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
|||||||
@ -38,6 +38,7 @@ export class ParamTableComponent {
|
|||||||
paramData: any = [];
|
paramData: any = [];
|
||||||
showInactiveData: boolean = false;
|
showInactiveData: boolean = false;
|
||||||
isEditing: boolean = false;
|
isEditing: boolean = false;
|
||||||
|
allowEdit: boolean = true;
|
||||||
showForm: boolean = false;
|
showForm: boolean = false;
|
||||||
currentParamid: number | null = null;
|
currentParamid: number | null = null;
|
||||||
|
|
||||||
@ -116,6 +117,7 @@ export class ParamTableComponent {
|
|||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.paramType = this.route.snapshot.paramMap.get('id');
|
this.paramType = this.route.snapshot.paramMap.get('id');
|
||||||
|
this.allowEdit = this.paramType !== '014';
|
||||||
this.getParameters();
|
this.getParameters();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -111,8 +111,19 @@
|
|||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Carnet Issuing Region -->
|
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
|
<mat-form-field appearance="outline" class="industry-type">
|
||||||
|
<mat-label>Industry Type</mat-label>
|
||||||
|
<mat-select formControlName="industryType" required>
|
||||||
|
<mat-option *ngFor="let industryType of industryTypes" [value]="industryType.value">
|
||||||
|
{{ industryType.name }}
|
||||||
|
</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
<mat-error *ngIf="f['industryType'].errors?.['required']">
|
||||||
|
Industry Type is required
|
||||||
|
</mat-error>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
<mat-form-field appearance="outline" class="carnet-issuing-region">
|
<mat-form-field appearance="outline" class="carnet-issuing-region">
|
||||||
<mat-label>Carnet Issuing Region</mat-label>
|
<mat-label>Carnet Issuing Region</mat-label>
|
||||||
<mat-select formControlName="carnetIssuingRegion" required>
|
<mat-select formControlName="carnetIssuingRegion" required>
|
||||||
|
|||||||
@ -57,7 +57,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.carnet-issuing-region,
|
.carnet-issuing-region,
|
||||||
.revenue-location {
|
.revenue-location,
|
||||||
|
.industry-type {
|
||||||
grid-column: span 1;
|
grid-column: span 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,6 +14,7 @@ import { BasicDetail } from '../../core/models/preparer/basic-detail';
|
|||||||
import { ZipCodeValidator } from '../../shared/validators/zipcode-validator';
|
import { ZipCodeValidator } from '../../shared/validators/zipcode-validator';
|
||||||
import { LocationService } from '../../core/services/preparer/location.service';
|
import { LocationService } from '../../core/services/preparer/location.service';
|
||||||
import { Location } from '../../core/models/preparer/location';
|
import { Location } from '../../core/models/preparer/location';
|
||||||
|
import { IndustryType } from '../../core/models/industry-type';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-basic-details',
|
selector: 'app-basic-details',
|
||||||
@ -33,6 +34,7 @@ export class BasicDetailsComponent implements OnInit, OnDestroy {
|
|||||||
countries: Country[] = [];
|
countries: Country[] = [];
|
||||||
regions: Region[] = [];
|
regions: Region[] = [];
|
||||||
states: State[] = [];
|
states: State[] = [];
|
||||||
|
industryTypes: IndustryType[] = [];
|
||||||
|
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
changeInProgress = false;
|
changeInProgress = false;
|
||||||
@ -93,6 +95,7 @@ export class BasicDetailsComponent implements OnInit, OnDestroy {
|
|||||||
zip: ['', [Validators.required, ZipCodeValidator('country')]],
|
zip: ['', [Validators.required, ZipCodeValidator('country')]],
|
||||||
carnetIssuingRegion: ['', Validators.required],
|
carnetIssuingRegion: ['', Validators.required],
|
||||||
revenueLocation: ['', Validators.required],
|
revenueLocation: ['', Validators.required],
|
||||||
|
industryType: ['', Validators.required],
|
||||||
hasAdditionalLocations: [false]
|
hasAdditionalLocations: [false]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -110,6 +113,7 @@ export class BasicDetailsComponent implements OnInit, OnDestroy {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.loadRegions();
|
this.loadRegions();
|
||||||
|
this.loadIndustryTypes();
|
||||||
}
|
}
|
||||||
|
|
||||||
loadRegions(): void {
|
loadRegions(): void {
|
||||||
@ -125,6 +129,19 @@ export class BasicDetailsComponent implements OnInit, OnDestroy {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
loadIndustryTypes(): void {
|
||||||
|
this.commonService.getIndustryTypes()
|
||||||
|
.pipe(takeUntil(this.destroy$))
|
||||||
|
.subscribe({
|
||||||
|
next: (industryTypes) => {
|
||||||
|
this.industryTypes = industryTypes;
|
||||||
|
},
|
||||||
|
error: (error) => {
|
||||||
|
console.error('Failed to load industry types', error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
loadStates(country: string): void {
|
loadStates(country: string): void {
|
||||||
this.isLoading = true;
|
this.isLoading = true;
|
||||||
country = this.countriesHasStates.includes(country) ? country : 'FN';
|
country = this.countriesHasStates.includes(country) ? country : 'FN';
|
||||||
@ -164,7 +181,8 @@ export class BasicDetailsComponent implements OnInit, OnDestroy {
|
|||||||
state: data.state,
|
state: data.state,
|
||||||
zip: data.zip,
|
zip: data.zip,
|
||||||
carnetIssuingRegion: data.carnetIssuingRegion,
|
carnetIssuingRegion: data.carnetIssuingRegion,
|
||||||
revenueLocation: data.revenueLocation
|
revenueLocation: data.revenueLocation,
|
||||||
|
industryType: data.industryType
|
||||||
});
|
});
|
||||||
|
|
||||||
if (data.country) {
|
if (data.country) {
|
||||||
|
|||||||
@ -82,10 +82,11 @@
|
|||||||
reactivateContact(contact.clientContactId)" [hidden]="!contact.isInactive" matTooltip="Reactivate">
|
reactivateContact(contact.clientContactId)" [hidden]="!contact.isInactive" matTooltip="Reactivate">
|
||||||
<mat-icon>loupe</mat-icon>
|
<mat-icon>loupe</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<!-- <button mat-icon-button (click)="setDefaultContact(contact.contactId)"
|
<button mat-icon-button (click)="setDefaultContact(contact.clientContactId)"
|
||||||
[color]="contact.defaultContact ? 'primary' : ''" matTooltip="Set as default">
|
*ngIf="!contact.defaultContact || !contact.isInactive"
|
||||||
|
[hidden]="contact.defaultContact || contact.isInactive" matTooltip="Set as default contact">
|
||||||
<mat-icon>star</mat-icon>
|
<mat-icon>star</mat-icon>
|
||||||
</button> -->
|
</button>
|
||||||
</td>
|
</td>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
|
|||||||
@ -302,16 +302,32 @@ export class ContactsComponent {
|
|||||||
// this.contactLoginForm.reset();
|
// this.contactLoginForm.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
// setDefaultContact(contactId: string): void {
|
setDefaultContact(contactId: string): void {
|
||||||
// this.contactService.setDefaultServiceProviderContact(this.spid, contactId).subscribe({
|
|
||||||
// next: () => {
|
const dialogRef = this.dialog.open(ConfirmDialogComponent, {
|
||||||
// this.notificationService.showSuccess('Default contact updated successfully');
|
width: '450px',
|
||||||
// this.loadContacts();
|
data: {
|
||||||
// },
|
title: 'Confirm Default Contact',
|
||||||
// error: (error) => {
|
message: 'Are you sure you want to set this contact as default contact?',
|
||||||
// this.notificationService.showError('Failed to set default contact');
|
confirmText: 'Yes',
|
||||||
// console.error('Error setting default contact:', error);
|
cancelText: 'Cancel'
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
// }
|
|
||||||
|
dialogRef.afterClosed().subscribe(result => {
|
||||||
|
if (result) {
|
||||||
|
this.contactService.setDefaultServiceProviderContact(contactId).subscribe({
|
||||||
|
next: () => {
|
||||||
|
this.notificationService.showSuccess('Default contact updated successfully');
|
||||||
|
this.loadContacts();
|
||||||
|
},
|
||||||
|
error: (error) => {
|
||||||
|
let errorMessage = this.errorHandler.handleApiError(error, 'Failed to set default contact');
|
||||||
|
this.notificationService.showError(errorMessage);
|
||||||
|
console.error('Error setting default contact:', error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -94,6 +94,12 @@
|
|||||||
<td mat-cell *matCellDef="let client">{{client.country}}</td>
|
<td mat-cell *matCellDef="let client">{{client.country}}</td>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
|
<!-- Industy Type Column -->
|
||||||
|
<ng-container matColumnDef="industryType">
|
||||||
|
<th mat-header-cell *matHeaderCellDef mat-sort-header>Industry Type </th>
|
||||||
|
<td mat-cell *matCellDef="let client">{{client.industryType}}</td>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!-- Carnet Issuing region Column -->
|
<!-- Carnet Issuing region Column -->
|
||||||
<ng-container matColumnDef="carnetIssuingRegion">
|
<ng-container matColumnDef="carnetIssuingRegion">
|
||||||
<th mat-header-cell *matHeaderCellDef mat-sort-header>Carnet Issuing region </th>
|
<th mat-header-cell *matHeaderCellDef mat-sort-header>Carnet Issuing region </th>
|
||||||
|
|||||||
@ -39,7 +39,7 @@ export class ManagePreparerComponent implements OnInit, OnDestroy, AfterViewInit
|
|||||||
isLoading = false;
|
isLoading = false;
|
||||||
userPreferences: UserPreferences;
|
userPreferences: UserPreferences;
|
||||||
|
|
||||||
displayedColumns: string[] = ['name', 'address', 'city', 'state', 'country', 'carnetIssuingRegion', 'revenueLocation', 'actions'];
|
displayedColumns: string[] = ['name', 'address', 'city', 'state', 'country', 'industryType', 'carnetIssuingRegion', 'revenueLocation', 'actions'];
|
||||||
dataSource = new MatTableDataSource<any>([]);
|
dataSource = new MatTableDataSource<any>([]);
|
||||||
|
|
||||||
private destroy$ = new Subject<void>();
|
private destroy$ = new Subject<void>();
|
||||||
|
|||||||
@ -71,7 +71,7 @@ export class SecurityDepositComponent implements OnInit {
|
|||||||
holderType: ['CORP', Validators.required],
|
holderType: ['CORP', Validators.required],
|
||||||
uscibMember: ['Y', Validators.required],
|
uscibMember: ['Y', Validators.required],
|
||||||
specialCommodity: [''],
|
specialCommodity: [''],
|
||||||
specialCountry: ['US'],
|
specialCountry: [''],
|
||||||
rate: [0, [Validators.required, Validators.min(0)]],
|
rate: [0, [Validators.required, Validators.min(0)]],
|
||||||
effectiveDate: ['', Validators.required]
|
effectiveDate: ['', Validators.required]
|
||||||
});
|
});
|
||||||
@ -145,7 +145,7 @@ export class SecurityDepositComponent implements OnInit {
|
|||||||
this.depositForm.reset({
|
this.depositForm.reset({
|
||||||
holderType: 'CORP',
|
holderType: 'CORP',
|
||||||
uscibMember: 'N',
|
uscibMember: 'N',
|
||||||
specialCountry: 'US',
|
specialCountry: '',
|
||||||
});
|
});
|
||||||
this.depositForm.patchValue({ rate: 0 });
|
this.depositForm.patchValue({ rate: 0 });
|
||||||
|
|
||||||
@ -245,7 +245,7 @@ export class SecurityDepositComponent implements OnInit {
|
|||||||
this.depositForm.reset({
|
this.depositForm.reset({
|
||||||
holderType: 'CORP',
|
holderType: 'CORP',
|
||||||
uscibMember: 'N',
|
uscibMember: 'N',
|
||||||
specialCountry: 'US',
|
specialCountry: '',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user