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(obligation_classifications): Add admin apis for creating, listing and deleting obligation classifications #92

Merged
merged 1 commit into from
Nov 8, 2024

Conversation

deo002
Copy link
Collaborator

@deo002 deo002 commented Nov 8, 2024

Changes

  • Added admin APIs to create, delete and get a list of obligation classifications.
  • POST /obligations/classifications: Creates a new obligation classification if not already present. It must be non-empty and uppercase. If the obligation classifications to be created is already in db with 'active' flag set to false, it is changed to true.
  • DELETE /obligation/classifications/{classification}: The {classification} is soft-deleted if it exists in db, has 'active' flag set to true and no obligation references it.
  • GET /obligations/classifications: Fetches a list of all obligation classifications. Flag 'active' can be set to false to fetch the inactive classifications.
    During obligation creation and updation, associate them with only active obligations.

Submitter Checklist

  • Includes tests (if there is a feature changed/added)
  • Includes docs ( if changes are user facing)
  • I have tested my changes locally.

References

Copy link
Member

@GMishx GMishx left a comment

Choose a reason for hiding this comment

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

Minor doc change needed.

// @Tags Obligations
// @Accept json
// @Produce json
// @Param active query bool true "Active obligation only"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// @Param active query bool true "Active obligation only"
// @Param active query bool true "Active obligation classifications only"

@GMishx
Copy link
Member

GMishx commented Nov 8, 2024

The current JSON response is not in camelCase as with other endpoints. But for POST it is in camelCase.

image

…g and deleting obligation classifications

Signed-off-by: deo002 <[email protected]>
Copy link
Member

@GMishx GMishx left a comment

Choose a reason for hiding this comment

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

Tested, working as expected.

@GMishx GMishx merged commit d3058ba into fossology:main Nov 8, 2024
7 checks passed
@GMishx GMishx deleted the feat/admin_obligations_1 branch November 8, 2024 06:31
@GMishx GMishx restored the feat/admin_obligations_1 branch November 8, 2024 06:31
@GMishx GMishx deleted the feat/admin_obligations_1 branch November 8, 2024 06:31
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.

2 participants