import { Pipe, PipeTransform } from '@angular/core';
import { DBHOrderItemListItemDTO } from '@generated/swagger/oms-api';

@Pipe({
  name: 'showCoverCompartmentCode',
  standalone: true,
})
export class PickupShelfShowCoverCompartmentCodePipe implements PipeTransform {
  validProcessingStatus = [
    128, // Eingetroffen
    256, // Abgeholt
    512, // Storniert Kunde
    262144, // Ans Lager
    1048576, // Weitergeleitet intern
  ];

  transform(item: DBHOrderItemListItemDTO): boolean {
    return !!item.compartmentCode && this.validProcessingStatus.some((status) => status === item.processingStatus);
  }
}
