---
title: Validate import request
summary: Applies FluentValidation rules to an ImportAudioRequest before import processing begins.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-09-15
library: SAIF.Application.Services.AudioVideo.32
reference_type: package
operation_id: OP-AV-VALIDATE-REQUEST
trigger: Invoked as step 1 of AudioVideoService.ImportRecording
---

# Validate import request

`AudioVideoValidator` is a `FluentValidation.AbstractValidator<ImportAudioRequest>` invoked synchronously at the start of [Import call recording](import-call-recording.md), isolating input-validation rules from orchestration logic.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-AV-VALIDATE-REQUEST |
| **Trigger** | `ImportAudioRequest` instance passed to `AudioVideoValidator.Validate` |
| **Inputs** | `ImportAudioRequest` (`CurrentUserId`, `CallRecording`, `ClaimId`, `InvestigationId`, `RecordingSystem`) |
| **Outputs** | `FluentValidation.Results.ValidationResult` with `IsValid`/`Errors`, consumed by the caller to build a `SaifValidationException` |
| **Primary components** | `AudioVideoValidator` |
| **Entry point** | `Application\SAIF.Application.Services.AudioVideo\Services\Utilities\AudioVideo\AudioVideoValidator.cs` |

## Steps

1. `CurrentUserId` must not be empty ([BR-AV-01](../business-rules.md#br-av-01-required-current-user-id)).
   - On failure: adds a validation error for `CurrentUserId`.
2. `CallRecording` must not be empty/null ([BR-AV-02](../business-rules.md#br-av-02-required-call-recording)).
   - On failure: adds a validation error for `CallRecording`.
3. `ClaimId` must not be empty ([BR-AV-03](../business-rules.md#br-av-03-required-claim-number)).
   - On failure: adds a validation error with message "Error: A claim number is required."
4. If `RecordingSystem == RecordingSystemTypes.Fraud`, `InvestigationId` must not be empty ([BR-AV-04](../business-rules.md#br-av-04-required-investigation-number-for-fraud-recordings)).
   - On failure: adds a validation error with message "Error: A case number is required."
   - If `RecordingSystem != RecordingSystemTypes.Fraud`: this rule is skipped entirely.
5. The combined description+notes text (`CallRecordingExtensions.GetDescription(CallRecording)`) must be ≤ 100 characters ([BR-AV-05](../business-rules.md#br-av-05-description-length-limit)).
   - `GetDescription` itself applies [BR-AV-10](../business-rules.md#br-av-10-recording-description-default) to compute the text being measured.
   - On failure: adds a validation error whose message text states "less than 80 characters" — a documented inconsistency with the actual 100-character enforced limit.
6. `FluentValidation` aggregates all rule results into a single `ValidationResult` and returns it to the caller (`AudioVideoService.ImportRecording`), which wraps any failures in a `SaifValidationException`.

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start([Validate called]) --> S1{CurrentUserId empty?}
	S1 -->|Yes| Err1[Add error]
	S1 -->|No| S2{CallRecording empty?}
	S2 -->|Yes| Err2[Add error]
	S2 -->|No| S3{ClaimId empty?}
	S3 -->|Yes| Err3[Add error]
	S3 -->|No| S4{RecordingSystem = Fraud and InvestigationId empty?}
	S4 -->|Yes| Err4[Add error]
	S4 -->|No| S5{Description length > 100?}
	S5 -->|Yes| Err5[Add error]
	S5 -->|No| Ok([All rules pass])
	Err1 --> Result([Return ValidationResult])
	Err2 --> Result
	Err3 --> Result
	Err4 --> Result
	Err5 --> Result
	Ok --> Result
```

## Failure and edge-case behavior
- Multiple rule failures are aggregated into a single `ValidationResult`; `AudioVideoService.ImportRecording` throws one `SaifValidationException` wrapping all of them, not one exception per rule.
- The description-length rule message states 80 characters while the code enforces 100 ([BR-AV-05](../business-rules.md#br-av-05-description-length-limit)) — callers relying on the message text to determine the actual limit will be misled.

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

## Sources
- `Application\SAIF.Application.Services.AudioVideo\Services\Utilities\AudioVideo\AudioVideoValidator.cs`
- `Application\SAIF.Application.Services.AudioVideo\Services\Utilities\AudioVideo\CallRecordingExtensions.cs`
