iachat/enterprise/app/models/enterprise
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 feat: Ability to delete account for administrators (#1874) 2025-04-03 10:41:39 +05:30
audit feat: Add conversation delete feature (#11677) 2025-06-05 15:53:17 -05:00
concerns feat: Add company model and API with tests (#12548) 2025-10-08 07:53:43 -07:00
account_user.rb feat: Add APIs to manage custom roles in Chatwoot (#9995) 2024-08-23 17:18:28 +05:30
account.rb feat: add saml model & controller [CW-2958] (#12289) 2025-09-03 13:30:42 -07:00
activity_message_handler.rb feat: Improve Captain interactions, activity messages (#11493) 2025-05-16 19:27:57 -07:00
application_record.rb feat: Add push/email notification support for SLA (#9140) 2024-03-29 20:27:21 +11:00
audit_log.rb chore: Refactor Response Bot Data Schema (#8011) 2023-10-01 19:31:38 -07:00
automation_rule.rb feat: sla-2 add automation backend support for SLA (#8775) 2024-02-01 15:42:12 +05:30
channelable.rb fix: skip auditlogs for whatsapp template sync (#8579) 2024-01-09 21:51:48 -08:00
conversation.rb feat(voice): Incoming voice calls [EE] (#12361) 2025-09-08 22:35:23 +05:30
inbox.rb fix: Add account_id to the query to force using a better index (#12420) 2025-09-11 22:27:38 -07:00