<?php

namespace endpoints\orders;

use traits\economic_endpoint_t;

class economic_invoices_totals_endpoint
{
    use economic_endpoint_t;

    /**
     * List all invoices, unless a query is provided
     * @return object {collection: [order], pagination: {maxPageSize: number, skipPages: number, results: number}}
     */
    public function get(): object
    {
        $response = $this->send_request('/invoices/totals', 'GET');
        // Return the response as an object
        return json_decode($response);
    }

    public function get_department_sent_invoice_totals()
    {
        $department_id = 20;
        $response = $this->send_request('/invoices/sent?departmentId=' . $department_id, 'GET');
        return json_decode($response);
    }

}