// File: src/resources/equipment.js

/**
 * لود منابع تجهیزاتی (type = 'equipment')
 * @param {Object} state
 * @param {Object} projectData
 */
export function loadEquipmentResources(state, projectData) {
    if (!Array.isArray(projectData.resources)) return;

    projectData.resources.forEach(res => {
        if (res.type !== 'equipment') return;
        const id = res.id;
        if (!id) return;

        const base = state.resources.byId[id];
        if (!base) return;

        // فیلدهای خاص equipment
        base.unit = res.unit ?? null;
        base.costPerUnit = res.cost_per_unit ?? null;
        base.calendarId = res.calendar_id ?? null;
        base.capacityPerDay = res.capacity_per_day ?? null;
    });
}
