iachat/spec/models
Shivam Mishra 3b366f43e6
feat: setup captain limits (#10713)
This pull request introduces several changes to implement and manage
usage limits for the Captain AI service. The key changes include adding
configuration for plan limits, updating error messages, modifying
controllers and models to handle usage limits, and updating tests to
ensure the new functionality works correctly.

## Implementation Checklist

- [x] Ability to configure captain limits per check
- [x] Update response for `usage_limits` to include captain limits
- [x] Methods to increment or reset captain responses limits in the
`limits` column for the `Account` model
- [x] Check documents limit using a count query
- [x] Ensure Captain hand-off if a limit is reached
- [x] Ensure limits are enforced for Copilot Chat
- [x] Ensure limits are reset when stripe webhook comes in 
- [x] Increment usage for FAQ generation and Contact notes
- [x] Ensure documents limit is enforced

These changes ensure that the Captain AI service operates within the defined usage limits for different subscription plans, providing appropriate error messages and handling when limits are exceeded.
2025-01-23 01:23:18 +05:30
..
channel feat: add Google Email fetch and OAuth token refresh service (#9603) 2024-06-11 14:22:03 +05:30
concerns fix: assignee_changed callback not getting triggered during conversation creation (#9334) 2024-05-06 11:48:17 -07:00
integrations feat(ee): Add Captain features (#10665) 2025-01-14 16:15:47 -08:00
.keep Fix url in emails, add frontendURL helper (#19) 2019-08-25 19:59:28 +05:30
account_spec.rb feat: setup captain limits (#10713) 2025-01-23 01:23:18 +05:30
account_user_spec.rb chore: Add permissions to auth data (#9695) 2024-06-28 12:52:48 -07:00
agent_bot_inbox_spec.rb chore: Enable the new Rubocop rules (#7122) 2023-05-19 14:37:10 +05:30
agent_bot_spec.rb fix: Delete agent bots without deleting the messages (#7754) 2023-08-17 13:48:49 -07:00
article_spec.rb feat(v4): Update the help center portal design (#10296) 2024-10-23 22:09:36 -07:00
attachment_spec.rb fix: avoid Slack file upload API for fallback messages (#10461) 2024-11-26 12:56:40 +08:00
automation_rule_spec.rb feat: disable automation rules if condition fails multiple times (#9017) 2024-03-28 13:14:16 +05:30
campaign_spec.rb chore: Enable the new Rubocop rules (#7122) 2023-05-19 14:37:10 +05:30
category_spec.rb chore: Enable the new Rubocop rules (#7122) 2023-05-19 14:37:10 +05:30
contact_inbox_spec.rb fix: flaky test whatsapp_cloud_service_spec.rb:17 (#5786) 2022-11-01 19:51:42 -07:00
contact_spec.rb feat: Update the contact_type when creating or updating the contact (#9107) 2024-03-15 10:55:40 +05:30
conversation_participants_spec.rb chore: Enable the new Rubocop rules (#7122) 2023-05-19 14:37:10 +05:30
conversation_spec.rb fix: last_activity_at is nil when conv is created (#9934) 2024-08-12 15:15:49 +05:30
csat_survey_response_spec.rb chore: Enable the new Rubocop rules (#7122) 2023-05-19 14:37:10 +05:30
data_import_spec.rb chore: Add delay before running dataimport job (#8039) 2023-10-03 22:18:57 -07:00
folder_spec.rb chore: Enable the new Rubocop rules (#7122) 2023-05-19 14:37:10 +05:30
inbox_member_spec.rb chore: Enable the new Rubocop rules (#7122) 2023-05-19 14:37:10 +05:30
inbox_spec.rb feat: expiry for cache keys [CW-3038] (#8793) 2024-01-29 15:27:26 +05:30
installation_config_spec.rb Feature: Installation global config (#839) (#840) 2020-05-10 22:40:36 +05:30
label_spec.rb chore: Enable the new Rubocop rules (#7122) 2023-05-19 14:37:10 +05:30
macro_spec.rb test: reset Current.user after spec (#8123) 2023-10-17 18:06:54 +05:30
mention_spec.rb chore: Enable the new Rubocop rules (#7122) 2023-05-19 14:37:10 +05:30
message_spec.rb revert: "fix: message_type inconsistency across message end points" (#10119) 2024-09-16 20:00:11 +05:30
note_spec.rb feat(ee): Add Captain features (#10665) 2025-01-14 16:15:47 -08:00
notification_setting_spec.rb Feature: Add new notification settings for user (#569) 2020-02-29 20:41:09 +05:30
notification_spec.rb feat(v4): Update Inbox view card design (#10599) 2025-01-07 21:11:54 +05:30
platform_app_permissible_spec.rb feat: Add Platform APIs (#1456) 2021-01-14 20:35:22 +05:30
platform_app_spec.rb chore: Limit objects returned by conversation API (#2721) 2021-07-31 21:19:42 +05:30
portal_member_spec.rb chore: Enable the new Rubocop rules (#7122) 2023-05-19 14:37:10 +05:30
portal_spec.rb chore: Enable the new Rubocop rules (#7122) 2023-05-19 14:37:10 +05:30
related_category_spec.rb chore: Enable the new Rubocop rules (#7122) 2023-05-19 14:37:10 +05:30
reporting_event_spec.rb chore: Enable the new Rubocop rules (#7122) 2023-05-19 14:37:10 +05:30
team_member_spec.rb chore: Enable the new Rubocop rules (#7122) 2023-05-19 14:37:10 +05:30
team_spec.rb chore: Enable the new Rubocop rules (#7122) 2023-05-19 14:37:10 +05:30
user_spec.rb chore: Apply fixes for items in rubocop_todo [CW-1806] (#8864) 2024-02-07 13:36:04 +04:00
webhook_spec.rb chore: Enable the new Rubocop rules (#7122) 2023-05-19 14:37:10 +05:30
working_hour_spec.rb fix: Update timezone to get wday from working_hours (#5605) 2022-10-12 14:32:54 -07:00