import { DataType, StringUtils } from "@sankhyalabs/core";
export const testMetadata = {
  name: 'metadataName',
  label: 'metadataLabel',
  fields: [{
      name: 'TESTFIELD',
      label: 'Test label',
      dataType: DataType.TEXT,
    }]
};
export const recordId1 = StringUtils.generateUUID();
export const recordId2 = StringUtils.generateUUID();
export const testRecords = [
  {
    __record__id__: recordId1,
    TESTFIELD: 'TESTVALUE'
  },
  {
    __record__id__: recordId2,
    TESTFIELD: 'TESTVALUE2'
  },
];
export const dataFetcherPDFResponse = {
  chavePDF: {
    valor: 'KEYPDF'
  },
  permiteImprimir: {
    valor: "S"
  },
  permiteExportar: {
    valor: "S"
  },
  canSendEmail: {
    valor: "S"
  },
};
export const dataFetcherXLSResponse = {
  chaveXLS: {
    valor: 'KEYXLS'
  },
};
export const exportPDFParams = {
  methodName: 'exportToPDF',
  fileName: '',
  gridTitle: '',
};
export const exportXLSParams = {
  methodName: 'exportToXLS',
  fileName: '',
  gridTitle: '',
};
export const serviceNamePDF = "GridPDFBuilderSP.buildPDFFromJson";
export const serviceNameXLS = "GridXLSBuilderSP.buildXLSFromJson";
export function buildExpectedResponse({ serviceName, gridTitle, value, align = 'left', type = 'S' }) {
  return {
    serviceName: serviceName,
    requestBody: {
      grid: {
        gridTitle: gridTitle,
        columns: {
          column: [
            {
              align: align,
              id: "TESTFIELD",
              index: 1,
              label: "Test label",
              presentationType: "P",
              type: type,
              width: undefined,
            }
          ]
        },
        customOptions: {
          xlsxExtension: false
        },
        rows: {
          row: [
            {
              c1: {
                $: value
              }
            }
          ]
        }
      }
    }
  };
}
