import { tryCatch } from "../../../../globalUtils/tryCatch.js";
import { query } from "../../../sqlServer/prodSqlServer.js";
import { activeWarehouseLanes } from "../../../sqlServer/querys/warehouse/activeWarehouseLanes.js";

export const getActiveWarehouseLanes = async () => {
    const { data, error } = await tryCatch(
        query(activeWarehouseLanes, "Get active warehouse lanes")
    );

    if (error) {
        return {
            success: false,
            message: "Error getting active warehouse lanes",
            data: error,
        };
    }
    const lanes: any = data as any;

    return {
        success: true,
        message: "Current active warehouse lanes.",
        data: lanes.data,
    };
};
