const _0x4e464e=_0x1cb2;function _0x1cb2(_0x2b3f8a,_0x44642c){_0x2b3f8a=_0x2b3f8a-0x1ab;const _0x1bc506=_0x1bc5();let _0x1cb2a7=_0x1bc506[_0x2b3f8a];return _0x1cb2a7;}function _0x1bc5(){const _0x7053a4=['\x0a\x20\x20\x20\x20SELECT\x20IDfamille_fournisseur\x20ndoc,\x20IDfamille_fournisseur,\x20libelle\x0a\x20\x20\x20\x20FROM\x20famille_fournisseur\x0a\x20\x20\x20\x20order\x20by\x20IDfamille_fournisseur;\x20\x20\x0a\x20\x20\x20\x20','recordset','json','../commun/verificationUtilisation','params','9773272lmfINQ','4897465XMcDTf','/famille_fournisseur/:db','591877tEdLRJ','famille_fournisseur','Router','Mise\x20à\x20jour\x20avec\x20succès','4508484phAWmp','status','IDfamille_fournisseur','6HOUOrm','7436856Wnjvde','send','DELETE\x20FROM\x20famille_fournisseur\x20WHERE\x20IDfamille_fournisseur\x20=\x20\x27','post','/unfamille_fournisseur/:db/:id','body','9GoTjwk','Suppression\x20avec\x20succès','258021ylvqpC','39310GbYVkU'];_0x1bc5=function(){return _0x7053a4;};return _0x1bc5();}(function(_0x1cb8cc,_0x50adf2){const _0x3257f1=_0x1cb2,_0x43cff2=_0x1cb8cc();while(!![]){try{const _0x5f2c40=parseInt(_0x3257f1(0x1b2))/0x1+parseInt(_0x3257f1(0x1c3))/0x2+-parseInt(_0x3257f1(0x1c2))/0x3+-parseInt(_0x3257f1(0x1b6))/0x4+parseInt(_0x3257f1(0x1b0))/0x5*(-parseInt(_0x3257f1(0x1b9))/0x6)+parseInt(_0x3257f1(0x1ba))/0x7+parseInt(_0x3257f1(0x1af))/0x8*(parseInt(_0x3257f1(0x1c0))/0x9);if(_0x5f2c40===_0x50adf2)break;else _0x43cff2['push'](_0x43cff2['shift']());}catch(_0x3723c1){_0x43cff2['push'](_0x43cff2['shift']());}}}(_0x1bc5,0xaba02));const express=require('express'),router=express[_0x4e464e(0x1b4)](),{verifierUtilisation,genererMessageErreur}=require(_0x4e464e(0x1ad));router[_0x4e464e(0x1bd)](_0x4e464e(0x1b1),verifyToken,Context,async(_0x8d3d55,_0xa345a6)=>{const _0x31b1bf=_0x4e464e;let _0x5a9adc;try{_0x5a9adc=_0x31b1bf(0x1c4);const _0x439dd6=await executeQuery(_0x8d3d55[_0x31b1bf(0x1ae)]['db'],_0x5a9adc);_0xa345a6['json'](_0x439dd6['recordset']);}catch(_0x4c5a05){traiterErreur(_0x5a9adc,_0x4c5a05,_0xa345a6,__filename,_0x8d3d55[_0x31b1bf(0x1ae)]['db']);}}),router[_0x4e464e(0x1bd)](_0x4e464e(0x1be),verifyToken,Context,async(_0x4b3be4,_0x41df53)=>{let _0x52d29e;try{_0x52d29e='\x0a\x20\x20\x20\x20\x20\x20SELECT\x20*\x0a\x20\x20\x20\x20\x20\x20FROM\x20famille_fournisseur\x0a\x20\x20\x20\x20\x20\x20WHERE\x20IDfamille_fournisseur\x20=\x20\x27'+_0x4b3be4['params']['id']+'\x27';const _0x51480e=await executeQuery(_0x4b3be4['params']['db'],_0x52d29e);_0x41df53['json'](_0x51480e['recordset'][0x0]);}catch(_0x4f9aa4){traiterErreur(_0x52d29e,_0x4f9aa4,_0x41df53,__filename,_0x4b3be4['params']['db']);}}),router[_0x4e464e(0x1bd)]('/AjouterEtRenvoyerFamille_fournisseur/:db',verifyToken,Context,async(_0x3558d6,_0x353a6)=>{const _0x275a92=_0x4e464e;let _0x191bfc;try{_0x191bfc='\x0a\x20\x20\x20\x20\x20\x20INSERT\x20INTO\x20famille_fournisseur\x20(IDfamille_fournisseur)\x0a\x20\x20\x20\x20\x20\x20SELECT\x20ISNULL(MAX(IDfamille_fournisseur),\x200)\x20+\x201\x20FROM\x20famille_fournisseur;\x0a\x20\x20\x20\x20\x20\x20SELECT\x20TOP\x201\x20*\x0a\x20\x20\x20\x20\x20\x20FROM\x20famille_fournisseur\x0a\x20\x20\x20\x20\x20\x20ORDER\x20BY\x20IDfamille_fournisseur\x20DESC';const _0x5776cc=await executeQuery(_0x3558d6['params']['db'],_0x191bfc);_0x353a6[_0x275a92(0x1b7)](0xc9)[_0x275a92(0x1ac)](_0x5776cc[_0x275a92(0x1ab)][0x0]);}catch(_0x591941){traiterErreur(_0x191bfc,_0x591941,_0x353a6,__filename,_0x3558d6[_0x275a92(0x1ae)]['db']);}}),router[_0x4e464e(0x1bd)]('/enregistrerFamille_fournisseur/:db/:id',verifyToken,Context,async(_0x54709f,_0x32a71b)=>{const _0x34da6e=_0x4e464e;let _0x299e14,_0x5cf743={..._0x54709f[_0x34da6e(0x1bf)]};try{_0x299e14=construireRequeteMiseAJour(_0x34da6e(0x1b3),_0x5cf743,'IDfamille_fournisseur\x20=\x20\x27'+_0x54709f['params']['id']+'\x27',_0x34da6e(0x1b8));const _0x4d34a0=await executeQuery(_0x54709f[_0x34da6e(0x1ae)]['db'],_0x299e14);_0x32a71b['status'](0xc9)[_0x34da6e(0x1ac)]({'message':_0x34da6e(0x1b5)});}catch(_0x36a4f8){traiterErreur(_0x299e14,_0x36a4f8,_0x32a71b,__filename,_0x54709f['params']['db']);}}),router['post']('/supprimerFamille_fournisseur/:db/:id',verifyToken,Context,async(_0xed9ea4,_0x3150f6)=>{const _0x105dc1=_0x4e464e;let _0x35ff01;try{const _0x33869c=_0xed9ea4['params']['id'],_0x5e8a9f=await verifierUtilisation(_0xed9ea4[_0x105dc1(0x1ae)]['db'],'famille_fournisseur',_0x33869c);if(_0x5e8a9f['estUtilise'])return _0x3150f6['status'](0x190)[_0x105dc1(0x1ac)]({'message':genererMessageErreur(_0x105dc1(0x1b3),_0x5e8a9f['utilisations'])});_0x35ff01=_0x105dc1(0x1bc)+_0x33869c+'\x27',await executeQuery(_0xed9ea4[_0x105dc1(0x1ae)]['db'],_0x35ff01),_0x3150f6['status'](0xc8)[_0x105dc1(0x1bb)](_0x105dc1(0x1c1));}catch(_0x5e5b73){traiterErreur(_0x35ff01,_0x5e5b73,_0x3150f6,__filename,_0xed9ea4[_0x105dc1(0x1ae)]['db']);}}),module['exports']=router;