iachat/app/policies
Tanmay Deep Sharma 341487b93e
feat: Add assignment policies controllers with jbuilder views (#12199)
## Linear reference:
https://linear.app/chatwoot/issue/CW-4649/re-imagine-assignments

## Description
This PR introduces the foundation for Assignment V2 system by
implementing assignment policies and their association with inboxes.
Assignment policies allow configuring how conversations are distributed
among agents, with support for different assignment orders (round_robin
in community, balanced in enterprise) and conversation prioritization
strategies

Fixes # (issue)

## Type of change

Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality not to work as expected)
- [ ] This change requires a documentation update

## How Has This Been Tested?

Test Coverage:
-  Controller specs for assignment policies CRUD operations
-  Enterprise-specific specs for balanced assignment order
-  Model specs for community/enterprise separation

Manual Testing:
1. Create assignment policy: POST
/api/v1/accounts/{id}/assignment_policies
2. List policies: GET /api/v1/accounts/{id}/assignment_policies
3. Assign policy to inbox: POST
/api/v1/accounts/{id}/assignment_policies/{id}/inboxes
4. View inbox policy: GET
/api/v1/accounts/{id}/inboxes/{id}/assignment_policy
5. Verify community edition ignores "balanced" assignment order
6. Verify enterprise edition supports both "round_robin" and "balanced"

- testing the flows after enterprise folder deletion

## Checklist:

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented on my code, particularly in hard-to-understand
areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream
modules

---------

Co-authored-by: Pranav <pranavrajs@gmail.com>
Co-authored-by: Pranav <pranav@chatwoot.com>
2025-08-18 19:15:21 -07:00
..
account_policy.rb feat: Ability to delete account for administrators (#1874) 2025-04-03 10:41:39 +05:30
agent_bot_policy.rb feat: Ability to reset api_access_token (#11565) 2025-05-29 14:42:13 +05:30
application_policy.rb chore: Update dependencies (#1173) 2020-09-08 11:24:08 +05:30
article_policy.rb chore: Clean up report & knowledge base policies (#11234) 2025-04-03 16:00:32 -07:00
assignment_policy_policy.rb feat: Add assignment policies controllers with jbuilder views (#12199) 2025-08-18 19:15:21 -07:00
automation_rule_policy.rb feat: common attachment endpoint follow-up changes (#7826) 2023-09-01 15:18:48 +07:00
campaign_policy.rb feat: Add APIs for Campaigns (#2175) 2021-04-29 22:23:32 +05:30
category_policy.rb chore: Clean up report & knowledge base policies (#11234) 2025-04-03 16:00:32 -07:00
contact_policy.rb feat: Contact Exports (#7258) 2023-06-13 09:18:43 +05:30
conversation_policy.rb feat: Add conversation delete feature (#11677) 2025-06-05 15:53:17 -05:00
csat_survey_response_policy.rb fix: Allow users with report_manage permission to access CSAT reports (#11625) 2025-05-29 12:09:03 -06:00
custom_filter_policy.rb fix: set custom filter count in redis (#7164) 2023-06-19 16:10:03 +05:30
hook_policy.rb feat: Ability to improve drafts in the editor using GPT integration (#6957) 2023-04-24 23:52:23 +05:30
inbox_policy.rb feat: Add manual WhatsApp templates sync with UI (#12007) 2025-07-23 12:22:51 +04:00
label_policy.rb Feature: Improve label experience (#975) 2020-06-25 21:04:03 +05:30
macro_policy.rb feat: common attachment endpoint follow-up changes (#7826) 2023-09-01 15:18:48 +07:00
portal_policy.rb feat(cloud): Add support for viewing status of SSL in custom domains (#12011) 2025-07-30 10:52:47 -07:00
report_policy.rb chore: Clean up report & knowledge base policies (#11234) 2025-04-03 16:00:32 -07:00
team_member_policy.rb chore: Update method for team members (#1734) 2021-02-09 19:21:31 +05:30
team_policy.rb feat: Team APIs (#1654) 2021-01-17 23:56:56 +05:30
user_policy.rb feat: allow bulk invite create via email (#8853) 2024-02-06 09:04:04 +05:30
webhook_policy.rb Feature: Ability to switch between multiple accounts (#881) 2020-05-26 22:38:48 +05:30