Files
atomic-design-poc/backend/src/BigRegister.Api/Domain/Applications/AanvraagStatus.cs
T
ehoandClaude Sonnet 5 8560746d15 refactor: strip WP-/RB- ticket refs from backend (RD-19)
The backend half of the sweep RD-18 did for the front end. git blame
holds the provenance and stays correct when the code moves; the
comment names a closed ticket and tells the reader nothing the
sentence around it does not.

public/letter.css and LetterHtml.golden.html change together, because
the renderer inlines the CSS and the golden file snapshots the
result.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-04 21:48:08 +02:00

63 lines
2.9 KiB
C#

namespace BigRegister.Domain.Applications;
/// <summary>
/// The post-submission aanvraag status lifecycle (ADR-0002): Ingediend → In
/// behandeling → (Meer info gevraagd ⇄) → Goedgekeurd/Afgewezen. Concept (pre-submission,
/// the wizard draft) is deliberately NOT a member here — see <see cref="AanvraagStatus.Tag"/>,
/// which is null exactly when the aanvraag hasn't been submitted yet, instead of a sixth
/// "magic string" tag with no enum member to match it.
/// <see cref="Ingediend"/> is reserved: no endpoint sets it yet (there is no state between
/// "just submitted" and "in behandeling" in this POC) — kept because the FE's status union
/// and $localize catalogue already declare it, and removing it would ripple into both.
/// </summary>
public enum AanvraagStatusTag { Ingediend, InBehandeling, MeerInfoGevraagd, Goedgekeurd, Afgewezen }
/// <summary>
/// A behandelaar's recorded decision — the three actions the beoordeling screen
/// offers, each advancing an aanvraag's <see cref="AanvraagStatus"/>.
/// </summary>
public enum Besluit { Goedkeuren, Afwijzen, MeerInfoOpvragen }
/// <summary>
/// The domain projection of an aanvraag's status at a point in time — the type
/// <c>Aanvraag.StatusAt(now)</c> returns, replacing the logic that used to live directly in
/// <c>Contracts.Mappers.ToStatusDto</c>. Constructible only via the factories below, so a
/// caller can never build e.g. a Referentie-less Goedgekeurd. <see cref="Tag"/> is null only
/// for <see cref="Concept"/> — the one construction path that used to be a bare "Concept"
/// string with no corresponding <see cref="AanvraagStatusTag"/> member.
/// </summary>
public sealed class AanvraagStatus
{
public AanvraagStatusTag? Tag { get; }
public int? StepIndex { get; }
public int? StepCount { get; }
public string? Referentie { get; }
public bool? Manual { get; }
public string? Reden { get; }
private AanvraagStatus(AanvraagStatusTag? tag, int? stepIndex, int? stepCount, string? referentie, bool? manual, string? reden)
{
Tag = tag;
StepIndex = stepIndex;
StepCount = stepCount;
Referentie = referentie;
Manual = manual;
Reden = reden;
}
public static AanvraagStatus Concept(int stepIndex, int stepCount) =>
new(null, stepIndex, stepCount, null, null, null);
public static AanvraagStatus InBehandeling(string referentie, bool manual) =>
new(AanvraagStatusTag.InBehandeling, null, null, referentie, manual, null);
public static AanvraagStatus Goedgekeurd(string referentie) =>
new(AanvraagStatusTag.Goedgekeurd, null, null, referentie, null, null);
public static AanvraagStatus Afgewezen(string referentie, string? reden) =>
new(AanvraagStatusTag.Afgewezen, null, null, referentie, null, reden);
public static AanvraagStatus MeerInfoGevraagd(string referentie, string? reden) =>
new(AanvraagStatusTag.MeerInfoGevraagd, null, null, referentie, null, reden);
}