#pragma once

#include <cstdint>
#include <string>
#include <string_view>

namespace ta::features::items::contracts
{
    enum class PendingAction
    {
        None,
        CreateItem,
        TransitItem
    };

    [[nodiscard]] constexpr std::string_view to_string(const PendingAction action) noexcept
    {
        switch (action)
        {
        case PendingAction::CreateItem: return "Create Item";
        case PendingAction::TransitItem: return "Transit Item (2-3h)";
        case PendingAction::None:
        default: return "Item Action";
        }
    }

    inline constexpr int quest_item_inventory_slot_index = 15;

    struct ItemSettings
    {
        std::string template_id;
        int slot_index = 4;
        bool override_max_amount = false;
        int amount = 1;
        bool found_in_raid = true;
        bool overwrite_slot = false;
        bool no_slot_limits = false;
        bool increased_transfer_size = false;

        bool operator==(const ItemSettings&) const = default;
    };

    struct ItemCreateRequest
    {
        PendingAction action = PendingAction::None;
        std::string template_id;
        int amount = 1;
        int max_stack_size = 1;
        bool override_max_amount = false;
        bool found_in_raid = true;
        bool overwrite_slot = false;
        int slot_index = 4;
        std::uint64_t trace_id = 0;
    };

    struct ItemActionCommand
    {
        PendingAction action = PendingAction::None;
        std::uint64_t trace_id = 0;
    };
}
