<?php
namespace factory;

/**
 * @deprecated Use \Domain\Finances\FinanceRepository and \Controllers\FinancesController instead.
 */
class Finances
{
  private static function repo()
  {
    return new \Domain\Finances\FinanceRepository();
  }

  static public function first_operation_date()
  {
    return self::repo() -> firstOperationDate();
  }

  static public function get_operation_tags( int $operation_id )
  {
    return self::repo() -> getOperationTags( $operation_id );
  }

  static public function client_name( $client_id )
  {
    return self::repo() -> clientName( $client_id );
  }

  static public function clients_list_by_dates( $date_from, $date_to )
  {
    return self::repo() -> clientsListByDates( $date_from, $date_to );
  }

  static public function clients_list()
  {
    return self::repo() -> clientsList();
  }

  public static function category_delete( $category_id )
  {
    return self::repo() -> deleteCategory( $category_id );
  }

  public static function default_group()
  {
    return self::repo() -> defaultGroup();
  }

  public static function groups_list()
  {
    return self::repo() -> groupsList();
  }

  public static function operation_delete( $operation_id )
  {
    return self::repo() -> deleteOperation( $operation_id );
  }

  public static function tags_json( $group_id )
  {
    return self::repo() -> tagsJson( $group_id );
  }

  public static function tags_list( $group_id )
  {
    return self::repo() -> tagsList( $group_id );
  }

  static public function operations_list( $date_from, $date_to, $group_id )
  {
    return self::repo() -> operationsList( $date_from, $date_to, $group_id );
  }

  public static function operation_details( $operation_id )
  {
    return self::repo() -> operationDetails( $operation_id );
  }

  public static function operation_save( $operation_id, $category_id, $date, $amount, $description, $tags, $group_id, $client_id = null )
  {
    return self::repo() -> saveOperation( $operation_id, $category_id, $date, $amount, $description, $tags, $group_id, $client_id );
  }

  public static function category_details( $category_id )
  {
    return self::repo() -> categoryDetails( $category_id );
  }

  public static function category_save( $category_id, $name, $parent_id, $group_id )
  {
    return self::repo() -> saveCategory( $category_id, $name, $parent_id, $group_id );
  }

  static public function wallet_expenses_this_month( $group_id )
  {
    return self::repo() -> walletExpensesThisMonth( $group_id );
  }

  static public function wallet_income_this_month( $group_id )
  {
    return self::repo() -> walletIncomeThisMonth( $group_id );
  }

  static public function wallet_summary_this_month( $group_id )
  {
    return self::repo() -> walletSummaryThisMonth( $group_id );
  }

  static public function wallet_summary( $group_id )
  {
    return self::repo() -> walletSummary( $group_id );
  }

  public static function operations( $category_id, $date_from, $date_to, $tag_id = null )
  {
    return self::repo() -> operations( $category_id, $date_from, $date_to, $tag_id );
  }

  public static function categories( $date_from, $date_to, $tag_id = '', $parent_id = null, $group_id, $client_id = null )
  {
    return self::repo() -> categories( $date_from, $date_to, $tag_id, $parent_id, $group_id, $client_id );
  }
}
