Add list_campaigns_ended_between/2 to query campaigns by end time#484
Draft
Add list_campaigns_ended_between/2 to query campaigns by end time#484
Conversation
#476 This function enables finding campaigns whose delivery window ended within a specified time range. It's designed to support a scheduled job that runs every 15 minutes to process recently ended campaigns. The function: - Accepts from_datetime and to_datetime as NaiveDateTime - Uses inclusive bounds (>= and <=) for the time window - Returns a list of Campaign structs without preloads Test coverage includes: - Finding campaigns within the specified window - Returning empty list when no campaigns match
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Use a consistent timestamp across setup and tests instead of calling NaiveDateTime.utc_now() multiple times
mveytsman
reviewed
Mar 31, 2026
| - `from_datetime` - Start of the time window (inclusive) | ||
| - `to_datetime` - End of the time window (inclusive) | ||
| """ | ||
| def list_campaigns_ended_between(from_utc_datetime, to_utc_datetime) do |
Member
There was a problem hiding this comment.
i think the params should be from_datetime and to_datetime like in the docs above
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#476
Describe your changes
This function enables finding campaigns whose delivery window ended within a specified time range. It's designed to support a scheduled job that runs every 15 minutes to process recently ended campaigns.
The function:
Test coverage includes:
Checklist before requesting a review
about this update in the description above.