Skip to content

feat(stories): Add published_at_gt and other date related query parameters #65

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

frastel
Copy link

@frastel frastel commented Jul 24, 2025

Adds support for these query parameters:

  • published_at_gt
  • published_at_lt
  • first_published_at_gt
  • first_published_at_lt
  • updated_at_gt
  • updated_at_lt

More about this topic in the issue: #64


namespace Storyblok\Api\Domain\Value\QueryParameter;

final readonly class FirstPublishedAtQueryParameter extends DateQueryParameter
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
final readonly class FirstPublishedAtQueryParameter extends DateQueryParameter
final readonly class FirstPublishedAt

Copy link
Author

@frastel frastel Jul 25, 2025

Choose a reason for hiding this comment

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

I am using FirstPublishedAtGt... now. I would prefer new FirstPublishedAtGt rather than new FirstPublishedAt($dateTime, '<some enum>');

Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not passing an argument which is an enum? Such as

new FirstPublishedAt(direction: Direction::LT)

Copy link
Author

@frastel frastel Jul 30, 2025

Choose a reason for hiding this comment

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

Because the query parameter is named like this "first_published_at_gt" or "first_published_at_lt". I think it is more intuitive for the developer to use a value object that is directly named like the query parameter itself.
In this case it is not like in the sort_by parameter where the direction is used as value for some field.

@codecov-commenter
Copy link

codecov-commenter commented Jul 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.91%. Comparing base (006cdab) to head (13148c8).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master      #65      +/-   ##
============================================
+ Coverage     93.88%   93.91%   +0.02%     
- Complexity      461      488      +27     
============================================
  Files            72       79       +7     
  Lines          1620     1675      +55     
============================================
+ Hits           1521     1573      +52     
- Misses           99      102       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@OskarStark OskarStark changed the title feat(stories): Add published_at_gt and other date related query parameters (#64) feat(stories): Add published_at_gt and other date related query parameters Jul 30, 2025
@frastel
Copy link
Author

frastel commented Aug 1, 2025

Any further feedback?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants