Agents
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
AGENTS.md
|
||||
@@ -288,6 +288,18 @@ class Playground extends CI_Controller
|
||||
['method' => 'GET', 'path' => '/estimates/search/{keyword}', 'description' => 'Search estimates']
|
||||
]
|
||||
],
|
||||
'customers' => [
|
||||
'name' => 'Customers',
|
||||
'description' => 'Manage customer data and information',
|
||||
'endpoints' => [
|
||||
['method' => 'GET', 'path' => '/customers', 'description' => 'Get all customers'],
|
||||
['method' => 'POST', 'path' => '/customers', 'description' => 'Create new customer'],
|
||||
['method' => 'GET', 'path' => '/customers/{id}', 'description' => 'Get specific customer'],
|
||||
['method' => 'PUT', 'path' => '/customers/{id}', 'description' => 'Update customer'],
|
||||
['method' => 'DELETE', 'path' => '/customers/{id}', 'description' => 'Delete customer'],
|
||||
['method' => 'GET', 'path' => '/customers/search/{keyword}', 'description' => 'Search customers']
|
||||
]
|
||||
],
|
||||
'contracts' => [
|
||||
'name' => 'Contracts',
|
||||
'description' => 'Manage client contracts and agreements',
|
||||
@@ -374,6 +386,17 @@ class Playground extends CI_Controller
|
||||
['method' => 'DELETE', 'path' => '/proposals/{id}', 'description' => 'Delete proposal']
|
||||
]
|
||||
],
|
||||
'staffs' => [
|
||||
'name' => 'Staff',
|
||||
'description' => 'Manage staff members and user accounts',
|
||||
'endpoints' => [
|
||||
['method' => 'GET', 'path' => '/staffs', 'description' => 'Get all staff members'],
|
||||
['method' => 'POST', 'path' => '/staffs', 'description' => 'Create new staff member'],
|
||||
['method' => 'GET', 'path' => '/staffs/{id}', 'description' => 'Get specific staff member'],
|
||||
['method' => 'PUT', 'path' => '/staffs/{id}', 'description' => 'Update staff member'],
|
||||
['method' => 'DELETE', 'path' => '/staffs/{id}', 'description' => 'Delete staff member']
|
||||
]
|
||||
],
|
||||
'subscriptions' => [
|
||||
'name' => 'Subscriptions',
|
||||
'description' => 'Manage recurring subscriptions and billing',
|
||||
|
||||
49
api/migrations/211_version_211.php
Normal file
49
api/migrations/211_version_211.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
defined('BASEPATH') or exit('No direct script access allowed');
|
||||
|
||||
class Migration_Version_211 extends App_module_migration
|
||||
{
|
||||
/** @var CI_DB_query_builder */
|
||||
protected $db;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// Properly initialize the database once the migration is constructed
|
||||
$CI = &get_instance();
|
||||
$CI->load->database();
|
||||
$this->db = $CI->db;
|
||||
}
|
||||
|
||||
public function up()
|
||||
{
|
||||
// Add rate limiting columns to api_usage_logs table
|
||||
if (!$this->db->field_exists('rate_limit_checked', db_prefix() . 'api_usage_logs')) {
|
||||
$this->db->query("
|
||||
ALTER TABLE `" . db_prefix() . "api_usage_logs`
|
||||
ADD `rate_limit_checked` tinyint(1) NOT NULL DEFAULT 0 AFTER `user_agent`,
|
||||
ADD `rate_limit_type` varchar(20) NULL AFTER `rate_limit_checked`,
|
||||
ADD `rate_limit_limit` int(11) NULL AFTER `rate_limit_type`,
|
||||
ADD `rate_limit_current` int(11) NULL AFTER `rate_limit_limit`,
|
||||
ADD `rate_limit_exceeded` tinyint(1) NOT NULL DEFAULT 0 AFTER `rate_limit_current`
|
||||
");
|
||||
}
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
// Remove rate limiting columns from api_usage_logs table
|
||||
if ($this->db->field_exists('rate_limit_checked', db_prefix() . 'api_usage_logs')) {
|
||||
$this->db->query("
|
||||
ALTER TABLE `" . db_prefix() . "api_usage_logs`
|
||||
DROP COLUMN `rate_limit_checked`,
|
||||
DROP COLUMN `rate_limit_type`,
|
||||
DROP COLUMN `rate_limit_limit`,
|
||||
DROP COLUMN `rate_limit_current`,
|
||||
DROP COLUMN `rate_limit_exceeded`
|
||||
");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user