const baseURL = import.meta.env.VITE_API_BASE_URL;
const baseIdentityURL = import.meta.env.VITE_IDENTITY_API_BASE_URL;
import user from "./apiPaths/userPath";
import role from "./apiPaths/rolePath";
import picture from "./apiPaths/picturePath";
import menu from "./apiPaths/menuPath";
import {
  category,
  location,
  agency,
  endPoints,
  route,
  agencyLocation,
} from "./apiPaths/categoryPath";
import { post, tag, product, topic, scriptConfig } from "./apiPaths/cmsPath";
import { job, candidate } from "./apiPaths/hrPath";
import {
  customer,
  customerAddress,
  lead,
  customerBankAccount,
  vatInfo,
} from "./apiPaths/crmPath";
import { callLog } from "./apiPaths/callLogPath";
import { deploy, operation, warehouse } from "./apiPaths/businessPath";
import { price, wallet, cashier, transaction } from "./apiPaths/finPath";
import { bank, bankAccount } from "./apiPaths/bankPath";
import { driverFinance } from "./apiPaths/driverUtilsPath";
import { reconciliation } from "./apiPaths/reconciliationPath";
import { transferPaymentBill } from "./apiPaths/transferPaymentBillPath";
import { expense, expenseCategory } from "./apiPaths/expensePath";
import { income, incomeCategory } from "./apiPaths/incomePath";
import { financeExcelExport } from "./apiPaths/financeExcelExportPath";
import { userBankAccount } from "./apiPaths/userBankAccountPath";
import { taxInvoice } from "./taxPath";
import { vatInvoice } from "./apiPaths/vatInvoicePath";
import { premise, premiseScoring } from "./apiPaths/premisePath";

const appConfig = {
  search: `${baseURL}/AppConfig/Search`,
  getById: `${baseURL}/AppConfig/GetById?id=`,
  createOrUpdate: `${baseURL}/AppConfig/CreateOrUpdate`,
  delete: `${baseURL}/AppConfig/Delete?id=`,
  reloadCache: `${baseURL}/AppConfig/ReloadCache`,
};
const permission = {
  search: baseURL + "/Permission/search",
  getPermissions: baseURL + "/Permission/GetPermissions",
  setPermission: baseURL + "/Permission/Assign",
  create: baseURL + "/Permission",
  createOrUpdate: baseURL + "/Permission/CreateOrUpdate",
  delete: baseURL + "/Permission/:id",
  availableRoles: baseURL + "/Permission/available-roles",
  getRoles: baseURL + "/Permission/:id/roles",
  updateRoles: baseURL + "/Permission/UpdateRoles",
};

let order = {
  tracking: `${baseURL}/Order/TrackingWithUnits?code=`,
  createOrder: `${baseURL}/Order/CreateOrder`,
  searchOrder: `${baseURL}/Order/Search`,
  updateAddress: `${baseURL}/Order/UpdateAddress`,
  cancel: `${baseURL}/Order/Cancel`,
  removeCancel: `${baseURL}/Order/RemoveCancel`,
  prepareOrderListFilter: `${baseURL}/Order/PrepareOrderListFilter`,
  paymentMethods: `${baseURL}/Order/PaymentMethods`,
  timeFilterTypes: `${baseURL}/Order/TimeFilterTypes`,
  exportExcel: `${baseURL}/Order/Export`,
  downloadExcel: `${baseURL}/Order/Download`,
};

let orderAddress = {
  getById: `${baseURL}/OrderAddress/GetById?id=`,
  update: `${baseURL}/OrderAddress/Update`,
};
let orderFin = {
  getById: `${baseURL}/OrderFin/GetById?id=`,
  update: `${baseURL}/OrderFin/Update`,
  collectMoney: `${baseURL}/OrderFin/CollectMoney`,
};
let orderPackage = {
  getByOrderId: `${baseURL}/OrderPackage/GetByOrderId?id=`,
  update: `${baseURL}/OrderPackage/Update`,
};

