// This file was generated automatically by Qleany's generator, edit at your own risk! 
// If you do, be careful to not overwrite it when you run the generator again.
#pragma once

#include "{{ export_header }}"
#include "{{ feature_snake_name }}/{{ entity_mappable_with_snake }}_dto.h"
#include "{{ feature_snake_name }}/queries/get_{{ entity_mappable_with_snake }}_query.h"

#include "repository/interface_{{ entity_mappable_with_snake }}_repository.h"
#include <QPromise>

using namespace Qleany;
using namespace {{ application_cpp_domain_name }}::Contracts::DTO::{{ feature_pascal_name }};
using namespace {{ application_cpp_domain_name }}::Contracts::Repository;
using namespace {{ application_cpp_domain_name }}::Contracts::CQRS::{{ feature_pascal_name }}::Queries;

namespace {{ application_cpp_domain_name }}::Application::Features::{{ feature_pascal_name }}::Queries
{
class {{ export }} Get{{ entity_mappable_with_pascal }}QueryHandler  : public QObject
{
    Q_OBJECT
  public:
    Get{{ entity_mappable_with_pascal }}QueryHandler(Interface{{ entity_mappable_with_pascal }}Repository *repository);
    Result<{{ entity_mappable_with_pascal }}DTO> handle(QPromise<Result<void>> &progressPromise, const Get{{ entity_mappable_with_pascal }}Query &query);

  private:
    Interface{{ entity_mappable_with_pascal }}Repository *m_repository;
    Result<{{ entity_mappable_with_pascal }}DTO> handleImpl(QPromise<Result<void> >   & progressPromise, const Get{{ entity_mappable_with_pascal }}Query &query);
    static bool s_mappingRegistered;
    void registerMappings();
};

} // namespace {{ application_cpp_domain_name }}::Application::Features::{{ feature_pascal_name }}::Queries
