using SolutionErp.Domain.Common;

namespace SolutionErp.Domain.Hrm;

// Satellite POLYMORPHIC — gộp 3 NamGroup table:
//   CT_KYNANGVITINH (Kind=Computer)
//   CT_NGOAINGU (Kind=Language)
//   CT_KYNANGKHAC (Kind=Other)
// Decision em main: 1 entity polymorphic discriminator Kind enum để tránh
// 3 satellite riêng cho cùng pattern "skill".
//
// Field semantic mapping per Kind:
//   Computer:  Name=TenPhanMem (vd "AutoCAD"), Level=TrinhDo (vd "Thành thạo")
//   Language:  Name=TenNgoaiNgu (vd "Tiếng Anh"), LanguageId=ISO code "en"|"fr"|"zh"|"jp"|"vi",
//              Level=BangCapChungChi (vd "IELTS 7.0", "TOEIC 800")
//   Other:     Name=TenKyNangKhac (vd "Lãnh đạo nhóm"), Level=free text
//
// FK Cascade từ EmployeeProfile.
public class EmployeeSkill : AuditableEntity
{
    public Guid EmployeeProfileId { get; set; }

    public SkillKind Kind { get; set; }

    public string Name { get; set; } = string.Empty;   // Required (semantic theo Kind)
    public string? LanguageId { get; set; }            // ISO code chỉ set khi Kind=Language ("en"/"fr"/...)
    public string? Level { get; set; }                 // TrinhDo / BangCapChungChi / free text

    public EmployeeProfile? EmployeeProfile { get; set; }
}
