Commit 8e6584e9 authored by Michail Tzanatos's avatar Michail Tzanatos
Browse files

refactor product order management components to replace service order...

refactor product order management components to replace service order references with product order references
parent 96025dce
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@
                    
                            <ng-container matColumnDef="id">
                                <th mat-header-cell *matHeaderCellDef mat-sort-header> Order ID</th>
                                <td mat-cell *matCellDef="let element"> <a routerLink="/services/service_order/{{element.id}}">{{element.id}}</a>
                                <td mat-cell *matCellDef="let element"> <a routerLink="/products/product_order/{{element.id}}">{{element.id}}</a>
                                </td>
                            </ng-container>
                    
+56 −61

File changed.

Preview size limit exceeded, changes collapsed.

+101 −100
Original line number Diff line number Diff line
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { ServiceOrder, ServiceOrderUpdate, ServiceRef, ServiceOrderItem } from 'src/app/openApis/serviceOrderingManagement/models';
import { ServiceOrderService } from 'src/app/openApis/serviceOrderingManagement/services';
import { ProductOrder, ProductOrderUpdate, ServiceRef, ProductOrderItem } from 'src/app/openApis/productOrderingManagement/models';
import { ProductOrderService } from 'src/app/openApis/productOrderingManagement/services';
import { ToastrService } from 'ngx-toastr';
import { UntypedFormControl, UntypedFormGroup } from '@angular/forms';
import { ServiceService } from 'src/app/openApis/serviceInventoryManagement/services';
@@ -34,7 +34,7 @@ export class PreviewProductOrderComponent implements OnInit {

  constructor(
    private activatedRoute: ActivatedRoute,
    private orderService: ServiceOrderService,
    private orderService: ProductOrderService,
    private router: Router,
    private inventoryService: ServiceService,
    private toast: ToastrService,
@@ -53,9 +53,9 @@ export class PreviewProductOrderComponent implements OnInit {
  availablePriorities = ['low', 'normal', 'high']


  serviceOrder: ServiceOrder
  productOrder: ProductOrder
  orderID: string
  serviceOrderNotFound: boolean = false
  productOrderNotFound: boolean = false
  finishedLoading: boolean = false

  supportingServices: Service[][] = []
@@ -72,8 +72,8 @@ export class PreviewProductOrderComponent implements OnInit {
    note: new UntypedFormControl()
  })

  checkboxesOrderItemList: {orderItem: ServiceOrderItem, isChecked: boolean}[] = []
  selection = new SelectionModel<ServiceOrderItem>(true, []);
  checkboxesOrderItemList: {orderItem: ProductOrderItem, isChecked: boolean}[] = []
  selection = new SelectionModel<ProductOrderItem>(true, []);

  subscription = new Subscription

@@ -86,7 +86,7 @@ export class PreviewProductOrderComponent implements OnInit {
    if (this.activatedRoute.snapshot.params.id)
    {
      this.orderID = this.activatedRoute.snapshot.params.id
      this.retrieveServiceOrder()
      this.retrieveProductOrder()
    } else {
      this.router.navigate(['../service_orders'], { relativeTo: this.activatedRoute})
    }
@@ -96,71 +96,71 @@ export class PreviewProductOrderComponent implements OnInit {
    this.activeListItem = item
    
    if (!this.staticListItems.includes(item))
     this.serviceOrder.orderItem.find(it => it.id === item).service.serviceCharacteristic
     this.productOrder.productOrderItem.find(it => it.id === item).product.productCharacteristic
  } 

  retrieveServiceOrder() {
  retrieveProductOrder() {
    this.selection.clear()
    this.orderService.retrieveServiceOrder({id: this.orderID}).subscribe(
      data => this.serviceOrder = data,
    this.orderService.retrieveProductOrder({id: this.orderID}).subscribe(
      data => this.productOrder = data,
      error => { console.error(error) },
      () => { 
        if (this.serviceOrder) {
        if (this.productOrder) {
          this.finishedLoading = true
          
          this.editForm.patchValue({
            state: this.serviceOrder.state,
            startDate: this.serviceOrder.startDate ? this.serviceOrder.startDate : this.serviceOrder.requestedStartDate,
            expectedCompletionDate: this.serviceOrder.expectedCompletionDate ? this.serviceOrder.expectedCompletionDate : this.serviceOrder.completionDate
            state: this.productOrder.state,
            startDate: this.productOrder.requestedStartDate ? this.productOrder.requestedStartDate : this.productOrder.requestedStartDate,
            expectedCompletionDate: this.productOrder.expectedCompletionDate ? this.productOrder.expectedCompletionDate : this.productOrder.completionDate
          })

          this.serviceOrder.note.sort(this.sortingService.ascDateSortingFuncByDateProperty())
          this.productOrder.note.sort(this.sortingService.ascDateSortingFuncByDateProperty())

          if (!this.serviceOrder.startDate) { this.serviceOrder.startDate = this.serviceOrder.requestedStartDate }
          if (!this.productOrder.requestedStartDate) { this.productOrder.requestedStartDate = this.productOrder.requestedStartDate }

          if (!this.serviceOrder.expectedCompletionDate) { this.serviceOrder.expectedCompletionDate = this.serviceOrder.requestedCompletionDate }
          if (!this.productOrder.expectedCompletionDate) { this.productOrder.expectedCompletionDate = this.productOrder.requestedCompletionDate }
  
          this.checkboxesOrderItemList = []
          this.currentItemRelationshipsUrl = []
          
          this.supportingServices = []
          this.serviceOrder.orderItem.forEach((orderItem) => {
          this.productOrder.productOrderItem.forEach((orderItem) => {
            
            //Expands the length of the array for each Service Order Item
            this.supportingServices.push([])

            this.checkboxesOrderItemList.push({orderItem: orderItem, isChecked: false})

            orderItem.service.serviceCharacteristic.sort(this.sortingService.ascStringSortingFunctionByNameProperty())
            orderItem.product.productCharacteristic.sort(this.sortingService.ascStringSortingFunctionByNameProperty())
  
            orderItem.service.supportingService.forEach( (supService) => {
              this.retrieveServiceInventory(supService.id).subscribe(
                data => {
                  const orderItemIndex = this.serviceOrder.orderItem.findIndex(SOI => orderItem.id === SOI.id)
                  const supportingServiceIndex = this.serviceOrder.orderItem[orderItemIndex].service.supportingService.findIndex(SupS => supService.id === SupS.id)
                  this.supportingServices[orderItemIndex][supportingServiceIndex] = data
                }
              )
            })
            // orderItem.product.realizingService.forEach( (supService) => {
            //   this.retrieveProductInventory(supService.id).subscribe(
            //     data => {
            //       const orderItemIndex = this.productOrder.productOrderItem.findIndex(SOI => orderItem.id === SOI.id)
            //       const supportingServiceIndex = this.productOrder.productOrderItem[orderItemIndex].product.realizingService.findIndex(SupS => supService.id === SupS.id)
            //       this.supportingServices[orderItemIndex][supportingServiceIndex] = data
            //     }
            //   )
            // })
            
            this.currentItemRelationshipsUrl.push( this.orderService.rootUrl + "/serviceOrdering/v4/serviceOrder/" + this.serviceOrder.id + "/item/" + orderItem.id + "/relationship_graph" );
            // this.currentItemRelationshipsUrl.push( this.orderService.rootUrl + "/productOrderingManagement/v4/productOrder/" + this.productOrder.id + "/item/" + orderItem.id + "/relationship_graph" );
          })

          this.notesGraphUrl  = this.orderService.rootUrl + "/serviceOrdering/v4/serviceOrder/" + this.serviceOrder.id + "/notes_graph";
          // this.notesGraphUrl  = this.orderService.rootUrl + "/productOrderingManagement/v4/productOrder/" + this.productOrder.id + "/notes_graph";
          
          if (this.activatedRoute.snapshot.queryParams &&  this.serviceOrder.orderItem.some(item => item.id === this.activatedRoute.snapshot.queryParams.item)) {
          if (this.activatedRoute.snapshot.queryParams &&  this.productOrder.productOrderItem.some(item => item.id === this.activatedRoute.snapshot.queryParams.item)) {
            // console.log(this.activatedRoute.snapshot.queryParams)
            this.activeListItem = this.activatedRoute.snapshot.queryParams.item
            
          }
        } else {
          this.serviceOrderNotFound = true
          this.productOrderNotFound = true
        }
      }
    )
  }

  retrieveServiceInventory(serviceId:string) {
  retrieveProductInventory(serviceId:string) {
    return this.inventoryService.retrieveService({id:serviceId})
  }

@@ -208,10 +208,11 @@ export class PreviewProductOrderComponent implements OnInit {

  submitOrderEditing() {
    this.editMode = false
    let orderUpdate: ServiceOrderUpdate = {
    let orderUpdate: ProductOrderUpdate = {
      state: this.editForm.get('state').value,
      startDate: this.editForm.get('startDate').value,
      requestedStartDate: this.editForm.get('startDate').value,
      expectedCompletionDate: this.editForm.get('expectedCompletionDate').value,
      productOrderItem: []
    }
    if (this.editForm.get('note').value) {
      orderUpdate.note = [{
@@ -221,13 +222,13 @@ export class PreviewProductOrderComponent implements OnInit {
      }]
    }

    this.orderService.patchServiceOrder({serviceOrder: orderUpdate, id: this.orderID}).subscribe(
      data => {this.toast.success("Service Order was successfully updated")},
      error => {console.error(error); this.toast.error("An error occurred while editing Service Order")},
      () => {
        this.enableOrderRefreshTimer()
      }
    )
    // this.orderService.patchProductOrder({productOrder: orderUpdate, id: this.orderID}).subscribe(
    //   data => {this.toast.success("Service Order was successfully updated")},
    //   error => {console.error(error); this.toast.error("An error occurred while editing Service Order")},
    //   () => {
    //     this.enableOrderRefreshTimer()
    //   }
    // )
  }

  cancelOrderEditing() {
@@ -238,7 +239,7 @@ export class PreviewProductOrderComponent implements OnInit {
    this.editModeNotes = !this.editModeNotes
  }

  // openOrdersSpecCharacteristicsDialog(orderItem: ServiceOrderItem) {
  // openOrdersSpecCharacteristicsDialog(orderItem: ProductOrderItem) {
    
  //   const dialogRef = this.dialog.open(EditOrdersServiceSpecCharacteristicsComponent, {
  //     data: { orderItem }
@@ -251,18 +252,18 @@ export class PreviewProductOrderComponent implements OnInit {
  //       // if (result) {
  //       //   orderItem.service.serviceCharacteristic = result
  //       // }
  //       console.log(this.serviceOrder)
  //       console.log(this.productOrder)
  //       if (result) {

  //         let newOrderUpdate: ServiceOrderUpdate = {
  //         let newOrderUpdate: ProductOrderUpdate = {
  //           orderItem: []
  //         }

  //         this.serviceOrder.orderItem.find(item => item.id === orderItem.id).service.serviceCharacteristic = result
  //         newOrderUpdate.orderItem = this.serviceOrder.orderItem
  //         this.productOrder.orderItem.find(item => item.id === orderItem.id).service.serviceCharacteristic = result
  //         newOrderUpdate.orderItem = this.productOrder.orderItem

  //         this.orderService.patchServiceOrder({serviceOrder: newOrderUpdate, id: this.serviceOrder.id}).subscribe(
  //           data => { this.retrieveServiceOrder() },
  //         this.orderService.patchProductOrder({productOrder: newOrderUpdate, id: this.productOrder.id}).subscribe(
  //           data => { this.retrieveProductOrder() },
  //           error => console.error(error)
  //         )
  //       }
@@ -272,15 +273,15 @@ export class PreviewProductOrderComponent implements OnInit {

  areOrderItemsEditable() {
    // states > 'INITIAL'|'ACKNOWLEDGED'|'REJECTED'|'PENDING'|'HELD'|'INPROGRESS'|'CANCELLED'|'COMPLETED'|'FAILED'|'PARTIAL'
    // return ['INITIAL', 'REJECTED','CANCELLED', 'COMPLETED', 'FAILED', 'PARTIAL'].includes(this.serviceOrder.state)
    return ['INITIAL'].includes(this.serviceOrder.state)
    // return ['INITIAL', 'REJECTED','CANCELLED', 'COMPLETED', 'FAILED', 'PARTIAL'].includes(this.productOrder.state)
    return ['INITIAL'].includes(this.productOrder.state)
  }

  areOrderItemsTerminable() {
    return ['COMPLETED', 'FAILED', 'PARTIAL'].includes(this.serviceOrder.state)
    return ['COMPLETED', 'FAILED', 'PARTIAL'].includes(this.productOrder.state)
  }

  openEditServiceOrderItemsDialog() {
  openEditProductOrderItemsDialog() {
    const dialogRef = this.dialog.open(EditProductOrderItemsComponent, {
      data: this.selection.selected,
      minWidth: "60vw"
@@ -292,41 +293,41 @@ export class PreviewProductOrderComponent implements OnInit {
        // console.log(editedOrderItems)
        if (editedOrderItems) {

          let newOrderUpdate: ServiceOrderUpdate = {
            orderItem: []
          }
          editedOrderItems.forEach( editedOrderItem => {
            this.serviceOrder.orderItem.find(item => item.id === editedOrderItem.orderItemID).service.serviceCharacteristic = editedOrderItem.serviceSpecChars
            // Decide orderItem action verb
            if (this.serviceOrder.state === "COMPLETED") {
              this.serviceOrder.orderItem.find(item => item.id === editedOrderItem.orderItemID).action = "modify"
          let newOrderUpdate: ProductOrderUpdate = {
            productOrderItem: []
          }
          // editedOrderItems.forEach( editedOrderItem => {
          //   this.productOrder.productOrderItem.find(item => item.id === editedOrderItem.orderItemID).product.productCharacteristic = editedOrderItem.serviceSpecChars
          //   // Decide orderItem action verb
          //   if (this.productOrder.state === "COMPLETED") {
          //     this.productOrder.productOrderItem.find(item => item.id === editedOrderItem.orderItemID).action = "modify"
          //   }

            // newOrderUpdate.orderItem.push(this.serviceOrder.orderItem.find(item => item.id === editedOrderItem.orderItemID))
          })
          //   // newOrderUpdate.orderItem.push(this.productOrder.orderItem.find(item => item.id === editedOrderItem.orderItemID))
          // })

          newOrderUpdate.orderItem = this.serviceOrder.orderItem
          newOrderUpdate.productOrderItem = this.productOrder.productOrderItem

          // console.log(newOrderUpdate)

          this.orderService.patchServiceOrder({serviceOrder: newOrderUpdate, id: this.serviceOrder.id}).subscribe(
            data => { 
              this.toast.success("Selected Order Items were successfully updated")
              this.retrieveServiceOrder() 
            },
            error => {
              this.toast.error("An error occurred while updating Service Order Items")
              this.retrieveServiceOrder() 
              console.error(error)
            }
          )
          // this.orderService.patchProductOrder({productOrder: newOrderUpdate, id: this.productOrder.id}).subscribe(
          //   data => { 
          //     this.toast.success("Selected Order Items were successfully updated")
          //     this.retrieveProductOrder() 
          //   },
          //   error => {
          //     this.toast.error("An error occurred while updating Service Order Items")
          //     this.retrieveProductOrder() 
          //     console.error(error)
          //   }
          // )
        }
      }
    )

  }

  terminateServiceOrderItemsDialog() {
  terminateProductOrderItemsDialog() {
    const dialogRef = this.dialog.open(TerminateProductOrderItemsComponent, {
      data: this.selection.selected
    })
@@ -334,29 +335,29 @@ export class PreviewProductOrderComponent implements OnInit {
    dialogRef.afterClosed().subscribe(
      result => {
        if (result) {
          let newOrderUpdate: ServiceOrderUpdate = {
            orderItem: []
          let newOrderUpdate: ProductOrderUpdate = {
            productOrderItem: []
          }
          this.selection.selected.forEach( selectedOrderItem => {
            this.serviceOrder.orderItem.find(item => item.id === selectedOrderItem.id).action = "modify"
            this.serviceOrder.orderItem.find(item => item.id === selectedOrderItem.id).service.state = "terminated"
          })
          // this.selection.selected.forEach( selectedOrderItem => {
          //   this.productOrder.productOrderItem.find(item => item.id === selectedOrderItem.id).action = "modify"
          //   this.productOrder.productOrderItem.find(item => item.id === selectedOrderItem.id).product.state = "terminated"
          // })

          newOrderUpdate.orderItem = this.serviceOrder.orderItem
          newOrderUpdate.productOrderItem = this.productOrder.productOrderItem

          // console.log(newOrderUpdate)

          this.orderService.patchServiceOrder({serviceOrder: newOrderUpdate, id: this.serviceOrder.id}).subscribe(
            data => { 
              this.toast.success("Selected Order Items were successfully updated")
              this.retrieveServiceOrder() 
            },
            error => {
              this.toast.error("An error occurred while updating Service Order Items")
              this.retrieveServiceOrder() 
              console.error(error)
            }
          )
          // this.orderService.patchProductOrder({productOrder: newOrderUpdate, id: this.productOrder.id}).subscribe(
          //   data => { 
          //     this.toast.success("Selected Order Items were successfully updated")
          //     this.retrieveProductOrder() 
          //   },
          //   error => {
          //     this.toast.error("An error occurred while updating Service Order Items")
          //     this.retrieveProductOrder() 
          //     console.error(error)
          //   }
          // )
        }
      }
    )
@@ -365,14 +366,14 @@ export class PreviewProductOrderComponent implements OnInit {
  //checkBoxSelection Logic
  isAllSelected() {
    const numSelected = this.selection.selected.length
    const numItems = this.serviceOrder.orderItem.length
    const numItems = this.productOrder.productOrderItem.length
    return numSelected === numItems
  }

  masterCheckboxToggle() {
    this.isAllSelected() ? 
      this.selection.clear() :
      this.serviceOrder.orderItem.forEach (item => this.selection.select(item))
      this.productOrder.productOrderItem.forEach (item => this.selection.select(item))
  }
  //---checkBoxSelection Logic

@@ -381,7 +382,7 @@ export class PreviewProductOrderComponent implements OnInit {
    this.subscription = timer(0, 10000).subscribe(
      data => {
        // this.supportingServices = [[]]
        this.retrieveServiceOrder()
        this.retrieveProductOrder()
      }
    )
  }
+93 −75
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@ const today = new Date();
  templateUrl: './product-order-checkout.component.html',
  styleUrls: ['./product-order-checkout.component.scss']
})

export class ProductOrderCheckoutComponent implements OnInit {

  constructor(
@@ -51,8 +50,6 @@ export class ProductOrderCheckoutComponent implements OnInit {
    this.populateOrderedSpecsConfigurationList()
  }


  
  freshLoadOrderListChanges() {
    let storageOrderArray = []
    storageOrderArray = JSON.parse(localStorage.getItem('orderedProductSpecsList')) || []
@@ -82,7 +79,6 @@ export class ProductOrderCheckoutComponent implements OnInit {
    }
  }


  initCharacteristicsValue(orderedSpec: ProductOffering): { name: string; valueType: string; value: import("src/app/openApis/productCatalogManagement/models").ProductSpecificationCharacteristicValue[]; }[] {
    let initialCharValues: {
      name: string,
@@ -106,16 +102,12 @@ export class ProductOrderCheckoutComponent implements OnInit {
      })
    })


    return initialCharValues
  }

  initValuesForm() {
    // console.log(this.requesterService.serviceConfigurationList)
    this.specCharFormArray = new UntypedFormArray([])
    
    const formArray = this.specCharFormArray as UntypedFormArray
    
    this.configurableSpecChar = this.selectedOrderSpecToView.offering.prodSpecCharValueUse;

    //Sort Configurable Characteristics by Asc Name Order
@@ -124,7 +116,6 @@ export class ProductOrderCheckoutComponent implements OnInit {
    this.configurableSpecChar.forEach((confSpecChar) => {
      formArray.push(this.updateFormArrayItem(confSpecChar))
    })
    
  }

  updateFormArrayItem(specChar: ProductSpecificationCharacteristicRes): UntypedFormGroup {
@@ -152,9 +143,7 @@ export class ProductOrderCheckoutComponent implements OnInit {
  }

  viewAndConfigureSpec(item: productSpecConfigurationListItem) {
      
    this.updateActiveProductInList()

    this.selectedOrderSpecToView = item
    this.initValuesForm()
  }
@@ -180,7 +169,6 @@ export class ProductOrderCheckoutComponent implements OnInit {
    if (orderArray.length) {
      orderArray.splice(orderArray.findIndex(el => el === specId), 1)
    }

    localStorage.setItem('orderedProductSpecsList', JSON.stringify(orderArray))
  }

@@ -188,71 +176,102 @@ export class ProductOrderCheckoutComponent implements OnInit {
    
    this.updateActiveProductInList();

    let newOrder: ProductOrderCreate = {
    const startDate = this.reqStartDate.value
      ? new Date(this.reqStartDate.value).toISOString()
      : new Date().toISOString();

    const completionDate = this.reqCompletionDate.value
      ? new Date(this.reqCompletionDate.value).toISOString()
      : new Date().toISOString();

    let newOrder: ProductOrderCreate | any = {
      "@type": "ProductOrder",
      category: "Product Order",
      description: "Product Order via Portal",
      requestedStartDate: startDate,
      requestedCompletionDate: completionDate,
      productOrderItem: [],
      requestedStartDate: this.reqStartDate.value,
      requestedCompletionDate: this.reqCompletionDate.value
      relatedParty: []
    };

    if (this.serviceNoteCtrl.value) {
      newOrder.note = [{
        author: this.authService.portalUserJWT.preferred_username,
        text: this.serviceNoteCtrl.value,
        date: new Date().toISOString()
      }];
    if (this.authService.portalUserJWT) {
      newOrder.relatedParty.push({
        "@type": "RelatedParty",
        role: 'REQUESTER',
        name: this.authService.portalUserJWT.preferred_username || 'Unknown',
      });
    }

    this.orderedSpecsConfigurationList.forEach((productItem, index) => {

      if (!productItem.offering || !productItem.offering.id) {
        this.toastr.error('Not a valid product offering', 'Configuration Error');
        return;
      }
      if (!productItem.offering?.id) return;

      const pChars = [];

      productItem.specCharacteristics.forEach((characteristic) => {
        let valToSubmit = null;

        if (['SET', 'ARRAY'].includes(characteristic.valueType?.toUpperCase())) {
           valToSubmit = {
             value: JSON.stringify(characteristic.value.map(el => ({ 'value': el.value.value, 'alias': el.value.alias })))
           };
        } else {
           valToSubmit = characteristic.value[0]?.value;
        //filter empty values
        const validItems = characteristic.value.filter(el => el.value && el.value.value && String(el.value.value).trim() !== '');

        validItems.forEach(item => {
          let charType = 'StringCharacteristic';
          let rawValue: any = item.value.value;

          if (characteristic.valueType === 'INTEGER') {
            charType = 'IntegerCharacteristic';
            rawValue = parseInt(rawValue);
          } else if (characteristic.valueType === 'FLOAT') {
            charType = 'FloatCharacteristic';
            rawValue = parseFloat(rawValue);
          } else if (characteristic.valueType === 'BOOLEAN') {
            charType = 'BooleanCharacteristic';
            rawValue = (String(rawValue).toLowerCase() === 'true');
          }

        if(valToSubmit) {
          pChars.push({
            name: characteristic.name,
            valueType: characteristic.valueType,
            value: valToSubmit
          });
            "@type": charType,
            value: {
              value: rawValue,
              alias: item.value.alias || ''
            }
          });
        });
      });

      const newOrderItem: ProductOrderItem = {
        id: (index + 1).toString(),
        action: 'ADD',
        product: {
        quantity: 1,
        "@type": "ProductOrderItem",
        productOffering: {
          id: productItem.offering.id,
          name: productItem.offering.name,
          '@type': 'ProductOfferingRef'
        },
          productCharacteristic: pChars
        product: {
          "@type": "Product",
          productCharacteristic: pChars,
          productSpecification: productItem.offering.productSpecification ? {
            id: productItem.offering.productSpecification.id,
            name: productItem.offering.name,
            version: productItem.offering.version,
            '@type': 'ProductSpecificationRef'
          } : undefined
        } as any
      };

      newOrder.productOrderItem.push(newOrderItem);
    });

    // console.log('Submitting Product Order:', newOrder);
    this.orderService.createProductOrder({ body: newOrder }).subscribe({
      next: (createdOrder: any) => {
        this.toastr.success("Product Order was successfully placed");

        this.toastr.success("Order Placed Successfully");
        this.orderedSpecsConfigurationList = [];
        this.productRequesterService.orderedProductSpecsList = [];
        localStorage.removeItem('orderedProductSpecsList');

        if (createdOrder?.id) {
          this.router.navigate(["products", 'product_order', createdOrder.id]);
        } else {
@@ -260,8 +279,8 @@ export class ProductOrderCheckoutComponent implements OnInit {
        }
      },
      error: (error) => {
        console.error(error);
        this.toastr.error("An error occurred while processing your Service Order");
        console.error("Submission Error:", error);
        this.toastr.error("Validation Failed (400).", "Order Failed");
      }
    });
  }
@@ -274,5 +293,4 @@ export class ProductOrderCheckoutComponent implements OnInit {
    this.subscription.unsubscribe()
  }

  
}
 No newline at end of file