From c471defd255672c116b54855d3375c4118b09907 Mon Sep 17 00:00:00 2001 From: Frank Cools Date: Wed, 8 Oct 2025 01:26:12 +0200 Subject: [PATCH] Implement minor version system for template management - Add major.minor version format (30.1) - Keep government version as major number (30) - Use minor version for fixes and improvements (.1, .2, .3) - Update manifest.json with minor version system - Add practical examples to maintenance manual - Enable automatic updates for template fixes - Maintain government version compliance --- TEMPLATE_MAINTENANCE_MANUAL.md | 37 +++++++++++++++++++++++-- core/class/declarationtva_pdf.class.php | 4 +-- templates/manifest.json | 10 +++++-- 3 files changed, 45 insertions(+), 6 deletions(-) diff --git a/TEMPLATE_MAINTENANCE_MANUAL.md b/TEMPLATE_MAINTENANCE_MANUAL.md index ece194b..2237b3e 100644 --- a/TEMPLATE_MAINTENANCE_MANUAL.md +++ b/TEMPLATE_MAINTENANCE_MANUAL.md @@ -109,8 +109,9 @@ git push origin main - **Field Changes**: When form fields are added, removed, or modified ### Version Number Guidelines -- **Keep Government Version**: Use the official government version number (e.g., "30") -- **Don't Increment Unnecessarily**: Only change version if the template actually changes +- **Major Version**: Use the official government version number (e.g., "30") +- **Minor Version**: Use for fixes and improvements (e.g., "30.1", "30.2") +- **Format**: `major.minor` (e.g., "30.1" for government version 30 with fixes) - **Document Changes**: Always document what changed in the commit message ### Version Update Process @@ -118,6 +119,38 @@ git push origin main 2. **If changed**: Update version numbers in both files 3. **If unchanged**: Just replace the file, keep same version +### Minor Version System +The system uses a `major.minor` version format: + +- **Major Version (30)**: Official government version +- **Minor Version (.1, .2, .3)**: Your fixes and improvements + +**Examples:** +- `30.0` - Original government template +- `30.1` - Government template + field fixes +- `30.2` - Government template + additional improvements +- `31.0` - New government template (when available) + +**Benefits:** +- ✅ Keep government version as major number +- ✅ Track your improvements with minor numbers +- ✅ Other installations get automatic updates +- ✅ Clear version history + +### Practical Example +**Scenario**: You need to fix field positioning in the official template + +1. **Current version**: `30.1` +2. **Fix the template**: Update PDF file with corrected fields +3. **Update version**: Change to `30.2` +4. **Update manifest**: Add new release entry for `30.2` +5. **Commit and push**: All installations will auto-update to `30.2` + +**Result**: +- Government version stays `30` (major) +- Your fixes are tracked as `30.2` (minor) +- All installations get the improved template automatically + --- ## 📁 File Structure diff --git a/core/class/declarationtva_pdf.class.php b/core/class/declarationtva_pdf.class.php index ee2872f..f612d8a 100644 --- a/core/class/declarationtva_pdf.class.php +++ b/core/class/declarationtva_pdf.class.php @@ -62,9 +62,9 @@ class DeclarationTVA_PDF public $template_path; /** - * @var string Template version + * @var string Template version (major.minor format) */ - public $template_version = '30'; + public $template_version = '30.1'; /** * @var string Template document number diff --git a/templates/manifest.json b/templates/manifest.json index 483b314..90c053b 100644 --- a/templates/manifest.json +++ b/templates/manifest.json @@ -1,7 +1,7 @@ { "templates": { "ca3": { - "current_version": "30", + "current_version": "30.1", "document_number": "10963*30", "description": "Official CA-3 VAT Declaration Template", "releases": { @@ -9,7 +9,13 @@ "download_url": "https://git.covago.com/frank/DeclarationTVA/raw/branch/main/templates/declarationtva/ca3_official_template.pdf", "checksum": "sha256:placeholder_checksum_here", "release_date": "2025-01-27", - "description": "Official CA-3 template version 30" + "description": "Official CA-3 template version 30 (government version)" + }, + "30.1": { + "download_url": "https://git.covago.com/frank/DeclarationTVA/raw/branch/main/templates/declarationtva/ca3_official_template.pdf", + "checksum": "sha256:placeholder_checksum_here", + "release_date": "2025-01-27", + "description": "CA-3 template version 30.1 (field fixes and improvements)" } } }