let truck = {
  //Truck Management
  truckSearch: `${baseURL}/Truck/TruckSearch`,
  truckGetByIds: `${baseURL}/Truck/GetTruckByIds`,
  truckGetByAgencyId: `${baseURL}/Truck/GetTruckByAgencyId`,
  truckCreateOrUpdate: `${baseURL}/Truck/CreateOrUpdate`,
  truckDelete: `${baseURL}/Truck/TruckDelete`,
  getById: `${baseURL}/Truck/GetById?id=`,
  // Truck Specification
  truckSpecGetAll: `${baseURL}/Truck/TruckSpecGetAll`,
  truckSpecCreateOrUpdate: `${baseURL}/Truck/TruckSpecCreateOrUpdate`,
  truckSpecDelete: `${baseURL}/Truck/TruckSpecDelete`,
  //Truck Specification Attribute
  truckSpecAttrSearch: `${baseURL}/Truck/TruckSpecAttrSearch`,
  truckSpecAttrGetAll: `${baseURL}/Truck/TruckSpecAttrGetAll`,
  truckSpecAttrCreateOrUpdate: `${baseURL}/Truck/TruckSpecAttrCreateOrUpdate`,
  truckSpecAttrDelete: `${baseURL}/Truck/TruckSpecAttrDelete`,
  //Truck Maintenance Attribute
  truckMaintAttrSearch: `${baseURL}/TruckMaintAttrSearch`,
  truckMaintAttrGetAll: `${baseURL}/Truck/TruckMaintAttrGetAll`,
  truckMaintAttrCreateOrUpdate: `${baseURL}/Truck/TruckMaintAttrCreateOrUpdate`,
  truckMaintAttrDelete: `${baseURL}/Truck/TruckMaintAttrDelete`,
  //Truck Maintenance Link
  truckMaintLinkGetAll: `${baseURL}/Truck/TruckMaintLinkGetAll`,
  //Truck Maintenance
  truckMaintCreateOrUpdate: `${baseURL}/Truck/TruckMaintCreateOrUpdate`,
  truckMaintDelete: `${baseURL}/Truck/TruckMaintDelete`,
  truckMaintSearch: `${baseURL}/Truck/TruckMaintSearch`,
  truckMaintByIds: `${baseURL}/TruckMaintByIds`,
  //Truck Activity
  truckCheckIn: `${baseURL}/Truck/TruckCheckIn`,
  truckCheckOut: `${baseURL}/Truck/TruckCheckOut`,
  //Truck Driver Utils
  getAvailableTrucks: `${baseURL}/Truck/GetAvailableTrucks`,
  getTrucksByAgency: `${baseURL}/Truck/GetTrucksByAgency`,
  checkInTruck: `${baseURL}/Truck/CheckInTruck`,
  getMyCurrentTruck: `${baseURL}/Truck/GetMyCurrentTruck`,
  checkOutTruck: `${baseURL}/Truck/CheckOutTruck`,
  //Truck Activity History
  getActivityHistory: `${baseURL}/Truck/GetActivityHistory`,
  //Update Last Refill ODO
  updateLastRefillOdo: `${baseURL}/Truck/UpdateLastRefillOdo`,
  //Get Last Refill ODO
  getLastRefillOdo: `${baseURL}/Truck/GetLastRefillOdo`,
};

let attendance = {
  punch: `${baseURL}/Attendance/Punch`,
};

let report = {
  orderProduction: `${baseURL}/Report/OrderProduction`,
  orderProductionWithRevenue: `${baseURL}/RevenueReport/OrderRevenueByDate`,
  saleRevenueStatistics: `${baseURL}/RevenueReport/SaleRevenueStatistics`,
  customerRevenueStatistics: `${baseURL}/RevenueReport/CustomerRevenue`,
  customerRevenuePermissions: `${baseURL}/RevenueReport/CustomerRevenue/Permissions`,
  bankTransferSummaryBySale: `${baseURL}/OrderFinReport/GetBankTransferSummaryBySale`,
  prepareBankTransferSummaryBySaleModel: `${baseURL}/OrderFinReport/PrepareBankTransferSummaryBySaleModel`,
  orderRevenueByCollectionDate: `${baseURL}/RevenueReport/OrderRevenueByCollectionDate`,
  orderRevenueBySale: `${baseURL}/RevenueReport/OrderRevenueBySale`,
  driverProductivityByDate: `${baseURL}/DriverReport/GetDriverProductivityReportByDate`,
  orderReportByRoute: `${baseURL}/Report/OrderReportByRoute`,
  fuelRefillReportByDriver: `${baseURL}/FuelRefillReport/GetByDriver`,
  exportFuelRefillReportByDriver: `${baseURL}/FuelRefillReport/ExportByDriver`,
};

