// SPDX-FileCopyrightText: 2023 Rishi Kumar // SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL #pragma once #include class EmailInfo { Q_GADGET public: enum SeverityValues { LimitSignUps, BlockSignUps, BlockAccess }; Q_ENUM(SeverityValues) [[nodiscard]] QString id() const; [[nodiscard]] QString domain() const; [[nodiscard]] QDateTime createdAt() const; [[nodiscard]] int accountSignupCount() const; [[nodiscard]] int ipSignupCount() const; void calculateCount(const QJsonArray &history, EmailInfo &info); static EmailInfo fromSourceData(const QJsonObject &doc); private: int m_accountSignupCount = 0; int m_ipSignupCount = 0; QString m_id; QString m_domain; QDateTime m_createdAt; QJsonArray m_history; };