# -*- coding: utf-8 -*-

"""
Copyright (c) 2023 DevRuby
MIT License
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
"""

from dataclasses import dataclass
from typing import Dict

from solvedac_community.Schemas.Enums.problem_level import ProblemLevel

__all__ = ["ProblemStats"]


@dataclass
class ProblemStats:
    level: ProblemLevel
    total: int
    solved: int
    tried: int
    partial: int

    def __init__(self, data: Dict[str, int]):
        self.level = ProblemLevel(data["level"])
        self.total = data["total"]
        self.solved = data["solved"]
        self.tried = data["tried"]
        self.partial = data["partial"]
