---
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
- Architecture
- [Run lifecycle](run-lifecycle.md)
- [Arguments](arguments.md)
- [Dependencies](dependencies.md)
- [Configuration](configuration.md)
- Operations and processes
- Business rules
- Data model
- [Operational runbook](operational-runbook.md)
- Tech debt

## 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`
