"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.OrderResolver = void 0;
const symbol_sdk_1 = require("symbol-sdk");
const options_resolver_1 = require("../options-resolver");
const order_validator_1 = require("../validators/order.validator");
/**
 * Order resolver
 */
class OrderResolver {
    /**
     * Resolves an order provided by the user.
     * @param {Options} options - Command options.
     * @param {string} altText - Alternative text.
     * @param {string} altKey - Alternative key.
     * @returns {Promise<Order>}
     */
    async resolve(options, altText, altKey) {
        const choices = [
            {
                title: 'Asc',
                value: symbol_sdk_1.Order.Asc,
            },
            {
                title: 'Desc',
                value: symbol_sdk_1.Order.Desc,
            },
        ];
        const value = await (0, options_resolver_1.OptionsChoiceResolver)(options, altKey ? altKey : 'order', altText ? altText : 'Select a direction:', choices, 'select', new order_validator_1.OrderValidator());
        return value;
    }
}
exports.OrderResolver = OrderResolver;
