// File: src/resources/human.js

/**
 * لود منابع انسانی (type = 'human')
 * @param {Object} state
 * @param {Object} projectData
 */
export function loadHumanResources(state, projectData) {
    if (!Array.isArray(projectData.resources)) return;

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

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

        // فیلدهای خاص human
        base.role = res.role ?? null;
        base.skillLevel = res.skill_level ?? null;
        base.costPerHour = res.cost_per_hour ?? null;
        base.calendarId = res.calendar_id ?? null;
        base.capacity = res.capacity ?? 1;    // FTE or similar
    });
}
