Improved booking handling with unfulfilled booking checks and Slack notifications. Enhanced customer data retrieval with caching optimizations and discount calculations. Added logging, debug capabilities, and expanded Redis functionalities for better data management.
204 lines
5.2 KiB
PHP
204 lines
5.2 KiB
PHP
<?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 economic customer name
|
|
* @param int $customer_number
|
|
* @param string $customer_name
|
|
* @return self
|
|
*/
|
|
public function cache_economic_customer_name(int $customer_number, string $customer_name): self;
|
|
|
|
/**
|
|
* Get a economic customer name
|
|
* @param int $customer_number
|
|
* @return string|null
|
|
*/
|
|
public function get_economic_customer_name(int $customer_number): string|null;
|
|
|
|
/**
|
|
* Clear a economic customer name
|
|
* @param int $customer_number
|
|
* @return self
|
|
*/
|
|
public function clear_economic_customer_name(int $customer_number): 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 $customer_number
|
|
* @param int $discount_percentage
|
|
* @return self
|
|
*/
|
|
public function cache_economic_customer_discount_percentage(int $customer_number, int $discount_percentage): self;
|
|
|
|
/**
|
|
* Get an economic customers discount percentage
|
|
* @param int $customer_number
|
|
* @return int|null
|
|
*/
|
|
public function get_economic_customer_discount_percentage(int $customer_number): int|null;
|
|
|
|
/**
|
|
* Clear an economic customers discount percentage
|
|
* @param int $customer_number
|
|
* @return self
|
|
*/
|
|
public function clear_economic_customer_discount_percentage(int $customer_number): self;
|
|
|
|
/**
|
|
* Cache a customer notes
|
|
* @param int $customer_id
|
|
* @param array $customer_notes
|
|
* @return self
|
|
*/
|
|
public function cache_customer_notes(int $customer_id, array $customer_notes): self;
|
|
|
|
/**
|
|
* Get a customer notes
|
|
* @param int $customer_id
|
|
* @return array|null
|
|
*/
|
|
public function get_customer_notes(int $customer_id): array|null;
|
|
|
|
/**
|
|
* Clear a customer notes
|
|
* @param int $customer_id
|
|
* @return self
|
|
*/
|
|
public function clear_customer_notes(int $customer_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;
|
|
|
|
} |