<?php

namespace interfaces;

interface redis_i
{
    /**
     * Cache a departments booking count (cached)
     * @param int $department_id
     * @param int $count
     * @return self
     */
    public function cache_department_booking_count(int $department_id, int $count): self;

    /**
     * Get a departments booking count (cached)
     * @param int $department_id
     * @return int|null
     */
    public function get_department_booking_count(int $department_id): int|null;

    /**
     * Clear a departments booking count (cached)
     * @param int $department_id
     * @return self
     */
    public function clear_department_booking_count(int $department_id): self;


    /**
     * Cache a department webhook
     * @param int $department_id
     * @param string $webhook
     * @return self
     */
    public function cache_department_webhook(int $department_id, string $webhook): self;

    /**
     * Get a department webhook
     * @param int $department_id
     * @return string|null
     */
    public function get_department_webhook(int $department_id): string|null;

    /**
     * Clear a department webhook
     * @param int $department_id
     * @return self
     */
    public function clear_department_webhook(int $department_id): self;

    /**
     * Cache a department name
     * @param int $department_id
     * @param string $department_name
     * @return self
     */
    public function cache_department_name(int $department_id, string $department_name): self;

    /**
     * Get a department name
     * @param int $department_id
     * @return string|null
     */
    public function get_department_name(int $department_id): string|null;

    /**
     * Clear a department name
     * @param int $department_id
     * @return self
     */
    public function clear_department_name(int $department_id): self;

    /**
     * Cache an economic customers discount percentage
     * @param int $user_id
     * @param int $discount_percentage
     * @return self
     */
    public function cache_economic_customer_discount_percentage(int $user_id, int $discount_percentage): self;

    /**
     * Get an economic customers discount percentage
     * @param int $user_id
     * @return int|null
     */
    public function get_economic_customer_discount_percentage(int $user_id): int|null;

    /**
     * Clear an economic customers discount percentage
     * @param int $user_id
     * @return self
     */
    public function clear_economic_customer_discount_percentage(int $user_id): self;

    /**
     * Cache a customer notes
     * @param int $user_id
     * @param array $customer_notes
     * @return self
     */
    public function cache_customer_notes(int $user_id, array $customer_notes): self;

    /**
     * Get a customer notes
     * @param int $user_id
     * @return array|null
     */
    public function get_customer_notes(int $user_id): array|null;

    /**
     * Clear a customer notes
     * @param int $user_id
     * @return self
     */
    public function clear_customer_notes(int $user_id): self;

    /**
     * Add a log to the logs cache
     * @param string $module
     * @param string $department
     * @param int $type
     * @param int $user_id
     * @param string $action
     * @param string $message
     * @return self
     */
    public function add_log(string $module, string $department, int $type, int $user_id, string $action, string $message): self;

    /**
     * Get all logs from the logs cache
     * @return array|null
     */
    public function get_logs(): array|null;

    /**
     * Clear all logs from the logs cache
     * @return self
     */
    public function clear_logs(): self;

    /**
     * Cache a department
     * @param int $department_id
     * @param array $department
     * @return self
     */
    public function cache_department(int $department_id, array $department): self;

    /**
     * Get a department
     * @param int $department_id
     * @return array|null
     */
    public function get_department(int $department_id): array|null;

    /**
     * Clear a department
     * @param int $department_id
     * @return self
     */
    public function clear_department(int $department_id): self;

    /**
     * Get departments from the cache
     * @return array|null
     */
    public function get_departments(): array|null;

    /**
     * Cache departments
     * @param array $departments
     * @return self
     */
    public function cache_departments(array $departments): self;

    /**
     * Clear departments from the cache
     * @return self
     */
    public function clear_departments(): self;

    /**
     * Get the log count
     * @return int
     */
    public function get_log_count(): int;

    /**
     * Cache a token
     * @param string $token
     * @param array $row
     * @return self
     */
    public function cache_token(string $token, array $row): self;

    /**
     * Get a token
     * @param string $token
     * @return array|null
     */
    public function get_token(string $token): array|null;

    /**
     * Delete a token
     * @param string $token
     * @return self
     */
    public function clear_token(string $token): self;

    /**
     * Get the last cron task
     * @param string $task
     * @return int|null
     */
    public function get_last_crond_run(string $task): int|null;

    /**
     * Set the last cron task
     * @param string $task
     * @param int $time
     * @return self
     */
    public function set_last_crond_run(string $task, int $time): self;

    /**
     * Get a users id from customer number from the cache
     * @param int $customer_number
     * @return int|null
     */
    public function get_user_id_from_customer_number(int $customer_number): int|null;

    /**
     * Cache a users id from customer number
     * @param int $customer_number
     * @param int $user_id
     * @return self
     */
    public function cache_user_id_from_customer_number(int $customer_number, int $user_id): self;

    /**
     * Clear a users id from customer number from the cache
     * @param int $customer_number
     * @return self
     */
    public function clear_user_id_from_customer_number(int $customer_number): self;
}