<?php



class AccModel extends BaseModel {



	public function __construct() {

		parent::__construct("AccTransport", [ACC_APIKEY, ACC_IPADDRESS]);

	}





	/* PRODUCT */



	public function getProducts($branchId) {

        $params = [

	        "Offset" => "0",

	        "Limit" => "15000",

			"Filters" => [

				["id"=> "branch", "values"=> [$branchId, "" . random_int(15000, 19999)] ],

			],

		];

		$result = $this->transport()->post("GetProducts", $params);

		return $result ?? false;

	}

	public function getProduct($productId) {

        $params = [

            "ProductId" => $productId,

        ];

		$result = $this->transport()->post("GetProduct", $params);

		return $result["Product"] ?? false;

	}





}