<?php

namespace lib\Services;

use lib\Entities\OnetimeEntity as Entity;
use lib\Models\OnetimeModel as Model;

class OnetimeService extends CommonService
{
  public function __construct()
  {
    parent::__construct();
  }
  final public function getClassName(): string
  {
    return "Onetime";
  }
  final public function getClassPath(): string
  {
    return $this->getClassName();
  }
  public function getModelClass(): string
  {
    return Model::class;
  }
  public function getEntityClass(): string
  {
    return Entity::class;
  }
  public function getCountByServiceCode(string $service_code): int
  {
    $this->getModel()->where("service_code", $service_code);
    return $this->getCount();
  }

  public function getCountByClientCode(string $client_code): int
  {
    $this->getModel()->where("client_code", $client_code);
    return $this->getCount();
  }
}
