// File: src/data/project.js

/**
 * لود اطلاعات اصلی پروژه در state.project
 * @param {Object} state
 * @param {Object} projectData
 */
export function loadProjectCore(state, projectData) {
    if (!projectData.project) {
        return;
    }

    const p = projectData.project;

    state.project.id = p.id ?? null;
    state.project.code = p.code ?? '';
    state.project.name = p.name ?? '';
    state.project.description = p.description ?? '';
    state.project.startDate = p.start_date ?? null;
    state.project.endDate = p.end_date ?? null;
    state.project.status = p.status ?? 'planned';
    state.project.currency = p.currency ?? state.project.currency;
}
