SAIF.Application.Services.AudioVideo.32 business rules
This page captures business rules enforced by this library. No rule here originates from an inherited base class or service in a dependency package — EntityBase<T> (from SAIF.Framework.Common) contributes only structural/identity behavior; no business rule was traced to it in the scanned source.
BR-AV-01 Required current user ID
Field
Value
Statement
CurrentUserId is required on an import request.
Trigger
AudioVideoValidator.Validate
Enforcement
AudioVideoValidator constructor, RuleFor(x => x.CurrentUserId).NotEmpty()
Outcome
Validation failure surfaces as SaifValidationException from AudioVideoService.ImportRecording.
Source
Application\SAIF.Application.Services.AudioVideo\Services\Utilities\AudioVideo\AudioVideoValidator.cs
BR-AV-02 Required call recording
Field
Value
Statement
CallRecording is required on an import request.
Trigger
AudioVideoValidator.Validate
Enforcement
Same file, RuleFor(x => x.CallRecording).NotEmpty()
Outcome
Validation failure surfaces as SaifValidationException from AudioVideoService.ImportRecording.
Source
Application\SAIF.Application.Services.AudioVideo\Services\Utilities\AudioVideo\AudioVideoValidator.cs
BR-AV-03 Required claim number
Field
Value
Statement
A claim number (ClaimId) is required to import a recording.
Trigger
AudioVideoValidator.Validate
Enforcement
Same file, RuleFor(x => x.ClaimId).NotEmpty()
Outcome
Validation failure, message "Error: A claim number is required."
Source
Application\SAIF.Application.Services.AudioVideo\Services\Utilities\AudioVideo\AudioVideoValidator.cs
BR-AV-04 Required investigation number for fraud recordings
Field
Value
Statement
An investigation/case number (InvestigationId) is required when the recording system is Fraud.
Trigger
AudioVideoValidator.Validate when RecordingSystem == RecordingSystemTypes.Fraud
Enforcement
Same file, .When(x => x.RecordingSystem == RecordingSystemTypes.Fraud)
Outcome
Validation failure, message "Error: A case number is required."
Source
Application\SAIF.Application.Services.AudioVideo\Services\Utilities\AudioVideo\AudioVideoValidator.cs
BR-AV-05 Description length limit
Field
Value
Statement
The combined description+notes text (CallRecordingExtensions.GetDescription(CallRecording)) must be ≤ 100 characters. The validation message itself states "less than 80 characters" — a documented inconsistency between the enforced limit of 100 and the stated limit of 80.
Trigger
AudioVideoValidator.Validate
Enforcement
Same file, Must(x => CallRecordingExtensions.GetDescription(x).Length <= 100)
Outcome
Validation failure, message text states an (inconsistent) "less than 80 characters" limit.
Source
Application\SAIF.Application.Services.AudioVideo\Services\Utilities\AudioVideo\AudioVideoValidator.cs
BR-AV-06 Default purge horizon and recording system code
Field
Value
Statement
Recordings default to RecordingSystemCode = "BRD" (board minutes) with a 90-year purge horizon unless overridden by BR-AV-07 or BR-AV-08 .
Trigger
AudioVideoService.CreateRecording
Enforcement
Services\Utilities\AudioVideo\AudioVideoService.cs, CreateRecording switch default case
Outcome
New Recording row persisted with PurgeDate = createDate.AddYears(90), RecordingSystemCode = "BRD".
Source
Application\SAIF.Application.Services.AudioVideo\Services\Utilities\AudioVideo\AudioVideoService.cs
BR-AV-07 Claim recording purge horizon
Field
Value
Statement
Claim recordings (RecordingSystemTypes.Claim) get a 75-year purge horizon and RecordingSystemCode = "CLM".
Trigger
request.RecordingSystem == RecordingSystemTypes.Claim
Enforcement
Same file/method, case RecordingSystemTypes.Claim
Outcome
PurgeDate = createDate.AddYears(75), RecordingSystemCode = "CLM".
Source
Application\SAIF.Application.Services.AudioVideo\Services\Utilities\AudioVideo\AudioVideoService.cs
BR-AV-08 Fraud recording purge horizon
Field
Value
Statement
Fraud recordings (RecordingSystemTypes.Fraud) get a 5-year purge horizon and RecordingSystemCode = "FRD".
Trigger
request.RecordingSystem == RecordingSystemTypes.Fraud
Enforcement
Same file/method, case RecordingSystemTypes.Fraud
Outcome
PurgeDate = createDate.AddYears(5), RecordingSystemCode = "FRD".
Source
Application\SAIF.Application.Services.AudioVideo\Services\Utilities\AudioVideo\AudioVideoService.cs
BR-AV-09 Recording discoverability
Field
Value
Statement
A recording is discoverable only for the Claim recording system and when the "Other Party" call-flag is absent or equals "Injured Worker".
Trigger
CallRecordingExtensions.IsDiscoverable, called from AudioVideoService.CreateRecording
Enforcement
Services\Utilities\AudioVideo\CallRecordingExtensions.cs, IsDiscoverable
Outcome
Recording.IsDiscoverable flag set accordingly.
Source
Application\SAIF.Application.Services.AudioVideo\Services\Utilities\AudioVideo\CallRecordingExtensions.cs
BR-AV-10 Recording description default
Field
Value
Statement
Recording description defaults to the "Other Party" value (or "Injured Worker" if absent), with call Notes appended only if any KeyValues flags exist.
Trigger
CallRecordingExtensions.GetDescription, called from the validator (BR-AV-05 ) and CreateRecording
Enforcement
Services\Utilities\AudioVideo\CallRecordingExtensions.cs, GetDescription
Outcome
Recording.Description value / validation input.
Source
Application\SAIF.Application.Services.AudioVideo\Services\Utilities\AudioVideo\CallRecordingExtensions.cs
BR-AV-11 Backup file integrity check
Field
Value
Statement
An imported recording's local backup copy is only accepted if its MD5 hash matches the source file; a mismatched backup file is deleted.
Trigger
AudioVideoService.CopyOriginalRecordingFileToBackup
Enforcement
Services\Utilities\AudioVideo\AudioVideoService.cs, MD5 comparison via the SAIF.HashUtil-backed GetMD5Hash extension
Outcome
Returns false (treated as a "conversion skip" upstream) and deletes the mismatched backup file.
Source
Application\SAIF.Application.Services.AudioVideo\Services\Utilities\AudioVideo\AudioVideoService.cs
Field
Value
Statement
Audio conversion re-encodes the recording to mono, 32kbps WMA via a fixed ffmpeg command line.
Trigger
AudioVideoService.ConvertAudioRecording
Enforcement
Same file, engine.CustomCommand($"-i ... -ac 1 -ab 32000 ...") (MediaToolkit.Engine)
Outcome
Produces a .wma output file; if conversion fails, the original file is copied through unconverted with no error raised.
Source
Application\SAIF.Application.Services.AudioVideo\Services\Utilities\AudioVideo\AudioVideoService.cs
BR-AV-13 Import verification null recording check
Field
Value
Statement
Import verification fails if the Recording row is null.
Trigger
AudioVideoService.VerifyImport
Enforcement
Services\Utilities\AudioVideo\AudioVideoService.cs, VerifyImport
Outcome
Throws ApplicationException.
Source
Application\SAIF.Application.Services.AudioVideo\Services\Utilities\AudioVideo\AudioVideoService.cs
BR-AV-14 Import verification missing converted file check
Field
Value
Statement
Import verification fails if the converted .wma file does not exist at the expected path.
Trigger
AudioVideoService.VerifyImport
Enforcement
Same file, VerifyImport
Outcome
Throws ApplicationException.
Source
Application\SAIF.Application.Services.AudioVideo\Services\Utilities\AudioVideo\AudioVideoService.cs
BR-AV-15 Import verification zero-length file check
Field
Value
Statement
Import verification fails if the converted file exists but has zero length.
Trigger
AudioVideoService.VerifyImport
Enforcement
Same file, VerifyImport
Outcome
Throws ApplicationException.
Source
Application\SAIF.Application.Services.AudioVideo\Services\Utilities\AudioVideo\AudioVideoService.cs
BR-AV-16 Import failure cleanup
Field
Value
Statement
On any import failure after a Recording row was created or found, the row is deleted and import status is set to Errored before re-throwing.
Trigger
AudioVideoService.ImportRecording catch block
Enforcement
Services\Utilities\AudioVideo\AudioVideoService.cs
Outcome
Recording row removed; AudioImportStatus.Status = "Errored"; original exception propagated.
Source
Application\SAIF.Application.Services.AudioVideo\Services\Utilities\AudioVideo\AudioVideoService.cs
BR-AV-17 CallRex deletion required for import completion
Field
Value
Statement
Import is not considered complete unless the source recording is successfully deleted from the CallRex system.
Trigger
AudioVideoService.ImportRecording, post-verification
Enforcement
Services\Utilities\AudioVideo\AudioVideoService.cs
Outcome
If CallRex deletion fails: AudioImportStatus.Status = "Errored", throws ApplicationException — even though the local recording already exists.
Source
Application\SAIF.Application.Services.AudioVideo\Services\Utilities\AudioVideo\AudioVideoService.cs
BR-AV-18 Missing import status default
Field
Value
Statement
A recording with no import-status row is reported with a synthetic "Missing" status rather than an error.
Trigger
ImportStatusManager.GetStatus
Enforcement
Services\Utilities\AudioVideo\ImportStatusManager.cs
Outcome
Returns AudioImportStatusInfo { Status = "Missing" }.
Source
Application\SAIF.Application.Services.AudioVideo\Services\Utilities\AudioVideo\ImportStatusManager.cs
BR-AV-19 Reduced constructor operation restriction
Field
Value
Statement
All AudioVideoService operations except HasMedia throw NotImplementedException when the service was constructed via the reduced (IUnitOfWork-only) constructor.
Trigger
Any call to MarkImportStatusErrored, ImportRecording, InvalidateRecording, CancelImport, or GetRecordingInfo(Guid) when _enableServicesFlag == false
Enforcement
Services\Utilities\AudioVideo\AudioVideoService.cs, _enableServicesFlag checks throughout
Outcome
Throws NotImplementedException("Function not valid in this instance").
Source
Application\SAIF.Application.Services.AudioVideo\Services\Utilities\AudioVideo\AudioVideoService.cs
Notes
Mark inferred statements with * and unknown statements with **. No inferred or unknown business-rule statements were identified in this library — all 19 rules above are directly traceable to source.
Sources
Application\SAIF.Application.Services.AudioVideo\Services\Utilities\AudioVideo\AudioVideoValidator.cs
Application\SAIF.Application.Services.AudioVideo\Services\Utilities\AudioVideo\AudioVideoService.cs
Application\SAIF.Application.Services.AudioVideo\Services\Utilities\AudioVideo\CallRecordingExtensions.cs
Application\SAIF.Application.Services.AudioVideo\Services\Utilities\AudioVideo\ImportStatusManager.cs