---
title: Work-calendar date queries
summary: Answer first/last/next work-day and working-day questions for a given calendar.
status: draft
owner: SAIF.Core Documentation Team
last_reviewed: 2026-09-24
library: SAIF.Services.Web.Proxies
reference_type: package
operation_id: OP-WP-06
trigger: A caller request; no in-repository caller constructs WorkCalendarServiceProxy
---

# Work-calendar date queries

`WorkCalendarServiceProxy` wraps the WorkCalendar SOAP service (`SAIFDatesSoapClient`) to answer four work-day calendar questions, passing the date and calendar name through to the wire operation unchanged.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-WP-06 |
| **Trigger** | A caller request; no in-repository code constructs this wrapper |
| **Inputs** | `DateTime date`, `string calendar` |
| **Outputs** | A `DateTime` result (`FirstWorkDayOfMonth`, `LastWorkDayOfMonth`, `NextWorkDay`) or a `bool` result (`IsWorkingDay`) |
| **Primary components** | `WorkCalendarServiceProxy.FirstWorkDayOfMonth`, `IsWorkingDay`, `LastWorkDayOfMonth`, `NextWorkDay` |
| **Entry point** | `Services/SAIF.Services.Web.Proxies/WorkCalendarServiceProxy.cs` |

## Steps

1. Construct `WorkCalendarServiceProxy(serviceUrl)`: guard `serviceUrl` ([WP-BR-001](../business-rules.md#wp-br-001-required-arguments-must-be-non-null-or-non-empty)), then build a default `BasicHttpBinding` client.
2. **`FirstWorkDayOfMonth(date, calendar)`, `IsWorkingDay(date, calendar)`, `LastWorkDayOfMonth(date, calendar)`, `NextWorkDay(date, calendar)`:** each passes `(date, calendar)` directly to the same-named wire operation and returns the result unchanged; there is no local business logic in any of the four methods.

## Process flow

The following diagram visualizes the uniform pass-through pattern shared by all four queries.

```mermaid
flowchart TD
	Start([Caller invokes a date query method]) --> Call["Call same-named wire operation<br>with (date, calendar)"]
	Call --> Ret([Return wire result unchanged])
```

## Failure and edge-case behavior

- A null/empty `serviceUrl` at construction throws an argument exception before any wire client is created.
- None of the four methods performs local validation of `date` or `calendar`; an unknown calendar name or invalid date is handled entirely by the remote WorkCalendar service*.

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)

> **Note:** Statements marked with `*` were inferred from code structure, naming
> conventions, or contextual evidence where direct confirmation was not available
> in source artifacts.

## Sources
- `Services/SAIF.Services.Web.Proxies/WorkCalendarServiceProxy.cs`
