-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SDBELGA-758] Feature: Support creating Planning series with Event se…
…ries (#1884)
- Loading branch information
1 parent
5501f4c
commit c8aa073
Showing
7 changed files
with
288 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,159 @@ | ||
Feature: Recurring Events & Planning | ||
Background: Initial setup | ||
When we post to "/events" | ||
""" | ||
[{ | ||
"name": "Daily Club", | ||
"dates": { | ||
"start": "2024-11-21T12:00:00.000Z", | ||
"end": "2024-11-21T14:00:00.000Z", | ||
"tz": "Australia/Sydney", | ||
"recurring_rule": { | ||
"frequency": "DAILY", | ||
"interval": 1, | ||
"count": 3, | ||
"endRepeatMode": "count" | ||
} | ||
} | ||
}] | ||
""" | ||
Then we get OK response | ||
Then we store "EVENT1" with first item | ||
Then we store "EVENT2" with 2 item | ||
Then we store "EVENT3" with 3 item | ||
When we get "/events" | ||
Then we get list with 3 items | ||
""" | ||
{"_items": [{ | ||
"_id": "#EVENT1._id#", | ||
"recurrence_id": "#EVENT1.recurrence_id#", | ||
"name": "Daily Club", | ||
"dates": {"start": "2024-11-21T12:00:00+0000", "end": "2024-11-21T14:00:00+0000"} | ||
}, { | ||
"_id": "#EVENT2._id#", | ||
"recurrence_id": "#EVENT1.recurrence_id#", | ||
"name": "Daily Club", | ||
"dates": {"start": "2024-11-22T12:00:00+0000", "end": "2024-11-22T14:00:00+0000"} | ||
}, { | ||
"_id": "#EVENT3._id#", | ||
"recurrence_id": "#EVENT1.recurrence_id#", | ||
"name": "Daily Club", | ||
"dates": {"start": "2024-11-23T12:00:00+0000", "end": "2024-11-23T14:00:00+0000"} | ||
}]} | ||
""" | ||
|
||
@auth | ||
Scenario: Creates single plan for event series by default | ||
When we post to "/planning" | ||
""" | ||
[{ | ||
"headline": "test headline", | ||
"event_item": "#EVENT1._id#", | ||
"planning_date": "2024-11-21T12:00:00.000Z", | ||
"coverages": [{ | ||
"workflow_status": "draft", | ||
"news_coverage_status": {"qcode": "ncostat:int"}, | ||
"planning": { | ||
"headline": "test headline", | ||
"slugline": "test slugline", | ||
"g2_content_type": "text", | ||
"scheduled": "2024-11-21T15:00:00.000Z" | ||
} | ||
}, { | ||
"workflow_status": "draft", | ||
"news_coverage_status": {"qcode": "ncostat:int"}, | ||
"planning": { | ||
"headline": "test headline", | ||
"slugline": "test slugline", | ||
"g2_content_type": "picture", | ||
"scheduled": "2024-11-21T16:00:00.000Z" | ||
} | ||
}] | ||
}] | ||
""" | ||
Then we get OK response | ||
When we get "/planning" | ||
Then we get list with 1 items | ||
""" | ||
{"_items": [{ | ||
"guid": "__any_value__", | ||
"type": "planning", | ||
"headline": "test headline", | ||
"planning_date": "2024-11-21T12:00:00+0000", | ||
"event_item": "#EVENT1._id#", | ||
"recurrence_id": "#EVENT1.recurrence_id#", | ||
"coverages": [ | ||
{"planning": {"g2_content_type": "text", "scheduled": "2024-11-21T15:00:00+0000"}}, | ||
{"planning": {"g2_content_type": "picture", "scheduled": "2024-11-21T16:00:00+0000"}} | ||
] | ||
}]} | ||
""" | ||
|
||
@auth | ||
Scenario: Create planning for each event in the series | ||
When we post to "/planning?add_to_series=true" | ||
""" | ||
[{ | ||
"headline": "test headline", | ||
"event_item": "#EVENT1._id#", | ||
"planning_date": "2024-11-21T12:00:00.000Z", | ||
"coverages": [{ | ||
"workflow_status": "draft", | ||
"news_coverage_status": {"qcode": "ncostat:int"}, | ||
"planning": { | ||
"headline": "test headline", | ||
"slugline": "test slugline", | ||
"g2_content_type": "text", | ||
"scheduled": "2024-11-21T15:00:00.000Z" | ||
} | ||
}, { | ||
"workflow_status": "draft", | ||
"news_coverage_status": {"qcode": "ncostat:int"}, | ||
"planning": { | ||
"headline": "test headline", | ||
"slugline": "test slugline", | ||
"g2_content_type": "picture", | ||
"scheduled": "2024-11-21T16:00:00.000Z" | ||
} | ||
}] | ||
}] | ||
""" | ||
Then we get OK response | ||
When we get "/planning" | ||
Then we get list with 3 items | ||
""" | ||
{"_items": [{ | ||
"guid": "__any_value__", | ||
"type": "planning", | ||
"headline": "test headline", | ||
"planning_date": "2024-11-21T12:00:00+0000", | ||
"event_item": "#EVENT1._id#", | ||
"recurrence_id": "#EVENT1.recurrence_id#", | ||
"coverages": [ | ||
{"planning": {"g2_content_type": "text", "scheduled": "2024-11-21T15:00:00+0000"}}, | ||
{"planning": {"g2_content_type": "picture", "scheduled": "2024-11-21T16:00:00+0000"}} | ||
] | ||
}, { | ||
"guid": "__any_value__", | ||
"type": "planning", | ||
"headline": "test headline", | ||
"planning_date": "2024-11-22T12:00:00+0000", | ||
"event_item": "#EVENT2._id#", | ||
"recurrence_id": "#EVENT1.recurrence_id#", | ||
"coverages": [ | ||
{"planning": {"g2_content_type": "text", "scheduled": "2024-11-22T15:00:00+0000"}}, | ||
{"planning": {"g2_content_type": "picture", "scheduled": "2024-11-22T16:00:00+0000"}} | ||
] | ||
}, { | ||
"guid": "__any_value__", | ||
"type": "planning", | ||
"headline": "test headline", | ||
"planning_date": "2024-11-23T12:00:00+0000", | ||
"event_item": "#EVENT3._id#", | ||
"recurrence_id": "#EVENT1.recurrence_id#", | ||
"coverages": [ | ||
{"planning": {"g2_content_type": "text", "scheduled": "2024-11-23T15:00:00+0000"}}, | ||
{"planning": {"g2_content_type": "picture", "scheduled": "2024-11-23T16:00:00+0000"}} | ||
] | ||
}]} | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.