Repository navigation
feat: Update Moroccan auto-entrepreneur tax rates and compliance for 2026 - #2
Conversation
…2026 - Restore correct activity types: services (1%), commerce (0.5%), artisana (0.5%) - Set high-value threshold at 80,000 MAD for 30% withholding tax (RAS) - Update annual income thresholds: services 200,000 MAD, commerce/artisana 500,000 MAD - Fix ConfigManager and DocumentFactory tax rate configuration - All tests passing (66 tests)
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (5 files)
Reviewed by nemotron-3-super-120b-a12b-20230311:free · 470,905 tokens |
…ols for PDF generation
There was a problem hiding this comment.
🔴 resetToDefaults() sets decimalSeparator to a space instead of '.', diverging from constructor defaults
In resetToDefaults() at line 147, decimalSeparator is set to ' ' (a space character), while the constructor at src/core/ConfigManager.js:15 sets it to '.' (period). After calling resetToDefaults(), all currency and number formatting will use a space as the decimal separator (e.g., 1,234 56 instead of 1,234.56), because DocumentGenerator.formatCurrency at src/core/DocumentGenerator.js:111 joins number parts using config.numberFormat.decimalSeparator. This is a pre-existing inconsistency but directly related to the PR's modifications of the resetToDefaults() method.
(Refers to line 147)
Was this helpful? React with 👍 or 👎 to provide feedback.
| github.rest.repos.createReleaseComment({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| release_id: context.payload.release.id, | ||
| body: '✅ Published to npm: https://www.npmjs.com/package/@omnizya/legman' | ||
| }) |
There was a problem hiding this comment.
🔴 github.rest.repos.createReleaseComment is not a valid GitHub API method
The release workflow's "Comment on release" step calls github.rest.repos.createReleaseComment(...), which does not exist in the GitHub REST API (Octokit). There is no endpoint to create comments directly on releases. This will fail at runtime with a TypeError: github.rest.repos.createReleaseComment is not a function error. Since this step runs after npm publish, the package will be published successfully, but the workflow will be marked as failed, which is misleading.
Possible fix using updateRelease instead
To append a message to the release, use github.rest.repos.updateRelease to modify the release body, e.g.:
const release = context.payload.release;
github.rest.repos.updateRelease({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: release.id,
body: release.body + '\n\n✅ Published to npm: https://www.npmjs.com/package/@omnizya/legman'
})| github.rest.repos.createReleaseComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| release_id: context.payload.release.id, | |
| body: '✅ Published to npm: https://www.npmjs.com/package/@omnizya/legman' | |
| }) | |
| const release = context.payload.release; | |
| await github.rest.repos.updateRelease({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| release_id: release.id, | |
| body: (release.body || '') + '\n\n✅ Published to npm: https://www.npmjs.com/package/@omnizya/legman' | |
| }) | |
Was this helpful? React with 👍 or 👎 to provide feedback.
| ' | ', | ||
| { | ||
| text: 'https://legman.omnizya.com', | ||
| fontSize: 8, | ||
| color: '#0066cc', | ||
| link: 'https://legman.omnizya.com' | ||
| }, | ||
| ' | ', |
There was a problem hiding this comment.
🟡 Footer separator ' | ' inherits default 12pt font size instead of matching 8pt text
In _buildFooter(), the ' | ' plain string separators in the pdfmake text array don't specify a fontSize. In pdfmake, plain strings in an inline text array inherit the parent element's font size, which falls back to the document default (12pt). The adjacent text objects explicitly set fontSize: 8. This causes the | separators to render at ~12pt while the surrounding text is 8pt, creating a visually inconsistent footer on every generated PDF document.
| ' | ', | |
| { | |
| text: 'https://legman.omnizya.com', | |
| fontSize: 8, | |
| color: '#0066cc', | |
| link: 'https://legman.omnizya.com' | |
| }, | |
| ' | ', | |
| { text: ' | ', fontSize: 8, color: '#999' }, | |
| { | |
| text: 'https://legman.omnizya.com', | |
| fontSize: 8, | |
| color: '#0066cc', | |
| link: 'https://legman.omnizya.com' | |
| }, | |
| { text: ' | ', fontSize: 8, color: '#999' }, |
Was this helpful? React with 👍 or 👎 to provide feedback.
Summary
This PR updates the framework to correctly implement Moroccan auto-entrepreneur tax rates and compliance requirements for 2026.
Changes
Tax Rates
High-Value Threshold
Annual Income Thresholds
Files Modified
src/core/ConfigManager.js: Updated autoEntrepreneur configuration with correct tax rates and thresholdssrc/core/DocumentFactory.js: Restored correct activity types validationTesting
Compliance Notes
This implementation aligns with the 2026 Moroccan auto-entrepreneur regulations, ensuring accurate tax calculation and reporting for various business types.