0xironclad / 0xironclad/Task-Scheduler-API

GET /tasks/upcoming

オープン 初心者向け
#31 コメント 0 件 リアクション 0 件 担当者 1 名 @0xironclad が担当を希望しています GitHub で見る
api good first issue
主要言語
TypeScript
スター
0
フォーク
2
PR マージ指標
30日以内にマージされた PR はありません

説明

Expose an endpoint that returns tasks scheduled to run soon, based on a future time window.

What to implement:

New route: GET /tasks/upcoming

Query params:

window (minutes, default 60)

limit, offset (optional)

Return tasks where:

status = 'pending' & run_at is between NOW() and NOW() + interval 'window minutes'

Order results by run_at ascending.

About the window parameter
window defines how far into the future to look.
Example:
GET /tasks/upcoming?window=30 , This returns pending tasks scheduled in the next 30 minutes.

DB logic:

Select tasks where:

status = 'pending'

run_at is between NOW() and NOW() + interval 'window minutes'

Order by run_at ascending

Expected result

A filtered, chronological array of upcoming tasks.

Empty array if nothing is scheduled in the window.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

コードベース内の既存のタスクルートを探します。おそらく routes/ または controllers/ ディレクトリにあります。新しい GET /tasks/upcoming エンドポイントをそこに追加し、記述されたフィルター(status='pending'、run_at がウィンドウ内)で tasks テーブルをクエリする必要があります。他のエンドポイントがクエリパラメータとデータベースクエリをどのように処理しているかを確認し、プロジェクトのパターンに従ってください。サーバーを実行し、異なる window 値でエンドポイントを呼び出してテストします。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
express, nodejs, postgresql, typescript
領域
api, backend
issue の種類
機能追加
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
70/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。