Skip to content

Cette librairie permet d'extraire les données d'un fichier au format de la Déclaration Sociale Nominative (DSN).

License

Notifications You must be signed in to change notification settings

louisbrulenaudet/dsn-parser

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DSN Parser


Table des matières


Description

Cette librairie permet d'extraire les données d'un fichier au format de la Déclaration Sociale Nominative (DSN).

La librairie se base sur le cahier technique 2023 . Le parser est capable de gérer les normes :

  • 2022
  • 2023

La librairie permet de d'obtenir :

  • Les informations du fichier DSN (éditeur, logicel de paie)
  • Les informations de la société
  • Les informations des établissements
  • Les taux AT
  • Les taux du versment mobilité
  • Les organismes de cotisations
  • La liste des libellés emplois
  • La liste des salariés
  • Les contrats de travail des salariés
  • Les bases assujetis
  • Les affiliations aux organismes de prévoyances des salariés
  • Le détail des cotisations salariés
  • Les absences des salariés

Installation

    npm i @fibre44/dsn-parser

Exemples d'utilisation

import { DsnParser } from "@fibre44/dsn-parser";
import { fileURLToPath } from 'node:url';
import { dirname, join } from 'node:path';

const dir = join(dirname(fileURLToPath(import.meta.url)), './demo.dsn')
const dsn = new DsnParser()

const options = {
        controleDsnVersion: true,
        deleteFile: false
    }
try {
  await dsn.asyncInit(dir, options)
} catch (e) {
    console.error(e)
}

Les options

Fichier d'option par default.

 options = {
       controleDsnVersion: true,//Controle que le fichier utilise bien la dernière norme de la DSN
       deleteFile: false //Autorise la suppression du fichier après le traitement
   }

La classe DsnParser propose différentes méthodes pour obtenir les informations du fichier DSN.

Méthode dsn

Cette méthode retourne objet Javascript avec cette structure :

{
    softwareName: string,
    provider: string,
    softwareVersion: string,
    dsnVersion: string,
    type: string,
    totalRows: string,
    month: string
}

Méthode society

Cette méthode retourne objet Javascript avec cette structure :

{
    siren: string,
    nic: string,
    apen: string,
    adress1: string,
    adress2?: string,
    adress3?: string,
    zipCode: string,
    city: string
}

Méthode Establishment

Dans la DSN une même DSN on peut avoir X établissements, la méthode retourne un tableau d'objets.

[
    {
    siren: string,
    nic: string,
    apet: string,
    adress1: string,
    adress2?: string,
    adress3?: string,
    zipCode: string,
    country: string,
    idcc: string,
    legalStatus: string,
    opco: string,
    codeZip: string,
    city: string,
    date: string
    }
]

Méthode assignement

[ 
    { value: 'Developpeur Javascript' },
    { value: 'Developpeur PHP' }
]

Méthode contributionFund

La méthode retourne un tableau d'objets avec les informations des différents organismes sociaux.

[
  {
    codeDsn: '53510475600015',
    name: 'Urssaf Pays de la Loire',
    adress1: 'string',
    codeZip: 'string',
    city: 'string'
  },
  {
    codeDsn: 'P0942',
    name: 'AG2R',
    adress1: 'string',
    codeZip: 'string',
    city: 'string'
  }
]

Méthode employee

La méthode retourne un tableau d'objets

[
 {
   numSS: string,
   lastname: string,
   surname: string,
   firstname: string,
   sex: string,
   birthday: string,
   placeOfBith: string,
   address1: string,
   codeZip: string,
   city: string,
   country: string,
   codeZipBith: string,
   countryBirth: string,
   address2?: string,
   address3?: string,
   email?: string,
   employeeId: string,
   graduate?: string,
   studies?: string
 },

]
  

Méthode workContract

La méthode retourne un tableau d'objets

