feat: Implement Collection model with translations and partner relationships (#211)

Commit: 8113c6479e8214229f9891f26c4464c45a0b7ffa
Date: 2025-07-09 17:44:08 +0200
Author: PascalHavelange

Commit Message

feat: Implement Collection model with translations and partner relationships (#211)

* Publishing "@metanull/inventory-app-api-client" version "1.1.3-dev.0709.1520"

* Fix issue of duplicated github action

* # feat: Implement Collection model with full CRUD API and translation support

## Summary
Implement the Collection model as the first type of collection for organizing museum items, with comprehensive translation support, partner relationships, and full REST API endpoints.

## Features Added
- **Collection Model**: Core model with UUID primary key and relationships
- **Translation Support**: CollectionTranslation model following existing pattern
- **Partner Integration**: Many-to-many relationships with PartnerLevel enum
- **Item Relationships**: Added collection_id foreign key to items table
- **REST API**: Full CRUD endpoints with proper validation and resources
- **Database Schema**: 4 new migrations for collections, translations, and relationships

## Models & Database
- `Collection` model with HasUuids trait and relationships
- `CollectionTranslation` model for internationalization
- `CollectionPartner` pivot model with PartnerLevel enum
- `PartnerLevel` enum (PARTNER, ASSOCIATED_PARTNER, MINOR_CONTRIBUTOR)
- Migrations for collections, collection_translations, collection_partner tables
- Added collection_id column to items table

## API Endpoints
- `GET /api/collection` - List all collections with relationships
- `GET /api/collection/{id}` - Show specific collection
- `POST /api/collection` - Create new collection
- `PUT /api/collection/{id}` - Update existing collection
- `DELETE /api/collection/{id}` - Delete collection
- Proper validation, eager loading, and resource responses

## Testing & Quality
- Comprehensive unit tests for factories
- Full feature test suite (Anonymous, Index, Show, Store, Update, Destroy)
- All tests passing (1098 tests, 4544 assertions)
- PSR-12 compliant code (Pint linting passed)
- Laravel 12 best practices followed

## Technical Details
- Follows existing translation pattern without HasTranslations trait
- Consistent with app's hard delete approach (no soft deletes)
- UUID support with proper relationships
- Enum-based partner contribution levels
- Factory and seeder integration

Closes #[issue-number] if applicable

* # docs: Update documentation for Collection API and fix client link issues

## Documentation Updates
- **README.md**: Added Collection model documentation with features and API endpoints
- **API Client Documentation**: Updated to @metanull/inventory-app-api-client@1.1.5-dev.709.1730
- **Client Link Fix**: Removed trailing slashes from API client documentation URLs
- **Test Statistics**: Updated test count to 1098+ tests with 4544+ assertions

## Collection Documentation Added
- Collection model in Core Business Models section
- Collection API endpoints in Custom Endpoints section
- Translation support and partner relationship features
- UUID primary key and relationship documentation

## Bug Fixes
- **Fixed broken links**: Removed trailing "/" from client documentation URLs
  - Before: `/api-client/availableimageresource/` (404 error)
  - After: `/api-client/availableimageresource` (working)
- Updated Jekyll URL generation in `docs/generate-client-docs.py`

## Technical Changes
- Generated 166 Jekyll pages for API client documentation
- Included Collection API documentation (CollectionApi, CollectionResource, etc.)
- Updated package version references

---------

Co-authored-by: Pascal HAVELANGE <havelangep@hotmail.com>

Files Changed


This documentation was automatically generated from Git commit data.