<?php

namespace App\Repositories\Shop;

class Dashboards
{
    public static function getStats($start, $end)
    {
        return [
            'orders_count' => OrderMetrics::countByPeriod($start, $end),
            'orders_sum' => OrderMetrics::sumByPeriod($start, $end, 'total_shipped'),
            'orders_avg' => OrderMetrics::avgByPeriod($start, $end, 'total_shipped'),
            'offers_count' => Offers::count(),
            'clients_count' => Customers::count(),
            'preparationLess24H' => OrderMetrics::countInPreparationLess24H(),
            'preparationLess48H' => OrderMetrics::countInPreparationLess48H(),
            'preparationMore48H' => OrderMetrics::countInPreparationMore48H(),
        ];
    }
}
