import { Presenter } from "@erp/core/api";
import { GetVerifactuRecordByIdResponseDTO } from "@erp/verifactu-records/common";
import { VerifactuRecord } from "../../../domain";

export class VerifactuRecordFullPresenter extends Presenter<
  VerifactuRecord,
  GetVerifactuRecordByIdResponseDTO
> {
  toOutput(record: VerifactuRecord): GetVerifactuRecordByIdResponseDTO {
    return {
      id: record.id.toString(),
      invoice_id: record.invoiceId.toString(),

      estado: record.estado.toPrimitive(),
      url: record.url.toPrimitive(),
      //      qr1: toEmptyString(record.qr1, (value) => value.toString()),

      metadata: {
        entity: "verifactu-records",
        link: "",
      },
    };
  }
}
