ORE Studio 0.0.4
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
countries_commands Class Reference

Manages commands related to countries. More...

#include <countries_commands.hpp>

Collaboration diagram for countries_commands:
Collaboration graph

Static Public Member Functions

static void register_commands (cli::Menu &root_menu, ores::nats::service::nats_client &session, pagination_context &pagination)
 Register country-related commands.
 
static void process_get_countries (std::ostream &out, ores::nats::service::nats_client &session, pagination_context &pagination)
 Process a get countries request.
 
static void process_add_country (std::ostream &out, ores::nats::service::nats_client &session, std::string alpha2_code, std::string alpha3_code, std::string numeric_code, std::string name, std::string official_name, std::string change_reason_code, std::string change_commentary)
 Process an add country request.
 
static void process_delete_country (std::ostream &out, ores::nats::service::nats_client &session, std::string alpha2_code)
 Process a delete country request.
 
static void process_get_country_history (std::ostream &out, ores::nats::service::nats_client &session, std::string alpha2_code)
 Process a get country history request.
 

Detailed Description

Manages commands related to countries.

Member Function Documentation

◆ register_commands()

void register_commands ( cli::Menu &  root_menu,
ores::nats::service::nats_client session,
pagination_context pagination 
)
static

Register country-related commands.

Creates the countries submenu and adds country operations.

◆ process_get_countries()

void process_get_countries ( std::ostream &  out,
ores::nats::service::nats_client session,
pagination_context pagination 
)
static

Process a get countries request.

Retrieves countries from the server with pagination and displays them.

Parameters
outOutput stream for results
sessionClient session for connectivity.
paginationPagination context for state management.
Here is the caller graph for this function:

◆ process_add_country()

void process_add_country ( std::ostream &  out,
ores::nats::service::nats_client session,
std::string  alpha2_code,
std::string  alpha3_code,
std::string  numeric_code,
std::string  name,
std::string  official_name,
std::string  change_reason_code,
std::string  change_commentary 
)
static

Process an add country request.

Creates a new country with the provided details. The modified_by field is automatically set from the logged-in user's session.

Parameters
outOutput stream for results
sessionClient session for connectivity.
alpha2_codeISO 3166-1 alpha-2 code (e.g., "US")
alpha3_codeISO 3166-1 alpha-3 code (e.g., "USA")
numeric_codeISO 3166-1 numeric code (e.g., "840")
nameShort name of the country
official_nameOfficial name of the country
change_reason_codeCode identifying the reason for the change
change_commentaryFree-text commentary explaining the change
Here is the caller graph for this function:

◆ process_delete_country()

void process_delete_country ( std::ostream &  out,
ores::nats::service::nats_client session,
std::string  alpha2_code 
)
static

Process a delete country request.

Deletes a country by its alpha-2 code. Requires authentication.

Parameters
outOutput stream for results
sessionClient session for connectivity.
alpha2_codeISO 3166-1 alpha-2 code of the country to delete
Here is the caller graph for this function:

◆ process_get_country_history()

void process_get_country_history ( std::ostream &  out,
ores::nats::service::nats_client session,
std::string  alpha2_code 
)
static

Process a get country history request.

Retrieves the version history for a country by its alpha-2 code.

Parameters
outOutput stream for results
sessionClient session for connectivity.
alpha2_codeISO 3166-1 alpha-2 code of the country
Here is the caller graph for this function: