using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TMSDAL.DTO.EvaluationInsight
{
///
/// Maps to DBO.TEVALUATIONINSIGHT
/// HR / L&D synthesis record summarising findings from a cohort of evaluation responses.
/// Created manually by HR after reviewing collected responses for an evaluation plan.
/// Drives downstream actions: programme revisions, skill gap analysis, follow-up training.
/// Editable — can be revised as more data becomes available.
///
public class EvaluationInsightDTO
{
// =====================================================
// PRIMARY KEY
// =====================================================
///
/// Unique identifier for this evaluation insight record.
/// Auto-generated via AutoNumber — do not set manually on insert.
/// InsightId = 0 → BLL will INSERT. InsightId > 0 → BLL will UPDATE.
///
public int EvaluationInsightId { get; set; }
// =====================================================
// BUSINESS COLUMNS — FOREIGN KEYS
// =====================================================
///
/// FK → MEVALUATIONPLAN.EVALUATIONPLANID
/// The evaluation plan this insight summarises.
///
public int EvaluationPlanId { get; set; }
///
/// Joined from MEVALUATIONPLAN — display reference only.
///
public string? PlanTitle { get; set; }
///
/// FK → TTRAININGINSTANCE.INSTANCEID
/// -1 = Not linked to a specific training run (multi-programme or period evaluation).
/// Set to the specific training instance when insight is for a single programme cohort.
///
public int InstanceId { get; set; } = -1;
// =====================================================
// BUSINESS COLUMNS — COHORT METRICS
// =====================================================
///
/// Total number of employees in the evaluation cohort.
/// Denominator for ResponseRate calculation.
///
public int CohortSize { get; set; } = 0;
///
/// Number of employees who actually submitted a response.
/// Numerator for ResponseRate calculation.
///
public int ResponseCount { get; set; } = 0;
///
/// Percentage of cohort who responded.
/// Numeric(9,4) — e.g. 87.5000 = 87.5%.
/// Computed as (ResponseCount / CohortSize) * 100.
///
public decimal ResponseRate { get; set; } = 0;
///
/// Average rating across all submitted responses.
/// Numeric(3,1) — e.g. 4.2 out of 5.0.
/// Computed from TEVALUATIONRESPONSE.OVERALLRATING values.
///
public decimal AvgRating { get; set; } = 0;
// =====================================================
// BUSINESS COLUMNS — QUALITATIVE ANALYSIS
// =====================================================
///
/// Key themes identified from the evaluation responses.
/// Free text or structured summary written by HR/L&D analyst.
/// e.g. "Strong positive feedback on trainer delivery; concerns about pacing."
///
public string? KeyThemes { get; set; }
///
/// HR/L&D narrative summarising the overall evaluation findings.
/// Supports multi-paragraph free text.
///
public string? SummaryNotes { get; set; }
///
/// Specific actions recommended based on evaluation outcomes.
/// e.g. "Revise Module 3 content; increase practical exercises."
///
public string? RecommendedActions { get; set; }
///
/// Observable skill improvements noted post-training (L3 Behaviour level).
/// Populated for Kirkpatrick Level 3 evaluation plans.
///
public string? SkillImpactObserved { get; set; }
///
/// Competency framework impact observed from the training cohort.
/// Populated for Kirkpatrick Level 3–4 evaluation plans.
///
public string? CompetencyImpact { get; set; }
// =====================================================
// BUSINESS COLUMNS — GENERATION AUDIT
// =====================================================
///
/// FK → MEMPLOYEE.EMPLOYEEID
/// The HR/L&D staff member who created this insight record.
/// Set by BLL to loginDTO.UserId on insert — do not set manually.
///
public int GeneratedById { get; set; }
///
/// Joined from MEMPLOYEE — display reference only.
///
public string? GeneratedByName { get; set; }
///
/// Timestamp when this insight was first generated.
/// Set by BLL to DateTime.UtcNow on insert — do not set manually.
///
public DateTime GeneratedOn { get; set; }
// =====================================================
// STANDARD FIELDS
// =====================================================
/// Optimistic concurrency version counter.
public short Version { get; set; }
///
/// Record status.
/// 0 = Inactive, 1 = Active, 2–5 = Custom workflow states.
///
public byte Status { get; set; } = 1;
/// Display sort order. Default 9999 = append to end.
public short SortOrder { get; set; } = 9999;
///
/// Source of record creation.
/// 1–4 = Import sources, 5 = Manual entry (default).
///
public byte SourceType { get; set; } = 5;
/// FK → MCLIENT.CLIENTID. Set by BLL from LoginDTO.
public int TenantId { get; set; }
/// FK → MUSER.USERID. Set by BLL from LoginDTO.
public int CreatedById { get; set; }
/// Set by BLL to DateTime.UtcNow on insert.
public DateTime CreatedOn { get; set; }
/// FK → MUSER.USERID. Updated by BLL on every save.
public int ModifiedById { get; set; }
/// Set by BLL to DateTime.UtcNow on every save.
public DateTime ModifiedOn { get; set; }
}
}