Skip to content

Example: .NET console application overview

The overview is the landing page for a .NET Framework console application built on SAIF.Framework.Windows. Doc gen produces one per application at docs/applications/<app-slug>/overview.md, summarising why the program exists, how it is invoked, what schedules it, and which component owns each capability.

What reviewers should check

  • ## Invocation shows a runnable command with the application's real named arguments; a positional command line is a defect because this framework binds arguments by property name, not by position.
  • ## Scheduling uses the template's four rows and cites a real scheduler definition, pipeline, or deployment script. An inferred schedule is a defect — "Not determined from source" is the correct value when nothing states one.
  • ## Command-line arguments lists every writable property on the argument container, including implicitly bound ones, with Type, Required, Default, and Purpose filled in, and keeps the sentence linking the full contract to arguments.md.
  • Required and Default columns agree with the resolver: arguments are required by default, so a No in Required must correspond to a real .NotRequired(...) call and a default value rather than an em dash.
  • ## Capability summary names an owning component that exists in the source — a class or a consumed library — rather than restating the capability, and links a consumed library only when a documentation set was generated for it.
  • ## Related documentation carries the complete sibling list minus this page, with conditional entries present only when that page was generated.
  • No placeholder text survives: TODO, TBD, See source, or angle-bracket placeholders are all defects.

Example

The document below is a complete, correct console-overview.md for a fictional .NET Framework console application.

View rendered example — the same document as a real page, so you can compare rendering as well as source.

---
title: Policy Renewal Notice overview
summary: Purpose, invocation, scheduling, and capabilities for the console application.
status: draft
owner: Policy Systems Team
last_reviewed: 2026-09-10
---

# Policy Renewal Notice overview

`SAIF.Policy.RenewalNotice` is a C# .NET Framework 4.8 console application that
generates workers' compensation policy renewal notices and queues them for print
and email delivery. It is built on `SAIF.Framework.Windows`: `Main` hands control
to `Program.Run()`, which resolves the named arguments into an `Arguments`
container, registers the application's dependencies in an Autofac container, and
then drives `Initialize`, `Execute`, and `Finish` on `RenewalNoticeApplication`.
Policy terms are read and notices written through an NHibernate `IUnitOfWork`
against the Oracle `POLICY` schema, and the servicing agent printed on each
notice is resolved from `SAIF.Agency.Api` through the `SAIF.Agency.Api.Client`
package.

## Purpose
- Select policy terms whose renewal effective date falls inside the notice
  window for the requested notice date and generate one renewal notice per term.
- Resolve the servicing agency and agent for each term so the notice carries the
  producer contact the insured is expected to call.
- Queue each generated notice for print and email delivery, and record the
  queued notice in `POLICY.RENEWAL_NOTICE` so a term is never noticed twice for
  the same renewal.

## Invocation

```
SAIF.Policy.RenewalNotice.exe -NoticeDate 2026-09-18 -NoticeType Standard -BatchSize 500
```

The nightly run is started by Windows Task Scheduler on BATCHPRD02, which passes
the current date and `Standard`. Operators invoke the same executable by hand for
the `NonRenewal` and `Conditional` runs and when reprocessing a night that
failed; the `--WhatIf` flag exists for those manual runs so a notice batch can be
generated and inspected without queuing anything for delivery.

## Scheduling

| Attribute | Value |
| --- | --- |
| Frequency | Daily |
| Scheduler | Windows Task Scheduler on BATCHPRD02, task `SAIF-RenewalNotice-Nightly`, 02:30 |
| Expected runtime | 15-30 minutes for a typical nightly volume of 300-700 notices |
| Upstream dependencies | Policy term replication into the `POLICY` schema (completes by 02:00) and `SAIF.Agency.Api` availability for agent resolution |

## Command-line arguments

Arguments are **named**, not positional. The full contract, including syntax forms and validation behavior, is on the [Arguments](arguments.md) page.

| Argument | Type | Required | Default | Purpose |
| --- | --- | --- | --- | --- |
| `NoticeDate` | `DateTime` | Yes | — | Anchors the notice window; policy terms with a renewal effective date inside the window for this date are eligible. |
| `NoticeType` | `string` | Yes | — | `Standard`, `NonRenewal`, or `Conditional`. Selects the notice template and the statutory lead time applied to the window. |
| `BatchSize` | `int` | No | 500 | Maximum number of notices generated in one run. Used to split a backlog across several runs. |
| `WhatIf` | `bool` (flag) | No | false | Generates and logs notices without queuing them for delivery or writing `POLICY.RENEWAL_NOTICE` rows. |

## Capability summary

| Capability | Owning component | Description |
| --- | --- | --- |
| Argument resolution and lifecycle | `SAIF.Framework.Windows` | Supplies `Program.Run()`, the `StandardArgumentContainerBase<Arguments>` resolver, the `Initialize`/`Execute`/`Finish` sequence, and the `SaifConsoleException` exit-code mapping. |
| Eligible term selection | `RenewalNoticeApplication` (`src/SAIF.Policy.RenewalNotice/RenewalNoticeApplication.cs`) | Queries `POLICY.POLICY_TERM` through the `policyDb` `IUnitOfWork` for terms whose renewal effective date falls inside the window and that have no notice of this type already recorded. |
| Servicing agent resolution | `SAIF.Agency.Api.Client` | Calls `GetAgency` and `GetAgentsForAgency` on `SAIF.Agency.Api` to resolve the agency name, address, and appointed servicing agent for each term. |
| Notice generation | `NoticeGenerator` (`src/SAIF.Policy.RenewalNotice/NoticeGenerator.cs`) | Merges term, premium, and agent data into the `POLICY.NOTICE_TEMPLATE` body for the requested notice type and produces the print-ready document. |
| Delivery queuing | `NoticeQueueWriter` (`src/SAIF.Policy.RenewalNotice/NoticeQueueWriter.cs`) | Writes the print file to the print vendor drop path and inserts the `POLICY.RENEWAL_NOTICE_QUEUE` row that the email delivery service polls. |
| Run reporting | `RenewalNoticeApplication.Finish` (`src/SAIF.Policy.RenewalNotice/RenewalNoticeApplication.cs`) | Writes per-notice detail and run totals to the `file0`-`file2` logs and sends the operations summary mail. |

## Related documentation
- [Application index](index.md)
- [Architecture](architecture.md)
- [Run lifecycle](run-lifecycle.md)
- [Arguments](arguments.md)
- [Dependencies](dependencies.md)
- [Configuration](configuration.md)
- [Operations and processes](operations-processes.md)
- [Business rules](business-rules.md)
- [Data model](data-model.md)
- [Operational runbook](operational-runbook.md)
- [Tech debt](tech-debt.md)

## Sources
- `src/SAIF.Policy.RenewalNotice/Program.cs`
- `src/SAIF.Policy.RenewalNotice/Arguments.cs`
- `src/SAIF.Policy.RenewalNotice/RenewalNoticeApplication.cs`
- `src/SAIF.Policy.RenewalNotice/NoticeGenerator.cs`
- `src/SAIF.Policy.RenewalNotice/App.config`
- `src/SAIF.Policy.RenewalNotice/SAIF.Policy.RenewalNotice.csproj`
- `deploy/scheduled-tasks/SAIF-RenewalNotice-Nightly.xml`