# Interface IPumpStateRepository

Namespace
  adas_core.Application.Repositories.Interfaces

Assembly
  adas-core.Application.dll

    public interface IPumpStateRepository

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

## Methods

### FindByDeviceIdAsync(string)

Asynchronously retrieves the pump state associated with the specified device identifier. Returns null when no matching pump state is found for the given device identifier.

    Task<PumpState?> FindByDeviceIdAsync(string deviceId)

#### Parameters

`deviceId` string

  The unique identifier of the device whose pump state is being looked up.

#### Returns

Task<PumpState>

  A task that resolves to the PumpState if a match is found, or null if no pump state exists for the specified device.

### GetAllAsync()

Asynchronously retrieves all available pump states.

    Task<IEnumerable<PumpState>> GetAllAsync()

#### Returns

Task<IEnumerable<PumpState>>

  A task that represents the asynchronous operation. The task result contains a collection of all PumpState objects.

### UpsertAsync(PumpState)

Asynchronously creates or updates a pump state record in the data store.

    Task UpsertAsync(PumpState state)

#### Parameters

`state` PumpState

  The pump state to be inserted if it does not exist, or updated if it already exists.

#### Returns

Task