# Interface IHistoricalConfigChangesService

Namespace
  adas_core.Application.Services.Interfaces

Assembly
  adas-core.Application.dll

    public interface IHistoricalConfigChangesService

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

## Methods

### DeleteHistoricalConfigChange(ObjectId)

Deletes a historical configuration change identified by the specified identifier.

    Task DeleteHistoricalConfigChange(ObjectId id)

#### Parameters

`id` ObjectId

  The identifier of the historical configuration change to delete.

#### Returns

Task

### FindLastConfigChanges(ConfigTypes)

Asynchronously retrieves the most recent historical configuration changes for the specified configuration type. Returns null if no historical changes are found for the given type.

    Task<HistoricalConfigChanges?> FindLastConfigChanges(DisplayConfigEnums.ConfigTypes configTypes)

#### Parameters

`configTypes` DisplayConfigEnums.ConfigTypes

  The configuration type used to look up the most recent historical changes.

#### Returns

Task<HistoricalConfigChanges>

  A task that represents the asynchronous operation. The task result contains the last HistoricalConfigChanges for the specified type, or null if no changes are available.

### Get(ObjectId)

Asynchronously retrieves a historical configuration change entry by its unique identifier. Returns null when no matching historical configuration change is found for the specified id.

    Task<HistoricalConfigChanges?> Get(ObjectId id)

#### Parameters

`id` ObjectId

  The unique identifier of the historical configuration change to retrieve.

#### Returns

Task<HistoricalConfigChanges>

  A task that represents the asynchronous operation, containing the matching HistoricalConfigChanges or null if not found.

### GetAll()

Asynchronously retrieves all historical configuration changes recorded in the system.

    Task<ICollection<HistoricalConfigChanges>> GetAll()

#### Returns

Task<ICollection<HistoricalConfigChanges>>

  A task that represents the asynchronous operation. The task result contains a collection of all HistoricalConfigChanges entries.

### GetByType(ConfigTypes, int)

Asynchronously retrieves a collection of historical configuration changes filtered by the specified configuration type.

    Task<ICollection<HistoricalConfigChanges>> GetByType(DisplayConfigEnums.ConfigTypes type, int num)

#### Parameters

`type` DisplayConfigEnums.ConfigTypes

  The configuration type used to filter the historical changes.

`num` int

  The maximum number of historical change records to return.

#### Returns

Task<ICollection<HistoricalConfigChanges>>

  A task that represents the asynchronous operation, containing a collection of HistoricalConfigChanges for the specified type.

### GetByUser(string, ConfigTypes?, int)

Retrieves a collection of historical configuration changes associated with the specified user. Results can be filtered by configuration type and limited in count; when the configuration type is not provided, all types are considered.

    Task<ICollection<HistoricalConfigChanges>> GetByUser(string user, DisplayConfigEnums.ConfigTypes? configTypes, int num)

#### Parameters

`user` string

  The identifier of the user whose historical configuration changes should be retrieved.

`configTypes` DisplayConfigEnums.ConfigTypes?

  The optional configuration type used to filter the results; if null, changes for all configuration types are returned.

`num` int

  The maximum number of historical configuration change records to return.

#### Returns

Task<ICollection<HistoricalConfigChanges>>

  A task that represents the asynchronous operation, containing the collection of historical configuration changes matching the specified criteria.

### InsertOne(HistoricalConfigChanges)

Inserts a single historical configuration change record into the data store. Returns the inserted record, or null if the insert could not be performed.

    Task<HistoricalConfigChanges?> InsertOne(HistoricalConfigChanges historicalConfigChanges)

#### Parameters

`historicalConfigChanges` HistoricalConfigChanges

  The historical configuration change entity to be inserted.

#### Returns

Task<HistoricalConfigChanges>

  A task that represents the asynchronous operation, containing the inserted HistoricalConfigChanges entity, or null if the insertion did not produce a result.

### LogConfigChanged(string, ConfigTypes, string, string)

Logs a configuration change event, recording the user who made the change, the type of configuration affected, and the old and new configuration values.

    Task LogConfigChanged(string user, DisplayConfigEnums.ConfigTypes configType, string newConfig, string oldConfig)

#### Parameters

`user` string

  The identifier of the user who made the configuration change.

`configType` DisplayConfigEnums.ConfigTypes

  The type of configuration that was changed.

`newConfig` string

  The new configuration value after the change.

`oldConfig` string

  The previous configuration value before the change.

#### Returns

Task

### UpdateHistoricalConfigChange(HistoricalConfigChanges)

Updates an existing historical configuration change record with the provided data and returns the updated entity.

    Task<HistoricalConfigChanges?> UpdateHistoricalConfigChange(HistoricalConfigChanges historicalConfigChanges)

#### Parameters

`historicalConfigChanges` HistoricalConfigChanges

  The historical configuration change entity containing the updated values to be persisted.

#### Returns

Task<HistoricalConfigChanges>

  A task that resolves to the updated HistoricalConfigChanges, or `null` if the record was not found.