#ifndef COMMON_H
#define COMMON_H

#include <cstdint>
#include "security.hpp"

/**
 * @brief Server action codes
 */
enum class ServerAction : uint8_t {
  // Open layer
  key_exchange,               //!< TLS Handshake
  encrypted,                  //!< Secured data

  // Secure layer
  server_info,                //!< Get server info
  authentication_success,     //!< Success authentication

  // Authenticated layer
  request_result,             //!< Request result
  event_notification,         //!< Notificate client about some event on server-side
  processing_result,          //!< Data processting result

  err = 0xFF
};


/**
 * @brief Client action codes
 */
enum class ClientAction : uint8_t {
  // Open layer
  key_exchange,               //!< TLS Handshake
  encrypted,                  //!< Secured data

  // Secure layer
  registration,               //!< New account registration
  authentication,             //!< Account sign in
  uuid_authentication,        //!< Sign in by uuid
  uuid_check,                 //!< Check uuid
  server_info,                //!< Get server info

  // Authenticated layer
  request,                    //!< Request

  err
};


/**
 * @brief Client data request code
 */
enum class RequestCode : uint8_t {
  // Change segment
  change_profile,
  delete_account,

  create_dialog,
  send_message,
  change_message,
  delete_message,

  publish_post,
  change_post,
  delete_post,

  // Get segment
  get_user_profiles,              //!< Get user profile list
  get_user_public_key,            //!< Get public key of user
  get_posts,                      //!< Get post list of page
  get_messages,                   //!< Get messages from dialog
};


/**
 * @brief The client account status enum
 */
enum class ClientStatus : uint8_t {
  active = 0x00,                    //!< Client account is active
  deleted = 0x01,                   //!< Client account is deleted from user
  blocked = 0x02,                   //!< Client account is blocked from adminitrator
};


/**
 * @brief Server Error codes
 */
enum class ServerError : uint8_t {
  invalid_action_code,
  cryptographic_error,
  authentication_failed,
  request_handling_error
};

#endif // COMMON_H
