oncall-engine/engine/apps/api/serializers
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.py add several new database columns + emit two new Django signals (#1522) 2023-04-14 09:15:57 +02:00
alert_group.py add channel__team to internal api serializer select_related (#1805) 2023-04-20 18:30:49 +02:00
alert_receive_channel.py Allow null for short description in integrations api (#1952) 2023-05-17 18:43:01 +08:00
alerts_field_cache_buster_mixin.py add several new database columns + emit two new Django signals (#1522) 2023-04-14 09:15:57 +02: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 use CustomURLValidator in custom_button (#1398) 2023-03-23 12:21:17 +00:00
custom_serializers.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
escalation_chain.py Add alert group filter by escalation chain (#1535) 2023-03-14 14:38:18 +00:00
escalation_policy.py Add escalation chain support for new webhooks (#1654) 2023-04-05 12:03:55 +00:00
integration_heartbeat.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
live_setting.py Allow no-auth SMTP connection for email notifications (#759) 2022-11-03 16:18:37 +00:00
on_call_shifts.py Update shift API to use a default for interval when missing (#1810) 2023-04-21 19:13:09 +00:00
organization.py Phone provider refactoring (#1713) 2023-05-24 06:27:48 +00:00
organization_slack_settings.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
paging.py Teams redesign (#1528) 2023-03-22 00:57:20 +08:00
public_api_token.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
resolution_note.py Optimize alert group list view (#299) 2022-07-27 14:14:59 +03:00
schedule_base.py Add support for web overrides to Terraform schedules (#1222) 2023-03-10 16:21:50 +00:00
schedule_calendar.py Add support for web overrides to Terraform schedules (#1222) 2023-03-10 16:21:50 +00:00
schedule_ical.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
schedule_polymorphic.py Add select_related to fetch schedules user group information (#1109) 2023-01-09 13:15:27 -03:00
schedule_reminder.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
schedule_web.py Add support for web overrides to Terraform schedules (#1222) 2023-03-10 16:21:50 +00:00
slack_channel.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
slack_user_identity.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
team.py Teams redesign (#1528) 2023-03-22 00:57:20 +08:00
telegram.py World, meet OnCall! 2022-06-03 08:09:47 -06: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 World, meet OnCall! 2022-06-03 08:09:47 -06:00
webhook.py Add is_legacy column to handle webhook migration (#1813) 2023-04-25 11:22:56 -03:00