💚 Fix type test
parent
c17e9a0c27
commit
6700f84ad8
|
@ -500,7 +500,7 @@ export default function CreateCompany({ statut }: CreateCompanyProps) {
|
|||
<Link
|
||||
className="ui__ interactive card small box lighter-bg"
|
||||
to={{
|
||||
pathname: sitePaths.simulateurs.SASU,
|
||||
pathname: sitePaths.simulateurs.sasu,
|
||||
state: { fromCréer: true },
|
||||
}}
|
||||
>
|
||||
|
|
|
@ -9,7 +9,7 @@ import Overlay from 'Components/Overlay'
|
|||
import PageHeader from 'Components/PageHeader'
|
||||
import * as Animate from 'Components/ui/animate'
|
||||
import { ScrollToTop } from 'Components/utils/Scroll'
|
||||
import { SitePathsContext } from 'Components/utils/SitePathsContext'
|
||||
import { SitePaths, SitePathsContext } from 'Components/utils/SitePathsContext'
|
||||
import { useContext, useEffect, useRef, useState } from 'react'
|
||||
import emoji from 'react-easy-emoji'
|
||||
import { Helmet } from 'react-helmet'
|
||||
|
@ -22,22 +22,33 @@ import { TrackPage } from '../../ATInternetTracking'
|
|||
import AideOrganismeLocal from './AideOrganismeLocal'
|
||||
import businessPlan from './businessPlan.svg'
|
||||
|
||||
const infereDirigeantFromCompanyDetails = (company: Company | null) => {
|
||||
const infereDirigeantFromCompanyDetails = (
|
||||
company: Company | null
|
||||
): Exclude<
|
||||
keyof SitePaths['simulateurs'],
|
||||
'index' | 'profession-libérale' | 'économieCollaborative'
|
||||
> | null => {
|
||||
if (!company) {
|
||||
return null
|
||||
}
|
||||
if (company.isAutoEntrepreneur) {
|
||||
return 'auto-entrepreneur'
|
||||
}
|
||||
if (company.statutJuridique === 'EI') {
|
||||
return 'entreprise-individuelle'
|
||||
}
|
||||
if (
|
||||
['EI', 'EURL'].includes(company.statutJuridique ?? '') ||
|
||||
(company.statutJuridique === 'SARL' && company.isDirigeantMajoritaire)
|
||||
company.statutJuridique &&
|
||||
['EIRL', 'SASU', 'EURL'].includes(company.statutJuridique)
|
||||
) {
|
||||
return company.statutJuridique.toLowerCase() as 'eirl' | 'sasu' | 'eurl'
|
||||
}
|
||||
if (company.statutJuridique === 'SARL' && company.isDirigeantMajoritaire) {
|
||||
return 'indépendant'
|
||||
}
|
||||
|
||||
if (['SASU', 'SAS'].includes(company.statutJuridique ?? '')) {
|
||||
return 'SASU'
|
||||
if (company.statutJuridique === 'SAS') {
|
||||
return 'sasu'
|
||||
}
|
||||
|
||||
return null
|
||||
|
|
|
@ -176,20 +176,20 @@ type SimulatorRessourceCardProps = {
|
|||
export function SimulatorRessourceCard({
|
||||
simulatorId,
|
||||
}: SimulatorRessourceCardProps) {
|
||||
const simulators = useSimulatorsData()
|
||||
const simulator = useSimulatorsData()[simulatorId]
|
||||
return (
|
||||
<Link
|
||||
className="ui__ interactive card lighter-bg box thinner"
|
||||
to={{
|
||||
state: { fromSimulateurs: true },
|
||||
pathname: simulators[simulatorId].path,
|
||||
pathname: simulator.path,
|
||||
}}
|
||||
>
|
||||
<h3 className="ui__ h h5">
|
||||
<Emoji emoji={simulators[simulatorId].icône} />{' '}
|
||||
{simulators[simulatorId].shortName}
|
||||
{simulator.icône && <Emoji emoji={simulator.icône} />}{' '}
|
||||
{simulator.shortName}
|
||||
</h3>
|
||||
<p className="ui__ notice">{simulators[simulatorId].meta?.description}</p>
|
||||
<p className="ui__ notice">{simulator.meta?.description}</p>
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ export default function SalariéSimulation() {
|
|||
<Banner icon={'👨✈️'}>
|
||||
<Trans>
|
||||
Vous êtes dirigeant d'une SAS(U) ?{' '}
|
||||
<Link to={sitePaths.simulateurs.SASU}>
|
||||
<Link to={sitePaths.simulateurs.sasu}>
|
||||
Accéder au simulateur de revenu dédié
|
||||
</Link>
|
||||
</Trans>
|
||||
|
|
|
@ -294,11 +294,9 @@ export function getSimulatorsData({
|
|||
<p>
|
||||
Le dirigeant d'une entreprise individuelle paye des cotisations
|
||||
sociales, proportionnelle au{' '}
|
||||
<RuleLink
|
||||
dottedName="entreprise . résultat fiscal"
|
||||
résultat
|
||||
fiscal
|
||||
></RuleLink>{' '}
|
||||
<RuleLink dottedName="entreprise . résultat fiscal">
|
||||
résultat fiscal
|
||||
</RuleLink>{' '}
|
||||
de l'entreprise. Leur montant varie également en fonction du type
|
||||
d'activité (profession libérale, artisan, commerçants, etc), où des
|
||||
éventuelles exonérations accordées (ACRE, ZFU, RSA, etc.).
|
||||
|
|
|
@ -83,9 +83,18 @@ function companyStatusChoice(state: LegalStatus | null = null, action: Action) {
|
|||
return action.statusName
|
||||
}
|
||||
|
||||
type StatutJuridique =
|
||||
| 'EI'
|
||||
| 'EURL'
|
||||
| 'SARL'
|
||||
| 'SAS'
|
||||
| 'SA'
|
||||
| 'SASU'
|
||||
| 'NON_IMPLÉMENTÉ'
|
||||
|
||||
const infereLegalStatusFromCategorieJuridique = (
|
||||
catégorieJuridique: string
|
||||
) => {
|
||||
): StatutJuridique => {
|
||||
/*
|
||||
Nous utilisons le code entreprise pour connaitre le statut juridique
|
||||
(voir https://www.insee.fr/fr/information/2028129)
|
||||
|
@ -118,7 +127,7 @@ const infereLegalStatusFromCategorieJuridique = (
|
|||
export type Company = {
|
||||
siren: string
|
||||
catégorieJuridique?: string
|
||||
statutJuridique?: string
|
||||
statutJuridique?: StatutJuridique
|
||||
dateDeCréation?: string
|
||||
isAutoEntrepreneur?: boolean
|
||||
isDirigeantMajoritaire?: boolean
|
||||
|
|
|
@ -54,7 +54,6 @@ const sitePathsFr = {
|
|||
eirl: '/eirl',
|
||||
sasu: '/sasu',
|
||||
eurl: '/eurl',
|
||||
|
||||
indépendant: '/indépendant',
|
||||
comparaison: '/comparaison-régimes-sociaux',
|
||||
pamc: '/pamc',
|
||||
|
@ -119,6 +118,9 @@ const sitePathsEn = {
|
|||
indépendant: '/independant',
|
||||
'entreprise-individuelle': '/sole-proprietorship',
|
||||
'auto-entrepreneur': '/auto-entrepreneur',
|
||||
eirl: '/eirl',
|
||||
sasu: '/sasu',
|
||||
eurl: '/eurl',
|
||||
pamc: '/pamc',
|
||||
comparaison: '/social-scheme-comparaison',
|
||||
salarié: '/salary',
|
||||
|
|
|
@ -198,14 +198,15 @@ Notifications affichées : dirigeant . auto-entrepreneur . notification calcul A
|
|||
`;
|
||||
|
||||
exports[`calculate simulations-auto-entrepreneur: ACRE 3`] = `
|
||||
<<<<<<< HEAD
|
||||
"[34449,371,30000,0,30000]
|
||||
=======
|
||||
"[33950,329,30000,0,30000]
|
||||
>>>>>>> f2da7982 (:green_hear: Fix type test)
|
||||
Notifications affichées : dirigeant . auto-entrepreneur . notification calcul ACRE annuel"
|
||||
`;
|
||||
|
||||
exports[`calculate simulations-auto-entrepreneur: ACRE 4`] = `
|
||||
"[45267,439,40000,0,40000]
|
||||
Notifications affichées : dirigeant . auto-entrepreneur . notification calcul ACRE annuel"
|
||||
`;
|
||||
exports[`calculate simulations-auto-entrepreneur: ACRE 4`] = `"[45932,494,40000,0,40000]"`;
|
||||
|
||||
exports[`calculate simulations-auto-entrepreneur: activité mixte 1`] = `"[20000,292,16499,0,16499]"`;
|
||||
|
||||
|
|
Loading…
Reference in New Issue