Skip to content

Conversation

@krtkvrm
Copy link
Member

@krtkvrm krtkvrm commented Nov 1, 2021

  • Organization API
    • Create
    • List
    • Get
    • Update
  • PG schema Migrations & Rollbacks
  • Refactor Org Service, to remove redundant *Organization
  • Remove version column in org table
  • Apply PR Reviews

@krtkvrm krtkvrm requested review from AkarshSatija and rsbh November 11, 2021 10:11
@krtkvrm
Copy link
Member Author

krtkvrm commented Nov 11, 2021

The scope of this PR is also to refactor Org Service.
from:

type OrganizationService interface {
	GetOrganization(ctx context.Context, id string) (org.Organization, error)
	CreateOrganization(ctx context.Context, org org.Organization) (org.Organization, error)
	ListOrganizations(ctx context.Context) ([]org.Organization, error)
	UpdateOrganization(ctx context.Context, toUpdate org.Organization) (org.Organization, error)
}

To:

type OrganizationService interface {
	Get(ctx context.Context, id string) (modelv1.Organization, error)
	Create(ctx context.Context, org modelv1.Organization) (modelv1.Organization, error)
	List(ctx context.Context) ([]modelv1.Organization, error)
	Update(ctx context.Context, toUpdate modelv1.Organization) (modelv1.Organization, error)
}

CreateOrganization(ctx context.Context, org org.Organization) (org.Organization, error)
ListOrganizations(ctx context.Context) ([]org.Organization, error)
UpdateOrganization(ctx context.Context, toUpdate org.Organization) (org.Organization, error)
GetOrganization(ctx context.Context, id string) (modelv1.Organization, error)
Copy link
Member

Choose a reason for hiding this comment

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

@krtkvrm I think we don't need to version internal models. So would suggest removing versioning from here.

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah.. makes sense 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@krtkvrm krtkvrm merged commit fdf1f46 into main Nov 14, 2021
@krtkvrm krtkvrm deleted the feat-project-api branch November 14, 2021 15:36
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