Skip to content

feat: Update Moroccan auto-entrepreneur tax rates and compliance for 2026 - #2

Merged
moughamir merged 4 commits into
masterfrom
feat/moroccan-compliance-2026-update
Apr 4, 2026
Merged

moughamir merged 4 commits into
masterfrom
feat/moroccan-compliance-2026-update

Conversation

@moughamir

@moughamir moughamir commented Apr 4, 2026 •

Copy link
Copy Markdown
Member

Summary

This PR updates the framework to correctly implement Moroccan auto-entrepreneur tax rates and compliance requirements for 2026.

Changes

Tax Rates

  • Services: 1% (0.01 dividend rate)
  • Commerce: 0.5% (0.005 dividend rate)
  • Artisana/Craft: 0.5% (0.005 dividend rate)

High-Value Threshold

  • 30% Withholding Tax (RAS): Applies for single client transactions exceeding 80,000 MAD annually

Annual Income Thresholds

  • Services: 200,000 MAD
  • Commerce: 500,000 MAD
  • Artisana: 500,000 MAD

Files Modified

  • src/core/ConfigManager.js: Updated autoEntrepreneur configuration with correct tax rates and thresholds
  • src/core/DocumentFactory.js: Restored correct activity types validation

Testing

  • All 66 tests passing ✅
  • Tax calculation logic verified for all activity types
  • Framework builds successfully

Compliance Notes

This implementation aligns with the 2026 Moroccan auto-entrepreneur regulations, ensuring accurate tax calculation and reporting for various business types.


Open with Devin

…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)
@kilo-code-bot

kilo-code-bot Bot commented Apr 4, 2026 •

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (5 files)
  • .github/WORKFLOWS_SETUP.md - 0 issues
  • .github/workflows/ci.yml - 0 issues
  • .github/workflows/code-quality.yml - 0 issues
  • .github/workflows/release.yml - 0 issues
  • package.json - 0 issues

Reviewed by nemotron-3-super-120b-a12b-20230311:free · 470,905 tokens

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

@moughamir moughamir self-assigned this Apr 4, 2026
@moughamir moughamir added the enhancement New feature or request label Apr 4, 2026
@moughamir moughamir moved this from Backlog to In progress in FireNextPwa-FashionistAi Apr 4, 2026

@kilo-code-bot kilo-code-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review completed. All workflows and configurations look good. Ready to merge.

@moughamir
moughamir merged commit 6a94e6c into master Apr 4, 2026
1 of 5 checks passed
@github-project-automation github-project-automation Bot moved this from In progress to Done in FireNextPwa-FashionistAi Apr 4, 2026
@moughamir
moughamir deleted the feat/moroccan-compliance-2026-update branch April 4, 2026 15:09

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 3 new potential issues.

View 8 additional findings in Devin Review.

Open in Devin Review

Comment thread src/core/ConfigManager.js

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 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)

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jules tackle

Comment on lines +43 to +48
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'
})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 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'
})
Suggested change
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'
})
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +477 to +484
' | ',
{
text: 'https://legman.omnizya.com',
fontSize: 8,
color: '#0066cc',
link: 'https://legman.omnizya.com'
},
' | ',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

Suggested change
' | ',
{
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' },
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant