Prevent created time update on non-scheduled posts #2542
Ticket(s) / Related Merge Requests
Summary of Changes
Fix such that created timestamp will only be acknowledged and updated if the post is a scheduled post - as requested in stand-up this will be a soft failure that doesn't throw an exception back, and instead just disregards the badly requested timestamp.
Testing Considerations
Normal Post
Make a normal post, ensure the time is set properly, ensure you can edit and the time is still set properly.
Trying to change that posts timestamp should fail
Change it to a timestamp within the next 3 months as more than that is unschedulable. (I recommend doing this by editing the network requests and grabbing a future data from https://www.epochconverter.com/)
It should also fail if you try to update more than 3 months in the future but this is a hard fail and exception thrown back, as is it currently in prod - beyond changing the kind of exception thrown back from a 500 to a more appropriate 400 this logic has not changed.
Scheduled post
You should be able to update a posts scheduled time as normal.
Deployment Considerations
Standard deployment.
Regression Scope
Scheduled entity times and posting.
Platform Affected (web, mobile, etc)
Engine.
Developer Testing Completed
Manual, unit.
Screenshots / Screen Recording
simplescreenrecorder-2023-04-20_09.53.33
simplescreenrecorder-2023-04-20_09.42.30
Definition of Done Checklist
-
The Acceptance Criteria has been met -
Code is tested: Testing includes unit/spec, E2E/automated and manual testing -
Merge requests description has been filled out