[
  {
    employeeId: string,
    startDate: string,
    status: string,
    retirement: string,
    pcs: string,
    pcsBis: string,
    employmentLabel: string,
    contract: string,
    publicDispPolitic: string,
    contractEndDate: string,
    DNACodeUnitTime: string,
    DSNWorkQuotaEstablishment: string,
    DSNWorkQuotaWorkContract: string,
    workTime: string,
    ss: string,
    idcc: string,
    mal: string,
    estabWorkPlace: string,
    vieillesse: string,
    pattern: string,
    vacation: string,
    rateProfessionalFess: string,
    foreigner: string,
    exclusionDsn: string,
    statusEmployment: string,
    unemployment: string,
    idPublicEmployer: string,
    methodUnemployment: string,
    joiningDate: string,
    denunciationDate: string,
    dateManagementAgreement: string,
    idAgreement: string,
    healthRiskDelegate: string,
    multipleJobCode: string,
    multipleEmployerCode: string,
    workAccidentRisk: string,
    idWorkAccidentRisk: string,
    positionCollectiveAgreement: string,
    apecita: string,
    rateAt: string,
    contributingFullTime: string,
    tip: string,
    useEstablishmentId: string,
    livePerfomances: string,
    licences: string,
    showId: string,
    showrunner: string,
    fpPcs?: string,
    typePosition?: string,
    fpQuotite?: string,
    partTimeWork?: string,
    serviceCode?: string,
    fpIndice?: string,
    fpIndiceMaj?: string,
    NBI?: string,
    indiceOriginal?: string,
    article15?: string,
    oldEstablishment?: string,
    oldIndice?: string,
    SPP?: string,
    contractual?: string,
    secondment?: string,
    browsing?: string,
    activityDutyRate?: string,
    payLevel?: string,
    echelon?: string,
    coefficient?: string,
    boeth: string,
    addPublicPolicy?: string,
    arrangement?: string,
    finaly?: string,
    navy?: string,
    cnieg?: string,
    activityRate?: string,
    grade?: string,
    cti?: string,
    finess?: string
  }
]

Méthode mutualEmployee

La méthode retourne un tableau d'objets

  [
    {
      employeeId: string,
      option: string,
      pop: string,
      children: string,
      assign: string,
      numberAssign: string,
      otherAssign: string,
      idTechAffiliation: string,
      idTech: string,
      date: string
    }
 ]

Méthode base

La méthode retourne un tableau d'objets

  [
    {
        employeeId: string,
        idBase: string,
        startDate: string,
        endDate: string,
        amount: string,
        idTechAff?: string,
        idContract?: string,
        crm?: string
    }
  ]

Méthode base assujeti

La méthode retourne un tableau d'objets

  [
    {
      typeBaseSubject: string,
      amountBaseSubject: string,
      employeeId: string,
      date: string
    }
  ]

Méthode contribution

La méthode retourne un tableau d'objets

  [
    {
      employeeId: string,
      idContribution: string,
      ops: string,
      baseContribution: string,
      amountContribution: string,
      idInsee?: string,
      crmContribution?: string,
      rateContribution?: string
    }
  ]

La méthode retourne un tableau d'objets

 [
    {
      reasonStop: string,
      lastDayWorked: string,
      estimatedEndDate: string,
      subrogation?: string,
      subrogationStartDate?: string,
      subrogationEndDate?: string,
      iban?: string,
      bic?: string,
      recoveryDate?: string,
      reasonRecovery?: string,
      dateWorkAccident?: string,
      SIRETCentralizer?: string
  }
 ]

La méthode retourne un tableau d'objets

 [
    
    {
      code: string,
      rate: string,
      siret: string,
      date: string
    }
 ]

La méthode retourne un tableau d'objets

 [
    {
        rate: string,
        insee: string
    }
 ]

La méthode retourne un tableau d'objets

 [
    {
      siren: string,
      date: string
      employeeId: string,
      typeBonus: string,
      amountBonus: string,
      dateStartBonus: string,
      dateEndBonus: string,
      contractIdBonus: string,
      datePaymentBonus: string
    }
 ]

About

Cette librairie permet d'extraire les données d'un fichier au format de la Déclaration Sociale Nominative (DSN).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • TypeScript 53.0%
  • JavaScript 47.0%