import { Pipe, PipeTransform } from '@angular/core'; import { AdaptedExternalCommRecord, Communication } from '@features/communications/communications.typing'; import { EmailService } from '@features/system-emails/email.service'; /** * * @param commRecord Pass in the communication record from GC API * @returns An adapted comm record with the latest and previous comms parsed */ @Pipe({name: 'gcEmailMessagesFromString'}) export class EmailMessageFromStringPipe implements PipeTransform { constructor ( private emailService: EmailService ) { } transform (commRecord: Communication): AdaptedExternalCommRecord { return this.emailService.getAdaptedCommRecord(commRecord); } }