feat: complete Item and Detail internationalization with comprehensive documentation (#196)

Commit: f7988f0deabf226158e88137b1562de6562a46fc
Date: 2025-07-06 18:33:08 +0200
Author: PascalHavelange

Commit Message

feat: complete Item and Detail internationalization with comprehensive documentation (#196)

* ### Removed

- **Contextualization and Internationalization Models**: Removed complex contextualization system deemed too complex for current requirements (July 6, 2025)
    - **Contextualization Model**: Removed model, controller, resource, factory, seeder, and all related tests
    - **Internationalization Model**: Removed model, controller, resource, factory, seeder, and all related tests
    - **Database Tables**: Added migrations to drop `contextualizations` and `internationalizations` tables
    - **API Endpoints**: Removed all contextualization and internationalization API routes
    - **Model Relationships**: Cleaned up relationships in Item, Detail, Context, and Author models
    - **Documentation**: Updated API documentation and field documentation

* Migrate from Language pivot pattern to Translation models

- Replace *Language pivot tables with *Translation models for Contact, Location, Province, and Address
- Create new Translation models, migrations, factories, seeders, resources, and controllers
- Update main models to use translations() hasMany instead of languages() belongsToMany relationships
- Migrate all API routes and controllers to use Translation pattern
- Update all resources to return translations instead of languages
- Fix all tests to use translations pattern and ensure unique constraint compliance
- Add withoutTranslations() factory states to prevent constraint violations
- Update translation factories to create unique languages instead of reusing seeded ones
- Remove obsolete *Language tables and update all references

This migration aligns with Laravel's recommended translation pattern and resolves
all unique constraint violations. All 822 tests now pass successfully.

Fixes: Internationalization refactoring to use Laravel best practices

* Update documentation for translation pattern migration

- Update api-models.md to reflect new Translation model pattern instead of pivot tables
- Add translation-specific API endpoints documentation for all models
- Update data relationships to show one-to-many translation relationships
- Update internationalization section to describe Laravel translation pattern
- Update CHANGELOG.md with detailed test coverage improvements and constraint fixes
- Regenerate OpenAPI documentation (api.json) to include new translation endpoints
- Document unique constraint compliance and factory improvements

This completes the documentation updates for the translation pattern migration
that aligns with Laravel best practices and resolves all test issues.

* feat: implement Item and Detail internationalization and contextualization system

- Add ItemTranslation and DetailTranslation models with comprehensive field sets
- Create translation tables with proper foreign key constraints and unique indexes
- Implement Eloquent relationships and helper methods for translation retrieval
- Add API resources and controllers for complete CRUD operations on translations
- Create factories and seeders for translation models with context/language support
- Register new API endpoints for translation management
- Update Item and Detail models with translation relationships
- Add filtering capabilities by item_id, detail_id, language_id, context_id
- Include fallback logic for missing translations and default context support
- Enhance existing factories with withoutTranslations states to prevent conflicts
- Update CHANGELOG with comprehensive documentation of new features

* feat: complete Item and Detail internationalization with comprehensive test suite

- Add ItemTranslation and DetailTranslation models with full CRUD API
- Implement context-aware translations supporting multiple versions per language
- Create comprehensive factory state methods for testing (withDefaultContext, forItem, forDetail)
- Add complete test suite with 924 tests passing (3632 assertions)
- Fix factory default context handling to use existing contexts
- Add proper imports and method signatures for type safety
- Update CHANGELOG with complete feature documentation

All tests now pass successfully with full coverage for translation functionality.

* docs: update documentation for ItemTranslation and DetailTranslation models

- Add comprehensive documentation for ItemTranslation and DetailTranslation models in api-models.md
- Document context-aware internationalization features and multi-context support
- Update Contexts section with detailed API endpoints and translation integration
- Add Context relationships to Data Relationships diagram
- Update test counts from 690+ to 924+ tests across documentation files
- Enhance internationalization section with context support and fallback logic
- Document extensive field sets and author relationships for translation models

---------

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

Files Changed


This documentation was automatically generated from Git commit data.