~aleteoryx/muditaos

ref: be66c108884ef3337071c7f66ab2c137df48d00b muditaos/module-db/queries/calendar/QueryEventsSelectFirstUpcoming.hpp -rw-r--r-- 1.1 KiB
be66c108 — Tomek Sobkowiak [EGD-5347] Replace filelength with file_size 5 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once

#include "module-db/Interface/EventsRecord.hpp"
#include <Common/Query.hpp>
#include <string>
#include <module-apps/application-calendar/data/dateCommon.hpp>

namespace db::query::events
{
    /// Query for getting calendar event whose reminder is first in filtered time range
    class SelectFirstUpcoming : public Query
    {
      public:
        SelectFirstUpcoming(calendar::TimePoint filter_from, calendar::TimePoint filter_till);
        [[nodiscard]] auto debugInfo() const -> std::string override;

        calendar::TimePoint filter_from;
        calendar::TimePoint filter_till;
    };

    /// Result of SelectFirstUpcoming query
    class SelectFirstUpcomingResult : public QueryResult
    {
        std::vector<EventsRecord> records;

      public:
        SelectFirstUpcomingResult(std::vector<EventsRecord> records);
        [[nodiscard]] auto getResult() -> std::vector<EventsRecord>;

        [[nodiscard]] auto debugInfo() const -> std::string override;
    };

} // namespace db::query::events