import { Pipe, PipeTransform } from '@angular/core';
import { AvailabilityByBranchDTO } from '@domain/availability';

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