import { Pipe, PipeTransform } from '@angular/core';
import { HistoryDTO } from '@cmf/trade-api';

@Pipe({
  name: 'filterHistoriesWithStatusChange',
})
export class FilterHistoriesWithStatusChangePipe implements PipeTransform {
  transform(histories: HistoryDTO[]): HistoryDTO[] {
    return histories.filter((history) => history.values && history.values.some((value) => value.caption === 'Status'));
  }
}
