const express = require('express');

// Import all route modules
const customerRoutes = require('./customerRoutes');
const authRoutes = require('./authRoutes');
const companyRoutes = require('./companyRoutes');
const itemRoutes = require('./itemRoutes');
const transactionRoutes = require('./transactionRoutes');
const transactionDetailRoutes = require('./transactionDetailRoutes');
const branchRoutes = require('./branchRoutes');
const branchInventoryRoutes = require('./branchInventoryRoutes');
const transactionsRoutes = require('./transactionsRoutes');
const transferRoutes = require('./transferRoutes');
const userRoutes = require('./userRoutes');
const registerRoutes = require('./registerRoutes');
const dailySalesRoutes = require('./dailySalesRoutes');
const collectionRoutes = require('./collectionRoutes');
const expenseRoutes = require('./expenseRoutes');
const financialSummaryRoutes = require('./financialSummaryRoutes');
const bankTransactionRoutes = require('./bankTransactionRoutes');
const bankAccountRoutes = require('./bankAccountRoutes');
const summaryRoutes = require('./getTotalSummaryRoutes');
const monthlyExpenseRoutes = require('./monthlyExpenseRoutes');
const settingRoutes = require('./settingRoutes');
const branchGroupRoutes = require('./branchGroupRoutes');
const expenseGroupRoutes = require('./expenseGroupRoutes');
const orderRoutes = require('./orderRoutes');
const roleRoutes=require('./roleRoutes')
const permissionRoutes=require('./permissionRoutes')
const vCardRoutes=require('./vCardRoutes')
const updateBranchInventoryRoutes=require('./updateBranchInventoryRoutes')
const paymentHistoryRoutes=require('./paymentHistoryRoutes')
const {checkPermission}=require('../middleware/checkPermission')
const cashOutRoutes = require('./cashOutRoutes');
const cafeOrderRoutes = require('./cafeOrderRoutes');
const gpsRoutes = require('./gpsRoutes');
const smsReaderRoutes = require('./smsReaderRoutes');

const tableRoutes = require('./tableRoutes');
const kitchenRoutes = require('./kitchenRoutes');
const categoryRoutes = require('./categoryRoutes');
const cafeOrderTransferRoutes = require('./cafeOrderTransferRoutes');
const cafePostRoutes = require('./cafePostRoutes');
const specialNeedRoutes = require('./specialNeedsRoutes');
const printedDataRoutes = require('./printedDataRoutes');
const deviceListRoutes = require('./deviceListRoutes');
const bluetoothPrinterRoutes = require('./bluetoothPrinterRoutes');
// Function to initialize all routes
module.exports = (app) => {
    app.use('/api/customers', customerRoutes);
   app.use('/api/auth', authRoutes);
    app.use('/api/companies', companyRoutes);
    app.use('/api/items', itemRoutes);
    app.use('/api/transaction', transactionRoutes);
    app.use('/api/transaction-details', transactionDetailRoutes);
    app.use('/api/branches', branchRoutes);
    app.use('/api/branchInventory', branchInventoryRoutes);
    app.use('/api/transactions', transactionsRoutes);
    app.use('/api/transfers', transferRoutes);
    app.use('/api/users', userRoutes);
    app.use('/api/register', registerRoutes);
    app.use('/api/sales', dailySalesRoutes);
    app.use('/api/collections', collectionRoutes);
    app.use('/api/expenses', expenseRoutes);
    app.use('/api/financial-summary', financialSummaryRoutes);
    app.use('/api/bank-transactions', bankTransactionRoutes);
    app.use('/api/bankAccounts', bankAccountRoutes);
    app.use('/api/get-total-summary', summaryRoutes);
    app.use('/api/all-total-summary', financialSummaryRoutes);
    app.use('/api/monthly-expenses', monthlyExpenseRoutes);
    app.use('/api/settings', settingRoutes);
    app.use('/api/branch-groups', branchGroupRoutes);
    app.use('/api/expense-groups', expenseGroupRoutes);
    app.use('/api/order', orderRoutes);
    app.use('/api/role', roleRoutes);//checkPermission("")
    app.use('/api/permission', permissionRoutes)
    app.use('/api/vcard', vCardRoutes)
    app.use('/api/branch-inventory',updateBranchInventoryRoutes)
    app.use('/api/payment-history',paymentHistoryRoutes)
    app.use('/api/cashouts', cashOutRoutes); 
    app.use('/api/cafeorder', cafeOrderRoutes);
    app.use('/api/gps', gpsRoutes);
    app.use('/api/sms', smsReaderRoutes);
   
    app.use('/api/table', tableRoutes);
    app.use('/api/kitchen', kitchenRoutes);
    app.use('/api/category', categoryRoutes);
    app.use('/api/cafeTransfer',cafeOrderTransferRoutes);
    app.use('/api/cafe-post',cafePostRoutes);
    app.use('/api/special-need', specialNeedRoutes);
    app.use('/api/printed-data', printedDataRoutes);
    app.use('/api/device-list', deviceListRoutes);
    app.use('/api/bluetooth', bluetoothPrinterRoutes);

};



