oncall-engine/engine/apps/api/views
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
alert_group.py Add filter descriptions (#1845) 2023-05-02 13:50:03 +08:00
alert_receive_channel.py Add pagination to integrations page (#1872) 2023-05-04 13:48:46 +08:00
alert_receive_channel_template.py Fix resource duplication caused by available_teams_lookup_args (#1593) 2023-03-22 15:43:32 +08:00
alerts.py Add alert detail view (#385) 2022-08-19 14:03:07 +05:00
auth.py Add SLACK_INTEGRATION_MAINTENANCE env var (#1582) 2023-03-21 08:15:35 +00:00
channel_filter.py Added preview and migration API endpoints for route migration from regex into jinja2 (#1715) 2023-04-18 02:53:53 +00:00
custom_button.py Fix MultipleObjectsReturned error on webhook endpoints (#1996) 2023-05-23 16:23:06 +00:00
escalation_chain.py Allow changing team for escalation chains (#1658) 2023-03-30 10:43:00 +01:00
escalation_policy.py Add escalation chain support for new webhooks (#1654) 2023-04-05 12:03:55 +00:00
features.py Mobile push dynamic setting (#1967) 2023-05-18 19:45:31 +08:00
gitops.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
integration_heartbeat.py Fix resource duplication caused by available_teams_lookup_args (#1593) 2023-03-22 15:43:32 +08:00
live_setting.py Add RBAC Support (#777) 2022-11-29 09:41:56 +01:00
maintenance.py Fix teams filter related issue setting maintenance mode (#1885) 2023-05-05 18:09:25 +00:00
on_call_shifts.py Fix resource duplication caused by available_teams_lookup_args (#1593) 2023-03-22 15:43:32 +08:00
organization.py Introduce org uuid (#947) 2022-12-06 22:42:58 +08:00
paging.py Teams redesign (#1528) 2023-03-22 00:57:20 +08:00
preview_template_options.py Fix of templates api behaviour for public and private api (#1408) 2023-03-01 16:32:15 +08:00
public_api_tokens.py Add RBAC Support (#777) 2022-11-29 09:41:56 +01:00
resolution_note.py Fix resource duplication caused by available_teams_lookup_args (#1593) 2023-03-22 15:43:32 +08:00
route_regex_debugger.py Optimize alert group list view (#299) 2022-07-27 14:14:59 +03:00
schedule.py Rework schedule related users, add endpoint (#1828) 2023-04-26 20:46:51 +00:00
slack_channel.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
slack_team_settings.py Add RBAC Support (#777) 2022-11-29 09:41:56 +01:00
subscription.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
team.py Fix team update (#1794) 2023-04-19 15:22:14 +00:00
telegram_channels.py Fix insight_logs exceptions (#1757) 2023-04-17 07:16:18 +00:00
test_insight_logs.py Fix propagation for the insight logger 2022-07-25 12:59:12 +04:00
user.py Phone provider refactoring (#1713) 2023-05-24 06:27:48 +00:00
user_group.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
user_notification_policy.py Add mobile app auth for notification_policies endpoint (#1725) 2023-04-11 16:36:46 +00:00
webhooks.py Fix MultipleObjectsReturned error on webhook endpoints (#1996) 2023-05-23 16:23:06 +00:00