oncall-engine/engine/common/api_helpers
Joey Orlando 2576954b51
add shifts property to shift swap request response schema + finalize slack message layout (#2712)
# What this PR does

- drop `GET /api/internal/v1/shift_swaps/<id>/shifts` endpoint in favour
of adding a `shifts` property to the response schema for all shift swap
endpoints (expect `GET /api/internal/v1/shift_swaps` (ie. list all))
- Update the Slack message layout:

<img width="590" alt="Screenshot 2023-08-01 at 17 28 44"
src="https://github.com/grafana/oncall/assets/9406895/84a51614-5dd6-48ec-ae81-fef4bc32fec9">

**Note**: about the highlighted lines. This is a small issue w/ the
`ShiftSwapRequest.shifts` method. @matiasb is already helping out here 🙏

**Other stuff**
- adds some type hints related to the code I was working around with
- slightly refactor `apps.slack.utils.format_datetime_to_slack` to make
it more generic for the use case in this PR

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
2023-08-01 14:21:02 -04:00
..
__init__.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
custom_fields.py shift swap requests model + CRUD endpoints (#2597) 2023-07-21 19:35:19 +00:00
custom_rate_scoped_throttler.py Add ratelimit for phone number verification (#1354) 2023-02-21 16:47:52 +08:00
exceptions.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
filters.py Teams redesign (#1528) 2023-03-22 00:57:20 +08:00
mixins.py add shifts property to shift swap request response schema + finalize slack message layout (#2712) 2023-08-01 14:21:02 -04:00
optional_slash_router.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
paginators.py augment API response pagination attributes (#2471) 2023-07-14 11:19:40 -04:00
serializers.py Make viewset actions more consistent (#2120) 2023-06-07 12:10:53 +00:00
utils.py Add filter_shift_swaps endpoint to schedules API (#2684) 2023-07-31 11:41:37 +00:00