namespace JobTrackerApi.Models; // The Career Workspace's durable source of truth. Bounded to one row per user for now // (see career-workspace-implementation-roadmap.md Phase F1) -- ProfileJson mirrors // ApplicationUser.ProfileCvStructureJson during the dual-write window and will become // authoritative once every read path is migrated (F5). public sealed class CareerProfile { public int Id { get; set; } public string OwnerUserId { get; set; } = string.Empty; // Phase 3: ProfileJson is now a DERIVED projection of the relational children + LongTailJson, // serialized into the StructuredCvProfile shape and kept in sync on every save so the legacy // read paths (CV rendering, tailoring, match-score) keep working unchanged. It is no longer an // independently editable source. See docs/architecture/career-profile-model.md ยง4. public string ProfileJson { get; set; } = string.Empty; // The editable long tail that is not worth a relational table: contact, summary, interests, // achievements, organisations, publications, courses, custom/other sections, and AI-extraction // metadata. A JSON object (CareerLongTail). The relational children (Experience/Education/Skill/ // Project/Certification/Language) hold the rest. public string LongTailJson { get; set; } = string.Empty; public int Version { get; set; } public DateTimeOffset CreatedAtUtc { get; set; } = DateTimeOffset.UtcNow; public DateTimeOffset UpdatedAtUtc { get; set; } = DateTimeOffset.UtcNow; public List Experiences { get; set; } = new(); public List Education { get; set; } = new(); public List Skills { get; set; } = new(); public List Projects { get; set; } = new(); public List Certifications { get; set; } = new(); public List Languages { get; set; } = new(); } // Append-only history: one row per save, so profile edits are never silently lost. public sealed class CareerProfileVersion { public int Id { get; set; } public string OwnerUserId { get; set; } = string.Empty; public int CareerProfileId { get; set; } public CareerProfile? CareerProfile { get; set; } public int Version { get; set; } public string ProfileJson { get; set; } = string.Empty; // Where this version came from: "upload" | "rebuild" | "improve" | "reprocess" | "parse" | "manual". public string Source { get; set; } = string.Empty; public DateTimeOffset CreatedAtUtc { get; set; } = DateTimeOffset.UtcNow; }