import { Component, OnInit } from '@angular/core'; import { ORDER_STATUS } from '../shared/form.constants'; import * as Constants from '../shared/constants'; import { Cart } from '../shared/modal/cart'; import { Customer } from '../shared/modal/customer'; import { IShipping, IDormantProperties, IPayment } from '../shared/modal/common'; @Component({ selector: 'eip-confirm', templateUrl: './eip-confirm.component.html', styleUrls: ['./eip-confirm.component.css'] }) export class EipConfirmComponent implements OnInit { private COMPONENT_NAME: string = 'HardGoodsComponent'; orderStatusItems: any[]; cart: Cart; customer: Customer; shippingInfo: IShipping; paymentData: IPayment; dormanProperties: IDormantProperties; orderIdFromURL: number; storeIdFromURL: number; // canOverrideRemorse constructor() { } ngOnInit(): void { const METHOD_NAME: string = 'ngOnInit()'; this.orderStatusItems = ORDER_STATUS.filter(orderStatusItem => orderStatusItem); this.receiveShippingData(event); this.receivePaymentDetails(event); this.receiveCartDetails(event); } receiveShippingData($event) { this.shippingInfo = $event; } receivePaymentDetails($event) { this.paymentData = $event } receiveCartDetails($event) { this.cart = $event } getStatusLabel(status: string): string { const METHOD_NAME: string = 'getStatusLabel()'; for (const item of this.orderStatusItems) { if (item.key === status) { return item.value; } } return Constants.NOT_FOUND; } }