Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: met à jour Publicodes -> 1.5.1 #3117

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@apidevtools/swagger-cli": "^4.0.4",
"@koa/cors": "^4.0.0",
"@koa/router": "^12.0.0",
"@publicodes/rest-api": "^1.2.0",
"@publicodes/rest-api": "^1.5.0",
"@sentry/node": "^7.70.0",
"@sentry/utils": "^7.70.0",
"got": "^13.0.0",
Expand All @@ -43,7 +43,7 @@
"modele-social": "workspace:^",
"nodemon": "^3.0.1",
"piano-analytics-js": "^6.13.0",
"publicodes": "^1.2.0",
"publicodes": "^1.5.1",
"rate-limiter-flexible": "^2.4.2",
"swagger-ui-dist": "^5.7.2"
},
Expand Down
11 changes: 9 additions & 2 deletions api/source/test-e2e/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,18 @@ describe('e2e test mon-entreprise api', () => {
'dirigeant . indépendant . PL . métier': "'avocat'",
'entreprise . activité . nature': "'libérale'",
'entreprise . date de création': '01/01/2013',
"entreprise . chiffre d'affaires": 6264,
"entreprise . chiffre d'affaires": '6264 €/an',
'entreprise . catégorie juridique': "'EI'",
'entreprise . catégorie juridique . EI . auto-entrepreneur': 'non',
},
expressions: ['dirigeant . rémunération . net . après impôt'],
expressions: [
// 'dirigeant . régime social',
// 'dirigeant . indépendant',
// 'dirigeant . rémunération . totale',
// 'dirigeant . rémunération . cotisations',
// 'dirigeant . rémunération . net',
'dirigeant . rémunération . net . après impôt',
],
})
.then((res) => {
expect(res.status).toMatchInlineSnapshot('200')
Expand Down
5 changes: 4 additions & 1 deletion modele-social/règles/dirigeant/dirigeant.publicodes
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ dirigeant . gérant minoritaire:
dirigeant . régime social:
experimental: oui
variations:
- si: entreprise . catégorie juridique . EI . auto-entrepreneur
- si:
toutes ces conditions:
- est applicable: entreprise . catégorie juridique . EI . auto-entrepreneur
- entreprise . catégorie juridique . EI . auto-entrepreneur
alors: "'auto-entrepreneur'"
- si:
une de ces conditions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ dirigeant . indépendant . PL . CNBF . retraite de base:
alors: 608 €/an
- si: date >= 01/2021
alors: 581 €/an
plafond: 2 ans
plafond: 2 an
- montant:
variations:
- si: date >= 01/2024
Expand All @@ -60,7 +60,7 @@ dirigeant . indépendant . PL . CNBF . retraite de base:
alors: 954 €/an
- si: date >= 01/2021
alors: 912 €/an
plafond: 3 ans
plafond: 3 an
- montant:
variations:
- si: date >= 01/2024
Expand All @@ -71,7 +71,7 @@ dirigeant . indépendant . PL . CNBF . retraite de base:
alors: 1299 €/an
- si: date >= 01/2021
alors: 1242 €/an
plafond: 5 ans
plafond: 5 an
- montant:
variations:
- si: date >= 01/2024
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ dirigeant . indépendant . PL . métier:

dirigeant . indépendant . PL . métier . rattaché CIPAV:
titre: Autre métier rattaché à la CIPAV
par défaut: non
description: |
Vous exercez un métier réglementé rattaché à la CIPAV. La liste de ces métiers est :

Expand Down Expand Up @@ -125,7 +126,7 @@ dirigeant . indépendant . PL . métier . juridique:
description: |
Les officiers ministériels, les officiers publics et les compagnies judiciaires sont affiliées à la Cavom pour leur retraite et de prévoyance.

Liste des métiers concernés :
Liste des métiers concernés :

- Huissiers de justice ;
- Commissaires-priseurs (judiciaires et/ou de ventes volontaires) ;
Expand Down
16 changes: 6 additions & 10 deletions modele-social/règles/entreprise/catégorie-juridique.publicodes
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@ entreprise . catégorie juridique . EI:
auto-entrepreneur:
question: Êtes-vous auto-entrepreneur ?
acronyme: AE
par défaut: par défaut
par défaut: non
non applicable si:
par défaut: non
une de ces conditions:
- salarié = oui
- entreprise . imposition . IR . type de bénéfices = 'BA'
références:
S'informer sur le statut: https://www.autoentrepreneur.urssaf.fr/portail/accueil/sinformer-sur-le-statut/lessentiel-du-statut.html
Les étapes de la création d'une auto-entreprise: https://www.autoentrepreneur.urssaf.fr/portail/accueil/creer-mon-auto-entreprise.html
Expand All @@ -65,15 +70,6 @@ entreprise . catégorie juridique . EI:
Où et comment s'inscrire pour devenir micro-entrepreneur (ex auto-entrepreneur)?: https://bpifrance-creation.fr/encyclopedie/micro-entreprise-regime-auto-entrepreneur/lessentiel-ce-regime/ou-comment-sinscrire
La comptabilité du micro-entrepreneur (auto-entrepreneur): https://bpifrance-creation.fr/encyclopedie/micro-entreprise-regime-auto-entrepreneur/fiscal-social-comptable/comptabilite-du

auto-entrepreneur . par défaut:
non applicable si:
une de ces conditions:
- entreprise . imposition . IR . type de bénéfices = 'BA'
- toutes ces conditions:
- activité . nature . libérale . réglementée
- dirigeant . indépendant . PL . métier . rattaché CIPAV = non
experimental: oui

EI:
titre: entreprise individuelle
acronyme: EI
Expand Down
1 change: 1 addition & 0 deletions modele-social/règles/entreprise/entreprise.publicodes
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ entreprise . TVA . franchise de TVA . notification:
type: notification
experimental: oui
toutes ces conditions:
- dirigeant
- seuils dépassés = non
- chiffre d'affaires != 0
résumé: |
Expand Down
6 changes: 3 additions & 3 deletions modele-social/règles/salarié/salarié.publicodes
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
salarié:
par défaut: non
icônes: 🤝
valeur: oui

salarié . ancienneté:
durée:
Expand Down Expand Up @@ -41,9 +41,9 @@ salarié . convention collective:
valeur:
convention collective = 'autre'
description: >-
Attention : votre convention collective n'est pas prise en charge,
Attention : votre convention collective n'est pas prise en charge,
la simulation se basera sur le droit commun.

salarié . régimes spécifiques:
salarié . régimes spécifiques . alsace moselle:
titre: Régime Alsace-Moselle
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@actions/github": "^5.1.1",
"@ianvs/prettier-plugin-sort-imports": "^4.1.0",
"@publicodes/codemod": "^1.1.0",
"@publicodes/tools": "^1.0.7",
"@publicodes/tools": "^1.2.5",
"@types/got": "^9.6.12",
"@typescript-eslint/eslint-plugin": "^6.7.2",
"@typescript-eslint/parser": "^6.7.2",
Expand All @@ -52,7 +52,7 @@
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-vitest": "^0.3.22",
"prettier": "^3.0.3",
"publicodes": "^1.2.0",
"publicodes": "^1.5.4",
"rimraf": "^5.0.1"
},
"resolutions": {
Expand Down
133 changes: 93 additions & 40 deletions site/cypress/integration/mon-entreprise/assistants/choix-du-statut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,106 @@ describe(`Assistant choix du statut`, { testIsolation: false }, function () {
if (!fr) {
return
}
before(function () {
cy.visit(encodeURI('/'))
cy.clearAllLocalStorage()
})

it('should allow start assistant', function () {
cy.visit(encodeURI('/'))
cy.get('a[aria-label="Choix du statut, Lancer l\'assistant"]').click()
checkA11Y()
cy.contains('Trouver le bon statut').click()
})
describe('Métropole et associé unique', () => {
Copy link
Contributor

@liliced liliced Sep 27, 2024

Choose a reason for hiding this comment

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

Un peu répétitif tout ce code. Pour des tests c'est moins important mais il n'était peut-être pas nécessaire de répéter toutes les étapes à chaque scénario, ou alors en les factorisant.

before(function () {
cy.visit(encodeURI('/'))
cy.clearAllLocalStorage()
})

it('should allow to select activity', function () {
cy.get('input[type=search]').type('coiff')
cy.contains('Coiffure').click()
checkA11Y()
cy.contains('Enregistrer et continuer').click()
checkA11Y()
cy.contains('Continuer avec cette activité').click()
})
it('should allow start assistant', function () {
cy.visit(encodeURI('/'))
cy.get('a[aria-label="Choix du statut, Lancer l\'assistant"]').click()
checkA11Y()
cy.contains('Trouver le bon statut').click()
})

it('should allow to select commune', function () {
cy.get('input[aria-autocomplete="list"]').type('Saint-Remy-en-B')
cy.contains('Saint-Remy-en-Bouzemont-Saint-Genest-et-Isson').click()
cy.contains('Enregistrer et continuer').not('[disabled]').click()
})
it('should allow to select activity', function () {
cy.get('input[type=search]').type('coiff')
cy.contains('Coiffure').click()
checkA11Y()
cy.contains('Enregistrer et continuer').click()
checkA11Y()
cy.contains('Continuer avec cette activité').click()
})

it('should allow to specify if non profit', function () {
cy.contains("Dans le but de gagner de l'argent").click()
checkA11Y()
cy.contains('Enregistrer et continuer').click()
})
it('should allow to select commune', function () {
cy.get('input[aria-autocomplete="list"]').type('Saint-Remy-en-B')
cy.contains('Saint-Remy-en-Bouzemont-Saint-Genest-et-Isson').click()
cy.contains('Enregistrer et continuer').not('[disabled]').click()
})

it('should allow to specify if non profit', function () {
cy.contains("Dans le but de gagner de l'argent").click()
checkA11Y()
cy.contains('Enregistrer et continuer').click()
})

it('should allow to specify associates', function () {
cy.contains('Seul').click()
cy.contains('Oui').click()
checkA11Y()
cy.contains('Enregistrer et continuer').click()
})

it('should allow to specify associates', function () {
cy.contains('Seul').click()
cy.contains('Oui').click()
checkA11Y()
cy.contains('Enregistrer et continuer').click()
it('should allow to input remuneration and select appropriate statut', function () {
cy.get('#CA').type('50000')
cy.get('#charges').type('10000')

checkA11Y()
cy.contains('Enregistrer et continuer').not('[disabled]').click()
cy.contains('Choisir ce statut').click()
cy.contains('Vous avez choisi le statut :')
})
})

it('should allow to input remuneration and select appropriate statut', function () {
cy.get('#CA').type('50000')
cy.get('#charges').type('10000')
describe('DROM et associés multiples', () => {
before(function () {
cy.visit(encodeURI('/'))
cy.clearAllLocalStorage()
})

it('should allow start assistant', function () {
cy.visit(encodeURI('/'))
cy.get('a[aria-label="Choix du statut, Lancer l\'assistant"]').click()
checkA11Y()
cy.contains('Trouver le bon statut').click()
})

it('should allow to select activity', function () {
cy.get('input[type=search]').type('coiff')
cy.contains('Coiffure').click()
checkA11Y()
cy.contains('Enregistrer et continuer').click()
checkA11Y()
cy.contains('Continuer avec cette activité').click()
})

it('should allow to select commune', function () {
cy.get('input[aria-autocomplete="list"]').type('97160')
cy.contains('Le Moule').click()
cy.contains('Enregistrer et continuer').not('[disabled]').click()
})

it('should allow to specify if non profit', function () {
cy.contains("Dans le but de gagner de l'argent").click()
checkA11Y()
cy.contains('Enregistrer et continuer').click()
})

it('should allow to specify associates', function () {
cy.contains('À plusieurs').click()
checkA11Y()
cy.contains('Enregistrer et continuer').click()
})

it('should allow to input remuneration and select appropriate statut', function () {
cy.get('#rémunérationTotale').type('23000')

checkA11Y()
cy.contains('Enregistrer et continuer').not('[disabled]').click()
cy.contains('Choisir ce statut').click()
cy.contains('Vous avez choisi le statut :')
checkA11Y()
cy.contains('Enregistrer et continuer').not('[disabled]').click()
cy.contains('Choisir ce statut').click()
cy.contains('Vous avez choisi le statut :')
})
})
})
6 changes: 3 additions & 3 deletions site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"@internationalized/number": "^3.2.1",
"@juggle/resize-observer": "^3.4.0",
"@leeoniya/ufuzzy": "^1.0.10",
"@publicodes/react-ui": "^1.2.0",
"@publicodes/react-ui": "^1.5.4",
"@react-aria/accordion": "^3.0.0-alpha.17",
"@react-pdf/renderer": "^3.1.12",
"@sentry/integrations": "^7.70.0",
Expand All @@ -68,13 +68,13 @@
"effect": "^3.0.0",
"exoneration-covid": "workspace:^",
"focus-trap-react": "^10.2.1",
"fuse.js": "^6.6.2",
"fuse.js": "^7.0.0",
"iframe-resizer": "^4.3.7",
"isbot": "^3.7.0",
"markdown-to-jsx": "^7.3.2",
"modele-social": "workspace:^",
"piano-analytics-js": "^6.13.0",
"publicodes": "^1.2.0",
"publicodes": "^1.5.1",
"react": "^18.2.0",
"react-aria": "^3.24.0",
"react-day-picker": "^8.8.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ function getSituationFromStatut(statut: StatutType): Situation {
'entreprise . catégorie juridique . EI . auto-entrepreneur':
statut === 'AE' ? 'oui' : 'non',
'entreprise . associés': ['SARL', 'SAS', 'SELAS', 'SELARL'].includes(statut)
? "'multiple'"
? "'multiples'"
: "'unique'",
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ const config: SimulationConfig = {
'dirigeant . régime social': "'indépendant'",
date: '01/01/2023',
'dirigeant . indépendant . PL . CIPAV': 'non',
'entreprise . catégorie juridique': "''",
impôt: 'non',
},
'unité par défaut': '€',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const configArtisteAuteur: SimulationConfig = {
],
situation: {
'artiste-auteur': 'oui',
salarié: 'oui',
dirigeant: {
'applicable si': 'non',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,12 @@ export const configAutoEntrepreneur: SimulationConfig = {
'établissement',
'situation personnelle',
],
'non prioritaires': ['établissement . commune'],
'non prioritaires': [
'établissement . commune',
'entreprise . imposition . IR . type de bénéfices',
],
'liste noire': [
'entreprise . catégorie juridique . EI . auto-entrepreneur',
'entreprise . activités . revenus mixtes',
'entreprise . charges',
"entreprise . chiffre d'affaires",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export const configComparateurStatuts: ComparateurConfig = {
'unité par défaut': '€/mois',
situation: {
'entreprise . activités . revenus mixtes': 'non',
'entreprise . catégorie juridique': "''",
salarié: 'non',
'salarié . cotisations . ATMP . taux fonctions support': 'oui',
"entreprise . chiffre d'affaires": '4000 €/mois',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const ISSimulationConfig: SimulationConfig = {
'unité par défaut': '€/an',
situation: {
salarié: 'non',
'entreprise . catégorie juridique': "''",
'entreprise . imposition': "'IS'",
'entreprise . imposition . IS . éligible taux réduit': 'oui',
'entreprise . TVA . franchise de TVA': 'non',
Expand Down
Loading
Loading