import { Pipe, PipeTransform } from '@angular/core';
import { AvailabilityByBranchDTO } from 'apps/domain/availability/src/lib/defs/availability-by-branch-dto.model';

@Pipe({
  name: 'stockInfo',
})
export class StockInfoPipe implements PipeTransform {
  transform(branchId: number, inStock: AvailabilityByBranchDTO[]): AvailabilityByBranchDTO {
    return inStock?.find((info) => info.branchId === branchId);
  }
}
