This major release introduces a comprehensive Contract Information Management System, replacing the previous SegmentFinancialInfo model. It adds support for contract versioning (amendments/renewals), many-to-many relationships between contracts and segments, and enhanced financial tracking.
🚀 New Features
Contract Information Management
- Complete Replacement: Replaced
SegmentFinancialInfowith a robustContractInfomodel. - Versioning System: Implemented a linear version chain (linked list) to track contract history.
- Support for New, Amendment, and Renewal contract types.
- Automatic version numbering (v1, v2, v3...).
- Ability to clone contracts to create amendments while preserving immutable fields like currency.
- Visual timeline in the UI showing the evolution of a contract.
- Many-to-Many Relationships: A single contract can now cover multiple network segments, and a segment can have multiple contracts.
Enhanced Financial Tracking
- Flexible Recurring Charges: Support for configurable billing periods (Monthly, Quarterly, Semi-Annually, Annually).
- Commitment Tracking: Automatic calculation of commitment end dates based on the start date and number of billing periods.
- Multi-Currency Support: Currency is now immutable per contract chain to ensure financial consistency.
- Calculated Fields: Automatic calculation of Total Recurring Cost and Total Contract Value.
UI & Visualization
- New Views: Dedicated list and detail views for Contracts.
- Visual Indicators: Color-coded badges for contract status and date proximity (Green/Orange/Red).
- Interactive Tooltips: Hover details showing exact dates and days remaining for commitments.
- Segment Integration: Segment detail views now display all associated active contracts in a dedicated panel.
API & GraphQL
- New REST Endpoint:
/api/plugins/cesnet-service-path-plugin/contract-info/ - GraphQL Support: Full support for querying contract versions, relationships, and computed financial fields.
- Advanced Filtering: Filter contracts by active status, version, currency, and date ranges.
💥 Breaking Changes
- Removed Model: The
SegmentFinancialInfomodel and table have been removed. - API Removal: The
/api/plugins/cesnet-service-path-plugin/segment-financial-info/endpoint has been removed. - Permissions: New permissions (
view_contractinfo,add_contractinfo, etc.) replace the old financial info permissions.
🔄 Migration & Upgrade
- Database Migration: Migration
0033automatically converts existingSegmentFinancialInfodata toContractInfo.- Preserves all charges, notes, and dates.
- Converts "Monthly Charge" to "Recurring Charge" (Monthly).
- Converts "Commitment Months" to "Number of Recurring Charges".
- Upgrade Steps:
- Backup your database.
- Install the update:
pip install --upgrade cesnet_service_path_plugin - Run migrations:
python manage.py migrate cesnet_service_path_plugin - Update API clients to use the new
/contract-info/endpoint. - Review and assign new user permissions.
🐛 Bug Fixes
- Improved decimal handling in financial calculations.
- Enhanced date validation logic for contract periods.
- Fixed M2M relationship serialization in API responses.
Full Changelog: v5.3.0...v5.4.0