#pragma once

#include "xtr/doc/FileTypes.h"

namespace xtr {

struct OSSVersion : ccl::meta::Orderable<OSSVersion> {
  enum VersionID : uint16_t {
    old = 0,
    r1092 = 1, // Exteor 4.0 R1092 - 09/27/2013
    r1483 = 2, // Exteor 4.5 R1438 - 08/04/2016﻿
    r1553 = 3, // Exteor 4.5 R1553 - 04/26/2017
    r1800 = 4, // Exteor 4.6 R1800 - 09/21/2018
    r47101200 = 5, // Exteor 4.7.10.1200 - 05/28/2019
    r202205 = 6, // Exteor 4.8.13.1000 - 30/05/2022
  };

  VersionID v;

  constexpr OSSVersion(VersionID ver) noexcept : v{ ver } {}
  constexpr operator VersionID() const noexcept { return v; }
  constexpr VersionID get() const noexcept { return v; }

  static OSSVersion Latest() noexcept {
    static const OSSVersion latest{ r202205 };
    return latest;
  }
  static CString LastestInfo() {
    static const CString info{ LR"(Exteor 4.8.13.1000 - 30/05/2022)" };
    return info;
  }
};

struct TRSVersion : ccl::meta::Orderable<TRSVersion> {
  enum VersionID : uint16_t {
    old = 10,
    r1010 = 11,
    r1092 = 12, // Exteor 4.0 R1092 - 09/27/2013
    r1438 = 13, // Exteor 4.5 R1438 - 08/04/2016﻿
    r1800 = 14, // Exteor 4.6 R1800 - 09/21/2018
    r47101200 = 15, // Exteor 4.7.10.1200 - 05/28/2019
    r202205 = 16, // Exteor 4.8.13.1000 - 30/05/2022
  };

  VersionID v;

  constexpr TRSVersion(VersionID ver) noexcept : v{ ver } {}
  constexpr operator VersionID() const noexcept { return v; }
  constexpr VersionID get() const noexcept { return v; }

  static TRSVersion Latest() noexcept {
    static const TRSVersion latest{ r202205 };
    return latest;
  }
  static const CString LastestInfo() {
    static const CString info{ LR"(Exteor 4.8.13.1000 - 30/05/2022)" };
    return info;
  }
};

struct RSMVersion : ccl::meta::Orderable<RSMVersion> {
  enum VersionID : uint16_t {
    old = 0,
    r1010 = 1,
    r1092 = 2, // Exteor 4.0 R1092 - 09/27/2013
    r1438 = 3, // Exteor 4.5 R1438 - 08/04/2016﻿
    r1800 = 4, // Exteor 4.6 R1800 - 09/21/2018
    r47101200 = 5, // Exteor 4.7.10.1200 - 05/28/2019
    r202205 = 6, // Exteor 4.8.13.1000 - 30/05/2022
  };

  VersionID v;

  constexpr RSMVersion(VersionID ver) noexcept : v{ ver } {}
  constexpr operator VersionID() const noexcept { return v; }
  constexpr VersionID get() const noexcept { return v; }

  static RSMVersion Latest() noexcept {
    static const RSMVersion latest{ r202205 };
    return latest;
  }
  static const CString LastestInfo() {
    static const CString info{ LR"(Exteor 4.8.13.1000 - 30/05/2022)" };
    return info;
  }
};

} // namespace xtr