~aleteoryx/muditaos

ref: c68624ee3730ccbfb715ec1975fdd599b6ed0cce muditaos/module-db/queries/notifications/QueryNotificationsDecrement.hpp -rw-r--r-- 1.1 KiB
c68624ee — Bartosz [MOS-000] Update commit checks 2 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
37
38
39
40
// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once

#include <Interface/NotificationsRecord.hpp>
#include <Common/Query.hpp>
#include <string>
#include <PhoneNumber.hpp>
#include <cstdint>

namespace db::query::notifications
{
    class Decrement : public Query
    {
        const NotificationsRecord::Key key;
        const size_t count;
        size_t numberID = 0;

      public:
        Decrement(NotificationsRecord::Key key, size_t numberID, size_t count);

        [[nodiscard]] auto getKey() const noexcept -> NotificationsRecord::Key;
        [[nodiscard]] auto getCount() const noexcept -> size_t;
        [[nodiscard]] auto getNumberID() const noexcept -> size_t;
        [[nodiscard]] auto debugInfo() const -> std::string override;
    };

    class DecrementResult : public QueryResult
    {
        bool ret;

      public:
        explicit DecrementResult(bool ret);
        [[nodiscard]] auto getResult() const noexcept -> bool;

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

} // namespace db::query::notifications