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

Category field added in obligation (get, post, patch) #84

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

Conversation

bhowmik94
Copy link

@bhowmik94 bhowmik94 commented Oct 9, 2024

Changes

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

@GMishx
Copy link
Member

GMishx commented Oct 15, 2024

@bhowmik94 you need to commit the updated doc files after the swag init and swag fmt

@bhowmik94 bhowmik94 force-pushed the feat/api/new-categoryField-obligation branch from 8a73421 to f63fa1e Compare October 17, 2024 12:59
@GMishx
Copy link
Member

GMishx commented Oct 18, 2024

@bhowmik94 make sure to update the PR description when you are creating one.

@GMishx
Copy link
Member

GMishx commented Oct 18, 2024

Tried adding category to an existing obligation and it failed.

curl -X 'PATCH' \
  'http://localhost:8085/api/v1/obligations/my%20obligation' \
  -H 'accept: application/json' \
  -H 'Authorization: my.token' \
  -H 'Content-Type: application/json' \
  -d '{
"category": "Distribute"
}'

The response is 200

{
  "status": 200,
  "data": [
    {
      "id": 1,
      "topic": "",
      "type": "",
      "text": "",
      "classification": "",
      "modifications": false,
      "comment": "",
      "active": false,
      "text_updatable": false,
      "category": ""
    }
  ],
  "paginationmeta": {
    "resource_count": 1
  }
}

@bhowmik94
Copy link
Author

@GMishx Kindly try the update request now.

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.

Please check the category value against the allowed values from the enums:"Distribution,Patent,Internal,Contractual,Export Control,General". Currently I can put any values in the field with a PATCH or a POST request.

Also, the export and import endpoints do not reflect this new field. Please fix it as well.

And please update the PR description!

@bhowmik94 bhowmik94 force-pushed the feat/api/new-categoryField-obligation branch from 65d5aaf to d41efe9 Compare October 30, 2024 09:36
cmd/laas/docs/docs.go Outdated Show resolved Hide resolved
cmd/laas/docs/docs.go Outdated Show resolved Hide resolved
cmd/laas/docs/docs.go Outdated Show resolved Hide resolved
cmd/laas/docs/docs.go Outdated Show resolved Hide resolved
@bhowmik94 bhowmik94 force-pushed the feat/api/new-categoryField-obligation branch 3 times, most recently from 848453f to 0f2da9e Compare November 7, 2024 14:17
Signed-off-by: deo002 <[email protected]>

refactor(obligations): Make separate database tables for classification and type

chore(deps): bump github.com/golang-jwt/jwt/v4 in the go_modules group

Bumps the go_modules group with 1 update: [github.com/golang-jwt/jwt/v4](https://github.com/golang-jwt/jwt).

Updates `github.com/golang-jwt/jwt/v4` from 4.5.0 to 4.5.1
- [Release notes](https://github.com/golang-jwt/jwt/releases)
- [Changelog](https://github.com/golang-jwt/jwt/blob/main/VERSION_HISTORY.md)
- [Commits](golang-jwt/jwt@v4.5.0...v4.5.1)

---
updated-dependencies:
- dependency-name: github.com/golang-jwt/jwt/v4
  dependency-type: direct:production
  dependency-group: go_modules
...

Signed-off-by: dependabot[bot] <[email protected]>

feat(obligation): category field added in obligation get, post, patch

fix: obligation POST, PATCH fixed for category

fix: resolve merge conflict

feat: added staged changes for category
@bhowmik94 bhowmik94 force-pushed the feat/api/new-categoryField-obligation branch from 0f2da9e to 83ed38e Compare November 12, 2024 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New field "Category" in obligations GET, PUT, POST
3 participants