Skip to content
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

feat: use plan phase duration and index instead of start after #1996

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tothandras
Copy link
Contributor

@tothandras tothandras commented Dec 28, 2024

  • update API and DB to use duration + index instead of startAfter for plan phases
  • remove unused next plan operation
  • remove phase level API endpoints
  • remove phase level internal operations

TODO:

  • remove commented out code
  • fix tests

@tothandras tothandras added the release-note/feature Release note: Exciting New Features label Dec 28, 2024
@@ -83,6 +83,8 @@ func (PlanPhase) Fields() []ent.Field {
field.String("plan_id").
NotEmpty().
Comment("The plan identifier the phase is assigned to."),
field.Int("index").
Copy link
Contributor

Choose a reason for hiding this comment

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

uint8

var (
_ models.Validator = (*PlanMeta)(nil)
_ models.Equaler[PlanMeta] = (*PlanMeta)(nil)
)

type PlanMeta struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this called PlanMeta? Is this the internal model of Plan?

type NextPlanInput struct {
// NamespacedID
models.NamespacedID
// type NextPlanInput struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

why commented out?

Copy link
Contributor

Choose a reason for hiding this comment

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

The functionality provided by NextPlan API is also available via CreatePlan API. The only difference is that the former allows creating a new version with optinal plan payload while the latter requires a plan to be sent as part of the request. But I tend to agree that it does not worth to keep/maintain 2 API endpoints for the same operation.

@tothandras
Copy link
Contributor Author

tothandras commented Dec 29, 2024

I'm splitting this PR into multiple commits:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/feature Release note: Exciting New Features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants