// /* eslint-disable consistent-return */
// /* eslint-disable no-useless-return */
// import useAdvancedSearch from '@pjap/shared/hooks/useAdvancedSearch';
// import {
//   transformComparisonOperatorToPatternMatchingOperator,
//   transformOperatorToPatternMatchingOrContainsOperatorByModelOperator,
//   transformValueToQueryValueBasedOnModelOperator,
// } from '@pjap/shared/data-grid-premium/util';
// import {
//   FG_PDF_STATUS,
//   FG_SIGN_STATUS,
//   FG_STATUS,
// } from '@pjap/pph21/app/bukti-potong/shared/constants/BupotConstant';
// import { addLeadingZero } from '@pjap/shared/utils/number';
// import { transformDateToCommonFormat } from '@pjap/pph21/utils/formatDate';

// const useBpuAdvancedSearch = () => {
//   const fieldConfigs = {
//     fgStatus: {
//       fieldMapping: 'fgStatus',
//       operator: transformComparisonOperatorToPatternMatchingOperator,
//       transformValue: (value) => {
//         switch (value) {
//           case FG_STATUS.SUBMITTED:
//             return "'%SUBMITTED%'".toLowerCase();
//           case FG_STATUS.NORMAL:
//             return "'%NORMAL%'".toLowerCase();
//           case FG_STATUS.NORMAL_PENGGANTI:
//             return "'%AMENDMENT%'".toLowerCase();
//           case FG_STATUS.BATAL:
//             return "'%CANCELLED%'".toLowerCase();
//           case FG_STATUS.DRAFT:
//             return "'%DRAFT%'".toLowerCase();
//           case FG_STATUS.DIGANTI:
//             return "'%AMENDED%'".toLowerCase();
//           case FG_STATUS.PENDING:
//             return "'%PENDING%'".toLowerCase();
//           case FG_STATUS.ON_SCHEDULE:
//             return "'%ON SCHEDULE%'".toLowerCase();
//           default:
//             return `'%${value}%'`.toLowerCase();
//         }
//       },
//     },
//     fgSignStatus: {
//       fieldMapping: 'fgStatus',
//       operator: (currentOperator, _, value) => {
//         if (value === FG_SIGN_STATUS.ERROR) return 'IN';
//         if (currentOperator === '!=') return 'NOT LIKE';
//         return 'LIKE';
//       },
//       transformValue: (value) => {
//         switch (value) {
//           case FG_SIGN_STATUS.IN_PROGRESS:
//             return "'%SIGNING_IN_PROGRESS%'".toLowerCase();
//           case FG_SIGN_STATUS.FAILED:
//             return "'%DJP-SIGN-MASTER%'".toLowerCase();
//           case FG_SIGN_STATUS.SIGNED:
//             return "'%document signed successfully%'".toLowerCase();
//           case FG_SIGN_STATUS.NOT_MATCH_IDBUPOT:
//             return "'%NOT_MATCH_IDBUPOT%'".toLowerCase();
//           case FG_SIGN_STATUS.NOT_MATCH_STATUS:
//             return "'%NOT_MATCH_STATUS%'".toLowerCase();
//           case FG_SIGN_STATUS.NOT_MATCH_NILAI:
//             return "'%NOT_MATCH_NILAI%'".toLowerCase();
//           case FG_SIGN_STATUS.DUPLICATE:
//             return "'%DUPLICATE%'".toLowerCase();
//           case FG_SIGN_STATUS.ERROR:
//             return "('draft','normal-done','amendment-done','amended-document signed successfully','cancelled-done','submitted-signing_in_progress')";
//           default:
//             return `'%${value}%'`.toLowerCase();
//         }
//       },
//       additionalQuery: (originalValue) => {
//         switch (originalValue) {
//           case FG_SIGN_STATUS.ERROR:
//             return `"errorMsg" IS NOT NULL AND "errorMsg" != ''`;
//           default:
//             return ``;
//         }
//       },
//     },
//     fgPdf: {
//       fieldMapping: 'link',
//       operator: transformComparisonOperatorToPatternMatchingOperator,
//       transformValue: (value) => {
//         switch (value) {
//           case FG_PDF_STATUS.TERBENTUK:
//             return "'%https://coretaxdjp.pajak.go.id%'";
//           case FG_PDF_STATUS.BELUM_TERBENTUK:
//             return `'%intranet.pajak.go.id%' OR ((link = '' OR link IS NULL) AND "fgStatus" IN ('NORMAL-document signed successfully', 'NORMAL-Done', 'AMENDED-document signed successfully', 'CANCELLED-document signed successfully', 'AMENDMENT-document signed successfully'))`;
//           default:
//             return "'' OR link IS NULL";
//         }
//       },
//     },
//     fgKirimEmail: {
//       fieldMapping: 'fgkirimemail',
//     },
//     msPajak: {
//       fieldMapping: 'masaPajak',
//       transformValue: (value) => `'${addLeadingZero(value)}'`,
//     },
//     masaPajak: {
//       fieldMapping: 'masaPajak',
//       transformValue: (value) => `'${addLeadingZero(value)}'`,
//     },
//     thnPajak: {
//       fieldMapping: 'tahunPajak',
//     },
//     tahunPajak: {
//       fieldMapping: 'tahunPajak',
//     },
//     dpp: {
//       fieldMapping: 'dpp',
//     },
//     noBupot: {
//       fieldMapping: 'nomorBupot',
//       transformValue: transformValueToQueryValueBasedOnModelOperator,
//       operator: transformOperatorToPatternMatchingOrContainsOperatorByModelOperator,
//     },
//     npwp: {
//       operator: transformOperatorToPatternMatchingOrContainsOperatorByModelOperator,
//       transformValue: transformValueToQueryValueBasedOnModelOperator,
//     },
//     idTku: {
//       operator: transformOperatorToPatternMatchingOrContainsOperatorByModelOperator,
//       transformValue: transformValueToQueryValueBasedOnModelOperator,
//     },
//     errorMsg: {
//       operator: transformComparisonOperatorToPatternMatchingOperator,
//       transformValue: (value) => `'%${value}%'`.toLowerCase(),
//     },
//     jmlBruto: {
//       fieldMapping: 'penghasilanBruto',
//     },
//     kdObjPjk: {
//       fieldMapping: 'kodeObjekPajak',
//       operator: transformOperatorToPatternMatchingOrContainsOperatorByModelOperator,
//       transformValue: transformValueToQueryValueBasedOnModelOperator,
//     },
//     npwpPemotong: {
//       fieldMapping: 'npwpPemotong',
//     },
//     namaPemotong: {
//       fieldMapping: 'namaPemotong',
//     },
//     namaDipotong: {
//       fieldMapping: 'nama',
//     },
//     pasalPPh: {
//       fieldMapping: 'pasalPPh',
//       operator: transformOperatorToPatternMatchingOrContainsOperatorByModelOperator,
//       transformValue: transformValueToQueryValueBasedOnModelOperator,
//     },
//     tanggalApproval: {
//       transformValue: transformDateToCommonFormat,
//     },
//     internal_id: {
//       fieldMapping: 'internal_id',
//       operator: transformOperatorToPatternMatchingOrContainsOperatorByModelOperator,
//       transformValue: transformValueToQueryValueBasedOnModelOperator,
//     },
//     created: {
//       fieldMapping: 'created_by',
//       operator: transformOperatorToPatternMatchingOrContainsOperatorByModelOperator,
//       transformValue: transformValueToQueryValueBasedOnModelOperator,
//     },
//     updated: {
//       fieldMapping: 'updated_by',
//       operator: transformOperatorToPatternMatchingOrContainsOperatorByModelOperator,
//       transformValue: transformValueToQueryValueBasedOnModelOperator,
//     },
//   };

//   const defaultFieldTypes = {
//     created_at: 'date',
//     updated_at: 'date',
//   };

//   return useAdvancedSearch({
//     fieldConfigs,
//     defaultFieldTypes,
//   });
// };

// export default useBpuAdvancedSearch;
