Skip to content

Create Resource Methods in Controller and Service - #34

Merged
rayyanmridha merged 8 commits into
mainfrom
16-dev-create-resource-module-methods---create-method
Oct 6, 2026
Merged

rayyanmridha merged 8 commits into
mainfrom
16-dev-create-resource-module-methods---create-method

Conversation

@rayyanmridha

@rayyanmridha rayyanmridha commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

ℹ️ Issue

Closes #16

📝 Description

Made some create methods for the service and controller that makes a new resource. The Post endpoint in the controller calls upon the service methods to create the new DTO for resource that safeguard field types.

✔️ Verification

Rejection Test:
Screenshot 2026-10-04 at 9 18 33 PM

Success Test with SQL table in the background:
Screenshot 2026-10-04 at 9 17 58 PM

🏕️ (Optional) Future Work / Notes

There are some required fields such as the score, vetting status, and last verified date that I added placeholder values for when creating a resource.
@SamNie2027 confirm if these are fine for now and if we should change them in the future.

@rayyanmridha rayyanmridha linked an issue Oct 2, 2026 that may be closed by this pull request
7 tasks done
@SamNie2027

Copy link
Copy Markdown
Collaborator

@rayyanmridha yeah these defaults are fine; we still don't have specifics on scoring so whatever defaults we choose now are probably going to change anyway.

@rayyanmridha
rayyanmridha marked this pull request as ready for review October 5, 2026 01:35

@SamNie2027 SamNie2027 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Everything looks good. I just have that one comment about changing the default to 200 OK, I think it should be 201 created

* or 500 with a descriptive message if the resource can't be saved to the database.
*/
@Post()
@HttpCode(HttpStatus.OK)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Curious why you changed the default to 200 OK instead of 201 Created?

@rayyanmridha rayyanmridha Oct 5, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In the acceptance criteria it said creating a resource should return 200

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ah, then that is on me. I will do the change.

@SamNie2027

Copy link
Copy Markdown
Collaborator

Given you've requested Camila as a reviewer, I'm not sure if you would want Camila to review before merging so I am going to leave that up to you to merge

@rayyanmridha
rayyanmridha merged commit 95cce5f into main Oct 6, 2026
4 checks passed
@rayyanmridha
rayyanmridha deleted the 16-dev-create-resource-module-methods---create-method branch October 6, 2026 03:35
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.

[Dev] Create Resource Module methods - create method

2 participants