Skip to content

Add list_campaigns_ended_between/2 to query campaigns by end time#484

Draft
neal-bpm wants to merge 2 commits intomainfrom
vn/campaign-end-time-query
Draft

Add list_campaigns_ended_between/2 to query campaigns by end time#484
neal-bpm wants to merge 2 commits intomainfrom
vn/campaign-end-time-query

Conversation

@neal-bpm
Copy link
Copy Markdown
Contributor

#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:

  • 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

Checklist before requesting a review

  • I have performed a self-review of my code
  • If it is a core feature, I have added tests.
  • Are there other PRs or Issues that I should link to here?
  • Will this be part of a product update? If yes, please write one phrase
    about this update in the description above.

#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
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 29, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d7a3fb48-b48c-41dd-b368-0c239aa3575d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch vn/campaign-end-time-query

Comment @coderabbitai help to get the list of available commands and usage tips.

@neal-bpm neal-bpm self-assigned this Mar 29, 2026
  Use a consistent timestamp across setup and tests instead of calling NaiveDateTime.utc_now() multiple times
- `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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think the params should be from_datetime and to_datetime like in the docs above

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the changes in the PR: #486

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants