# Class RecordingAlertArchiveRepository

Namespace
  adas_core.Infrastructure.Repositories

Assembly
  adas-core.Infrastructure.dll

Represents a MongoDB repository responsible for managing archived patient recording alerts, exposing archive-specific data access operations through the recording alert archive repository contract.

    public class RecordingAlertArchiveRepository : MongoRepository<PatientRecordingAlert>, IRecordingAlertArchiveRepository, IMongoRepository<PatientRecordingAlert>

Inheritance
  object
  MongoRepository<PatientRecordingAlert>
  RecordingAlertArchiveRepository

Implements
  IRecordingAlertArchiveRepository
  IMongoRepository<PatientRecordingAlert>

Inherited Members
  MongoRepository<PatientRecordingAlert>.Db
  MongoRepository<PatientRecordingAlert>.Collection
  MongoRepository<PatientRecordingAlert>.UpdateOneAsync(ObjectId, PatientRecordingAlert)
  MongoRepository<PatientRecordingAlert>.DeleteAsync(ObjectId)
  MongoRepository<PatientRecordingAlert>.CreateIndexes()
  MongoRepository<PatientRecordingAlert>.InsertInitialLoad()
  MongoRepository<PatientRecordingAlert>.InsertManyAsync(List<PatientRecordingAlert>)
  MongoRepository<PatientRecordingAlert>.UpdateManyObjectIdAsync(string, ObjectId, ObjectId)
  MongoRepository<PatientRecordingAlert>.DeleteAsync(string)
  MongoRepository<PatientRecordingAlert>.CollectionExists(string)
  object.Equals(object)
  object.Equals(object, object)
  object.GetHashCode()
  object.GetType()
  object.MemberwiseClone()
  object.ReferenceEquals(object, object)
  object.ToString()

Extension Methods
  NumberUtils.IsNumber(object)
  NumberUtils.ToDouble(object)
  ObjectUtils.ToStr(object?)

## Constructors

### RecordingAlertArchiveRepository(IOptions<ApiSettings>, IMongoDatabase)

    public RecordingAlertArchiveRepository(IOptions<ApiSettings> apiSettings, IMongoDatabase database)

#### Parameters

`apiSettings` IOptions<ApiSettings>
`database` IMongoDatabase

## Methods

### DeleteBeforeDate(DateTime)

Deletes all PatientRecordingAlert records whose `Time` is earlier than the specified cutoff date.

    public Task DeleteBeforeDate(DateTime date)

#### Parameters

`date` DateTime

  The cutoff date; records with a time strictly before this value will be removed.

#### Returns

Task

### GetCollectionName()

Gets the collection name for archive patients recording alerts, returning the configured value from API settings or a default name when no setting is provided.

    public override string GetCollectionName()

#### Returns

string

  The configured collection name from `_apiSettings.ArchivePatientsRecordingalerts`, or the default "archive_patients_recordingalerts" if the setting is null.

### InsertBatch(IEnumerable<PatientRecordingAlert>)

Bulk inserts a collection of patient recording alerts using a single batch operation and returns the number of documents successfully inserted.

    public Task<long> InsertBatch(IEnumerable<PatientRecordingAlert> patientRecordingAlerts)

#### Parameters

`patientRecordingAlerts` IEnumerable<PatientRecordingAlert>

  The patient recording alerts to insert into the collection.

#### Returns

Task<long>

  The number of patient recording alerts that were inserted.

### InsertOneAsync(PatientRecordingAlert)

Asynchronously inserts a new PatientRecordingAlert into the underlying collection.

    public override Task InsertOneAsync(PatientRecordingAlert patientRecordingAlert)

#### Parameters

`patientRecordingAlert` PatientRecordingAlert

  The patient recording alert document to persist.

#### Returns

Task