oncall-engine/engine/apps/user_management/tests
Innokentii Konstantinov 1f786e8d2a
Phone provider refactoring (#1713)
# What this PR does
This PR moves phone notification logic into separate object PhoneBackend
and introduces PhoneProvider interface to hide actual implementation of
external phone services provider. It should allow add new phone
providers just by implementing one class (See SimplePhoneProvider for
example).
# Why 
[Asterisk PR](https://github.com/grafana/oncall/pull/1282) showed that
our phone notification system is not flexible. However this is one of
the most frequent community questions - how to add "X" phone provider.
Also, this refactoring move us one step closer to unifying all
notification backends, since with PhoneBackend all phone notification
logic is collected in one place and independent from concrete
realisation.
# Highligts
1. PhoneBackend object - contains all phone notifications business
logic.
2. PhoneProvider - interface to  external phone services provider.
3. TwilioPhoneProvider and SimplePhoneProvider - two examples of
PhoneProvider implementation.
4. PhoneCallRecord and SMSRecord models. I introduced these models to
keep phone notification limits logic decoupled from external providers.
Existing TwilioPhoneCall and TwilioSMS objects will be migrated to the
new table to not to reset limits counter. To be able to receive status
callbacks and gather from Twilio TwilioPhoneCall and TwilioSMS still
exists, but they are linked to PhoneCallRecord and SMSRecord via fk, to
not to leat twilio logic into core code.

---------

Co-authored-by: Yulia Shanyrova <yulia.shanyrova@grafana.com>
2023-05-24 06:27:48 +00:00
..
__init__.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
factories.py Add tests 2022-10-27 15:40:46 -06:00
test_free_public_beta_subcription_strategy.py Phone provider refactoring (#1713) 2023-05-24 06:27:48 +00:00
test_organization.py Phone provider refactoring (#1713) 2023-05-24 06:27:48 +00:00
test_region.py Org soft-delete (#1073) 2023-01-05 12:42:55 +08:00
test_sync.py Fix organizations not being deleted by start_cleanup_deleted_organizations (#1950) 2023-05-17 12:56:57 +00:00
test_user.py Add RBAC Support (#777) 2022-11-29 09:41:56 +01:00