let monitor = {
  orderRisk: {
    overview: `${baseURL}/Monitor/OrderRisk/Overview`,
    noSourceCashier: `${baseURL}/Monitor/OrderRisk/NoSourceCashier`,
    noDestCashier: `${baseURL}/Monitor/OrderRisk/NoDestCashier`,
    noDestCashierOverview: `${baseURL}/Monitor/OrderRisk/NoDestCashier/Overview`,
    bothPayMissingCashier: `${baseURL}/Monitor/OrderRisk/BothPayMissingCashier`,
    bothPayMissingCashierOverview: `${baseURL}/Monitor/OrderRisk/BothPayMissingCashier/Overview`,
  },
};

let fuelCard = {
  // Fuel Card Management
  search: `${baseURL}/FuelCard/Search`,
  getById: `${baseURL}/FuelCard/GetById`,
  createOrUpdate: `${baseURL}/FuelCard/CreateOrUpdate`,
  delete: `${baseURL}/FuelCard/Delete`,
  assignToTruck: `${baseURL}/FuelCard/AssignToTruck`,
  getActiveCards: `${baseURL}/FuelCard/GetActiveCards`,
  getTotalDebt: `${baseURL}/FuelCard/GetTotalDebt`,
  // Fuel Card Transaction Management
  importStatement: `${baseURL}/FuelCard/ImportStatement`,
  importTransactionHistory: `${baseURL}/FuelCard/ImportTransactionHistory`,
  searchTransactions: `${baseURL}/FuelCard/SearchTransactions`,
  getTransactionById: `${baseURL}/FuelCard/GetTransactionById`,
  reconcileTransaction: `${baseURL}/FuelCard/ReconcileTransaction`,
  markTransactionPaid: `${baseURL}/FuelCard/MarkTransactionPaid`,
  getUnreconciledTransactions: `${baseURL}/FuelCard/GetUnreconciledTransactions`,
  // Fuel Refill Management
  createOrUpdateRefill: `${baseURL}/FuelCard/CreateOrUpdateRefill`,
  searchRefills: `${baseURL}/FuelCard/SearchRefills`,
  getRefillById: `${baseURL}/FuelCard/GetRefillById`,
  getRefillsByTruck: `${baseURL}/FuelCard/GetRefillsByTruck`,
  getRefillsByDriver: `${baseURL}/FuelCard/GetRefillsByDriver`,
  deleteRefill: `${baseURL}/FuelCard/DeleteRefill`,
  exportRefillsExcel: `${baseURL}/FuelCard/ExportRefillsExcel`,
  // Driver Fuel Quota Management
  getDriverQuotaBalance: `${baseURL}/FuelCard/GetDriverQuotaBalance`,
  searchDriverQuotaHistory: `${baseURL}/FuelCard/SearchDriverQuotaHistory`,
  adjustDriverQuota: `${baseURL}/FuelCard/AdjustDriverQuota`,
  // Fuel Quota Payment Management
  createPayment: `${baseURL}/FuelCard/CreatePayment`,
  approvePayment: `${baseURL}/FuelCard/ApprovePayment`,
  searchPayments: `${baseURL}/FuelCard/SearchPayments`,
};


let apiPath = {
  user,
  customer,
  customerAddress,
  customerBankAccount,
  vatInfo,
  lead,
  callLog,
  role,
  menu,
  location,
  endPoints,
  route,
  agency,
  agencyLocation,
  price,
  wallet,
  order,
  orderAddress,
  orderFin,
  orderPackage,
  category,
  post,
  product,
  picture,
  tag,
  job,
  candidate,
  order,
  truck,
  deploy,
  operation,
  warehouse,
  cashier,
  transaction,
  topic,
  scriptConfig,
  attendance,
  permission,
  driverFinance,
  report,
  appConfig,
  reconciliation,
  transferPaymentBill,
  expense,
  expenseCategory,
  income,
  incomeCategory,
  bank,
  bankAccount,
  financeExcelExport,
  userBankAccount,
  taxInvoice,
  monitor,
  fuelCard,
  vatInvoice,
  premise,
  premiseScoring,
};


export default apiPath;
