import { BaseEntity } from '../entities';
import { IBaseTransformerRepository } from '../repositories';

export abstract class BaseTransformer<E extends BaseEntity = BaseEntity> implements IBaseTransformerRepository<E> {
  transformerGetList(payload: any): E[] {
    return payload;
  }
  transformerGetOne(payload: any): E {
    return payload;
  }
  transformerCreate(payload: any): E {
    return { ...payload, id: undefined };
  }
  transformerEdit(payload: any): E {
    return { ...payload, id: undefined };
  }
  transformerDuplicate(payload: any): E {
    return { ...payload, id: undefined };
  }
  transformerFilterIndexTable(payload: any): any {
    return payload;
  }
  transformerDefaultFilterIndexTable(payload: any): any {
    return payload;
  }
}
