LyraLearn AI Learning Platform
Exams
← Module 10 Β· Designing the Transcript Review Service
🎧 Listen

Domain Model and Database

The transcript service is a classic document workflow domain, and it maps cleanly onto EF entities and SQL Server tables. Get the model right and the controllers stay boring β€” which is exactly what you want.

The core entities

The relationships are unremarkable one-to-many chains, which is good news: EF handles them without cleverness, and the Kendo work queues in Lesson 3 are simple grid queries.

Status workflows as state machines

Every submission moves through explicit states: Submitted β†’ Extracting β†’ ReadyForReview β†’ InReview β†’ Determined β†’ ReportIssued, with side exits like NeedsDocuments and Withdrawn. Model this as a state machine, not a pile of booleans:

public enum SubmissionStatus { Submitted, Extracting, ReadyForReview,
    InReview, NeedsDocuments, Determined, ReportIssued, Withdrawn }

Then enforce legal transitions in one service method (TransitionTo(submission, next, userId)) that validates the move, stamps the timestamp, and writes a history row. The alternative β€” IsReviewed, IsComplete, HasReport flags scattered across tables β€” always ends with rows in impossible combinations that no one can explain to an auditor.

SQL Server schema thinking

A few pragmatic rules for this domain: use datetime2 with UTC everywhere (determinations get disputed; timestamps get scrutinized); put a rowversion column on anything analysts edit concurrently, and wire it into EF's ConcurrencyCheck; index the columns your queues filter on (Status, AssignedAnalystId, SubmittedUtc); and make history tables append-only β€” grant the app INSERT but not UPDATE/DELETE on them. The database itself becomes part of your audit story.

🧠 Quiz yourself on this lesson →

Ask the AI Tutor

Grounded in the course lessons β€” it cites its sources and says when it doesn't know.