bcfreeflight
    Preparing search index...

    Class AwsDynamoDBWeatherRepository

    Repository for managing weather data.

    Index

    Constructors

    • Creates a new instance of AwsDynamoDBWeatherRepository.

      Parameters

      • dbClient: DynamoDBClient

        The DynamoDB client to use for database operations.

      • currentWeatherTable: string

        The name of the DynamoDB table containing current weather data.

      • averageWeatherTable: string

        The name of the DynamoDB table containing average weather data.

      Returns AwsDynamoDBWeatherRepository

    Methods

    • Deletes all items with the specified IDs from the current weather table. The deletion is performed in batches due to the database's batch write limit.

      Parameters

      • deviceIds: string[]

        An array of IDs representing the items to be deleted. If the array is empty, the method returns without performing any action.

      Returns Promise<void>

      A promise that resolves once all specified items have been deleted.

    • Lists weather records from the average weather table based on the provided parameters.

      Parameters

      • deviceId: string

        The ID of the device to filter records by. This is a required parameter.

      • localDate: string

        The local date parameter in the format MM-DD-YYYY to filter records by.

      Returns Promise<WeatherRecord<AverageWeatherData>[]>

      A promise that resolves to an array of weather records ordered by timestamp with newest records first.