import { Pipe, PipeTransform } from '@angular/core';
import { OrderListItemDTO } from '@swagger/oms';

@Pipe({ name: 'orderTarget' })
export class OrderTargetPipe implements PipeTransform {
  transform(orderListItem: OrderListItemDTO): any {
    if (orderListItem.orderType === 2) {
      return 'Versand';
    }

    if (orderListItem.targetBranchName) {
      return orderListItem.targetBranchName;
    }

    return '';
  }
}
