namespace :clear do
  desc "Clear Data"
  task :data => :environment do
    BookingOrder.delete_all
    Booking.delete_all
    OrderItem.delete_all
    AssignedOrderItem.delete_all
    Order.delete_all
    SaleOrder.delete_all
    SaleItem.delete_all
    Sale.delete_all
    SaleTax.delete_all
    SaleAudit.delete_all
    SalePayment.delete_all
    ShiftSale.delete_all
    PaymentJournal.delete_all
    Survey.delete_all
    ProductCommission.delete_all
    InDuty.delete_all
    DiningFacility.update_all(status:'available')
    CashierTerminal.update_all(is_currently_login: 0)
    SeedGenerator.where("model !='Customer' AND model != 'Commission'").update(:current => 0, :next => 1)
    # Receipt.delete_all
    # ReceiptDetail.delete_all
    OrderReservation.delete_all
    OrderReservationItem.delete_all
    Delivery.delete_all
  end

  desc "Clear-- Menu"
  task :menu => :environment do
   
    
    MenuItemOption.destroy_all
    MenuItemAttribute.destroy_all
   
    MenuItemSet.destroy_all
    
    MenuInstanceItemSet.destroy_all
    ItemSet.destroy_all
    
    MenuItemInstance.destroy_all
    MenuItem.destroy_all
   
    MenuCategory.destroy_all
    Menu.destroy_all

    Account.destroy_all
  end

  desc "Clear-- Inventory"
  task :stock => :environment do
   
    
    InventoryDefinition.destroy_all
    StockJournal.destroy_all
   
    StockCheck.destroy_all
    
    StockCheckItem.destroy_all
  end
end
