#pragma once

#include <sdi_toolBox/external/nlohmann/json/json.hpp>

namespace core::requirements
{
//--------------------------------------------------------------
class Requirement
{
  using json = nlohmann::ordered_json;
  using sv   = std::string_view;

  public:
  enum class Status : uint8_t
  {
    Unknown = 0,
    Draft,
    InReview,
    Approved,
    Blocked,
    Delivered,
  };

  enum class Priority : uint8_t
  {
    Critical = 0,
    High,
    Medium,
    Low
  };

  public:
  Requirement();                                                    // Default constructor
  virtual ~Requirement()                             = default;     // Default destructor
  Requirement(const Requirement &obj)                = default;     // Copy constructor
  Requirement(Requirement &&obj) noexcept            = default;     // Move constructor
  Requirement &operator=(const Requirement &obj)     = delete;      // Copy assignment operator
  Requirement &operator=(Requirement &&obj) noexcept = delete;      // Move assignment operator

  json get_summary();     // Get a summary of the requirement for list display
  json get_detail();      // Get detailed information about the requirement for the detail view

  // Helper functions
  [[nodiscard]] static std::string status_to_string(Status pStatus);                   // Convert a Status enum value to a human-readable string
  [[nodiscard]] static Status      string_to_status(const std::string &statusStr);     // Convert a human-readable string to a Status enum value

  private:
  // Internal fields (not exposed to the UI)
  std::string m_uuid;

  public:
  // Core fields
  std::string &uuid      = m_uuid;
  size_t       reference = 0;
  std::string  title;
  Status       status   = Status::Unknown;
  Priority     priority = Priority::Critical;
};
//--------------------------------------------------------------
}     // namespace core::requirements