Skip to content

Feature/crud api#48

Merged
qiuethan merged 12 commits intomainfrom
feature/crud_api
Feb 10, 2026
Merged

Feature/crud api#48
qiuethan merged 12 commits intomainfrom
feature/crud_api

Conversation

@RaymondC-tech
Copy link
Contributor

@RaymondC-tech RaymondC-tech commented Feb 8, 2026

Closes #30

Description

POST + PUT + DELETE REST api completed with RBAC + soft delete + barcode uniqueness

Acceptance Criteria

  • New items created via API appear immediately in lists.
  • Archived items are hidden from the Public Catalogue but remain in the database for historical tracking.
  • Invalid data (e.g., missing title) is rejected.

Test

Running test with following command should yeild 100% with close to 100% test coverage:
cd backend
source venv/bin/activate
pytest inventory/tests.py -v

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Implements admin/volunteer CRUD endpoints for inventory items, including RBAC enforcement, soft-delete archival behavior, and barcode/UUID uniqueness validation, with accompanying tests for create/edit/delete flows.

Changes:

  • Added AdminCollectionItemViewSet (ModelViewSet) to support POST/PATCH/DELETE with role-based permissions and soft delete behavior.
  • Updated inventory routing to expose /api/inventory/items/ (admin/volunteer) alongside /api/inventory/public/items/ (public read-only).
  • Introduced a writable admin serializer with item_code uniqueness validation and added CRUD-focused tests.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
backend/inventory/views.py Adds admin/volunteer CRUD ViewSet and soft-delete implementation.
backend/inventory/urls.py Registers new admin routes and adjusts public route registration.
backend/inventory/serializers.py Adds writable serializer and explicit uniqueness validation message for item_code.
backend/inventory/tests.py Adds auth helpers/fixtures and tests for POST/PATCH/DELETE CRUD behavior.
.DS_Store Adds an OS-generated artifact file (should not be committed).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@qiuethan qiuethan merged commit 74d816a into main Feb 10, 2026
1 check passed
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.

Inventory CRUD API

3 participants