'use strict';

var Api = require('./Api-D9vOcUw4.js');
require('./Plaid-CPESyiiV.js');
require('./Pagination-Dediz133.js');
require('./Business-oBifyXkW.js');

const api = Api.Api();
class TerminalService {
    async fetchTerminals(accountId, authToken, params) {
        const endpoint = 'terminals';
        const headers = { Account: accountId };
        return api.get({ endpoint, params, headers, authToken });
    }
    async fetchTerminal(terminalId, authToken) {
        const endpoint = `terminals/${terminalId}`;
        return api.get({ endpoint, authToken });
    }
    async fetchTerminalModels(accountId, authToken) {
        const endpoint = 'terminals/order_models';
        const headers = { 'sub-account': accountId };
        return api.get({ endpoint, headers, authToken });
    }
    async orderTerminals(authToken, terminalOrder) {
        const endpoint = 'terminals/orders';
        const body = terminalOrder;
        const headers = { 'sub-account': terminalOrder.sub_account_id };
        return api.post({ endpoint, body, headers, authToken });
    }
}

exports.TerminalService = TerminalService;
