terms & conditions page updates

This commit is contained in:
Cyril Joseph 2025-07-23 16:38:54 -03:00
parent e89f968786
commit c58b276316
4 changed files with 109 additions and 8 deletions

View File

@ -73,10 +73,17 @@
<h3>8. Fees and Charges</h3> <h3>8. Fees and Charges</h3>
<p>8.1 The following fees apply:</p> <p>8.1 The following fees apply:</p>
<ul> <ul>
<li>Issuance fee: 1.5% of total goods value (minimum $250)</li>
<li>Processing fee: $75 per application</li> <li *ngIf="estimatedFees.basicFee">Basic fee: {{estimatedFees.basicFee | currency}}</li>
<li>Amendment fee: $50 per change after issuance</li> <li *ngIf="estimatedFees.counterFoilFee">Counterfoil Fee: {{estimatedFees.counterFoilFee | currency}}
<li>Late discharge fee: $100 if not returned within 30 days of expiration</li> </li>
<li *ngIf="estimatedFees.continuationSheetFee">Continuation sheet fee:
{{estimatedFees.continuationSheetFee | currency}}</li>
<li *ngIf="estimatedFees.expeditedFee">Expedited fee: {{estimatedFees.expeditedFee | currency}}</li>
<li *ngIf="estimatedFees.shippingFee">Shipping fee: {{estimatedFees.shippingFee | currency}}</li>
<li *ngIf="estimatedFees.bondPremium">Bond Premium: {{estimatedFees.bondPremium | currency}}</li>
<li *ngIf="estimatedFees.cargoPremium">Cargo Premium: {{estimatedFees.cargoPremium | currency}}</li>
<li *ngIf="estimatedFees.ldiPremium">LDI Premium: {{estimatedFees.ldiPremium | currency}}</li>
</ul> </ul>
<h3>9. Dispute Resolution</h3> <h3>9. Dispute Resolution</h3>

View File

@ -7,10 +7,11 @@ import { MatCheckboxModule } from '@angular/material/checkbox';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms'; import { FormsModule } from '@angular/forms';
import { ApiErrorHandlerService } from '../../core/services/common/api-error-handler.service'; import { ApiErrorHandlerService } from '../../core/services/common/api-error-handler.service';
import { CommonService } from '../../core/services/common/common.service';
import { NavigationService } from '../../core/services/common/navigation.service'; import { NavigationService } from '../../core/services/common/navigation.service';
import { NotificationService } from '../../core/services/common/notification.service'; import { NotificationService } from '../../core/services/common/notification.service';
import { StorageService } from '../../core/services/common/storage.service'; import { StorageService } from '../../core/services/common/storage.service';
import { CarnetService } from '../../core/services/carnet/carnet.service';
import { Fees } from '../../core/models/carnet/fee';
@Component({ @Component({
selector: 'app-terms-conditions', selector: 'app-terms-conditions',
@ -28,23 +29,57 @@ export class TermsConditionsComponent {
currentDate = new Date(); currentDate = new Date();
hasReadAllTerms = false; hasReadAllTerms = false;
currentApplicationDetails: { headerid: number, applicationName: string } | null = null; currentApplicationDetails: { headerid: number, applicationName: string } | null = null;
isLoading: boolean = false;
estimatedFees: Fees = {};
private notificationService = inject(NotificationService); private notificationService = inject(NotificationService);
private commonService = inject(CommonService);
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 carnetService = inject(CarnetService);
constructor() { constructor() {
this.currentApplicationDetails = this.storageService.get<{ headerid: number, applicationName: string }>('currentapplication') this.currentApplicationDetails = this.storageService.get<{ headerid: number, applicationName: string }>('currentapplication')
} }
ngOnInit(): void {
if (this.currentApplicationDetails?.headerid) {
this.carnetService.getEstimatedFees(this.currentApplicationDetails?.headerid).subscribe({
next: (data: Fees) => {
if (data) {
this.estimatedFees = data;
}
},
error: (error: any) => {
let errorMessage = this.errorHandler.handleApiError(error, 'Failed to get estimated fees');
this.notificationService.showError(errorMessage);
console.error('Error getting estimated fees:', error);
}
});
}
}
onAccept(): void { onAccept(): void {
console.log('Terms accepted');
this.isLoading = true;
this.carnetService.submitApplication(this.currentApplicationDetails?.headerid!).subscribe({
next: () => {
this.notificationService.showSuccess('Application submitted successfully');
this.storageService.removeItem('currentapplication');
this.navigationService.navigate(["home"]);
this.isLoading = false;
},
error: (error) => {
let errorMessage = this.errorHandler.handleApiError(error, 'Failed to submit application');
this.notificationService.showError(errorMessage);
console.error('Error submitting the application', error);
this.isLoading = false;
}
});
} }
onDecline(): void { onDecline(): void {
this.storageService.removeItem('currentapplication') this.storageService.removeItem('currentapplication');
this.navigationService.navigate(["edit-carnet", this.currentApplicationDetails?.headerid], this.navigationService.navigate(["edit-carnet", this.currentApplicationDetails?.headerid],
{ {
state: { isEditMode: true }, state: { isEditMode: true },

View File

@ -0,0 +1,10 @@
export interface Fees {
basicFee?: number | null | undefined;
counterFoilFee?: number | null | undefined;
continuationSheetFee?: number | null | undefined;
expeditedFee?: number | null | undefined;
shippingFee?: number | null | undefined;
bondPremium?: number | null | undefined;
cargoPremium?: number | null | undefined;
ldiPremium?: number | null | undefined;
}

View File

@ -0,0 +1,49 @@
import { HttpClient } from '@angular/common/http';
import { inject, Injectable } from '@angular/core';
import { Observable, filter, map } from 'rxjs';
import { environment } from '../../../../environments/environment';
import { UserService } from '../common/user.service';
import { Fees } from '../../models/carnet/fee';
@Injectable({
providedIn: 'root'
})
export class CarnetService {
private apiUrl = environment.apiUrl;
private apiDb = environment.apiDb;
private http = inject(HttpClient);
private userService = inject(UserService);
getEstimatedFees(headerid: number): Observable<Fees> {
return this.http.get<any>(`${this.apiUrl}/${this.apiDb}/EstimatedFees/${this.userService.getUserSpid()}/${this.userService.getUser()}/${headerid}`).pipe(
filter(response => response.length > 0),
map(response => this.mapToFeesData(response?.[0])));
}
private mapToFeesData(estimatedFeesDetails: any): Fees {
let estimatedFeesData: Fees = {
basicFee: estimatedFeesDetails.BASICFEE,
counterFoilFee: estimatedFeesDetails.CFFEE,
continuationSheetFee: estimatedFeesDetails.CSFEE,
expeditedFee: estimatedFeesDetails.EFFEE,
shippingFee: estimatedFeesDetails.SHIPFEE,
bondPremium: estimatedFeesDetails.BONDPREMIUM,
cargoPremium: estimatedFeesDetails.CARGOPREMIUM,
ldiPremium: estimatedFeesDetails.LDIPREMIUM,
};
return estimatedFeesData;
}
submitApplication(headerid: number): Observable<any> {
let appData = {
P_SPID: this.userService.getUserSpid(),
P_USERID: this.userService.getUser(),
P_HEADERID: headerid
}
return this.http.post<any>(`${this.apiUrl}/${this.apiDb}/TransmitApplicationtoProcess`, appData);
}
}