Skip to content

Conversation

@RaymondC-tech
Copy link

@RaymondC-tech RaymondC-tech commented Nov 24, 2025

Summary

Implements public-facing read-only API endpoints for the collection catalogue. Allows public users to browse and search collection items without authentication.

Related Issues

Changes

  • Added PublicCollectionItemSerializer with nested location data
  • Created PublicCollectionItemViewSet with filtering and search capabilities
  • Added URL routing for /api/public/items/ endpoints
  • Implemented filtering by platform and is_on_floor
  • Added text search across title, description, and item_code
  • Excluded items where is_public_visible=False
  • Added unit tests to API using Django's TestCase
  • Added documentation for api use

How to Test

  1. Start the backend server:sh
    cd backend
    source venv/bin/activate
  2. Run tests:
    pytest inventory/tests.py

Checklist

  • Public can view items and filter/search correctly
  • Hidden items never appear
  • Pagination and search work smoothly

Copy link
Contributor

@vivjd vivjd left a comment

Choose a reason for hiding this comment

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

Overall looks like a good start! In addition to the other comment, two other things I think would be great to have:

  • add copilot as a reviewer to see if there are any suggestions/fixes that are worth considering
  • The PR description mentions tests can be run with python manage.py test inventory.tests, but I don't seem to see those tests included in this PR. It would be great to add them so we have proper test coverage!

Copy link

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

This PR implements a public-facing, read-only REST API for browsing the collection catalogue without authentication. It addresses issue #8 by creating endpoints that allow public users to search, filter, and view collection items that are marked as publicly visible.

Key Changes:

  • Added public API endpoints at /api/public/items/ with comprehensive filtering (platform, is_on_floor) and text search capabilities
  • Implemented nested location serialization to include location details in collection item responses
  • Added extensive test coverage with 19 test cases covering various scenarios including filtering, search, pagination, and access control

Reviewed changes

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

Show a summary per file
File Description
backend/inventory/views.py Implements PublicCollectionItemViewSet with read-only access, custom filtering by platform and is_on_floor, and search functionality across title, description, and item_code
backend/inventory/serializers.py Adds PublicCollectionItemSerializer and LocationSerializer to expose appropriate fields for public consumption with nested location data
backend/inventory/urls.py Configures DRF router for public collection item endpoints
backend/core/urls.py Integrates inventory URLs into the main API routing
backend/inventory/tests.py Comprehensive test suite covering list/detail endpoints, filtering, search, authentication requirements, pagination, and edge cases
.github/workflows/backend-ci.yml Adds SECRET_KEY environment variable required for Django operations in CI

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

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.

Implement Public Read-Only Endpoints for Collection Catalog

3 participants