iachat/enterprise/app/models/enterprise/concerns
Vinay Keerthi 170ea7691f
feat: Add company model and API with tests (#12548)
# Pull Request Template

## Description

* add Company model with validations for name, domain, description and
  avatar
* Add database migration fo
* Implement endpoints for company CRUD operations
* Add optional company relationship for contacts
* Add test for models, controllers, factories and policies
* Add authorization policies restricting delete to admins
* support JSON API responses
Please include a summary of the change and issue(s) fixed. Also, mention
relevant motivation, context, and any dependencies that this change
requires.

Fixes #(cw-5650)

## Type of change

Please delete options that are not relevant.

- [x] 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?

Tests are implemented using `RSpec`

```
$ bundle exec rails db:migrate
$ bundle exec rspec spec/models/company_spec.rb spec/controllers/api/v1/accounts/companies_controller_spec.rb
```

## Checklist:

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my code
- [x] I have commented on my code, particularly in hard-to-understand
areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] 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
2025-10-08 07:53:43 -07:00
..
account_user.rb feat: Add agent capacity controllers (#12200) 2025-08-26 19:12:58 -07:00
account.rb feat: Add company model and API with tests (#12548) 2025-10-08 07:53:43 -07:00
article.rb feat: use captain endpoint config in legacy OpenAI base service (#12060) 2025-07-30 08:58:27 +04:00
assignment_policy.rb feat: Add assignment policies controllers with jbuilder views (#12199) 2025-08-18 19:15:21 -07:00
attachment.rb feat(ee): Add transcription support for audio messages (#11670) 2025-06-05 18:29:37 -05:00
contact.rb feat: Add company model and API with tests (#12548) 2025-10-08 07:53:43 -07:00
conversation.rb feat: Add support for the references in FAQs (#10699) 2025-01-16 15:27:30 +05:30
inbox.rb feat(ee): Add Captain features (#10665) 2025-01-14 16:15:47 -08:00
portal.rb chore: Automate SSL with Cloudflare (#12021) 2025-07-24 13:09:06 +04:00
user.rb feat: Add support for more tool, standardize copilot chat service (#11560) 2025-05-23 01:07:07 -07:00