@airporting/tech-app 0.0.50 → 0.0.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mf/9669.js +1 -1
- package/dist/mf/@mf-types/compiled-types/api/tech/etatSaisie/dossiersQuery.d.ts +1 -0
- package/dist/mf/@mf-types/compiled-types/api/tech/etatSaisie/setManagedMutation.d.ts +6 -0
- package/dist/mf/@mf-types/compiled-types/apps/etat-saisie/DossiersTab.d.ts +1 -0
- package/dist/mf/@mf-types/compiled-types/apps/etat-saisie/ManagedBadge.d.ts +3 -0
- package/dist/mf/@mf-types/compiled-types/apps/etat-saisie/ProviderIcon.d.ts +3 -0
- package/dist/mf/@mf-types/compiled-types/apps/etat-saisie/logoDev.d.ts +1 -0
- package/dist/mf/@mf-types/compiled-types/gen/TechApi/index.d.ts +76 -0
- package/dist/mf/@mf-types.zip +0 -0
- package/dist/mf/__federation_expose_etat_saisie.js +1 -1
- package/dist/mf/index.js +3 -3
- package/dist/mf/mf-manifest.json +1 -1
- package/dist/mf/mf-stats.json +8 -8
- package/dist/mf/tech_app.js +3 -3
- package/package.json +1 -1
package/dist/mf/9669.js
CHANGED
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
*
|
|
8
8
|
* This source code is licensed under the MIT license found in the
|
|
9
9
|
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var REACT_ELEMENT_TYPE=Symbol.for("react.transitional.element"),REACT_FRAGMENT_TYPE=Symbol.for("react.fragment");function jsxProd(type,config,maybeKey){var key=null;void 0!==maybeKey&&(key=""+maybeKey);void 0!==config.key&&(key=""+config.key);if("key"in config){maybeKey={};for(var propName in config)"key"!==propName&&(maybeKey[propName]=config[propName])}else maybeKey=config;config=maybeKey.ref;return{$$typeof:REACT_ELEMENT_TYPE,type:type,key:key,ref:void 0!==config?config:null,props:maybeKey}}exports.Fragment=REACT_FRAGMENT_TYPE;exports.jsx=jsxProd;exports.jsxs=jsxProd},5893:function(module,__unused_webpack_exports,__webpack_require__){module.exports=__webpack_require__(631)},4148:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{h:()=>useApi});var _src_gen_TechApi_index_ts__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(9056);var _src_hooks_useAppConfig_ts__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(7936);function useApi(){const config=(0,_src_hooks_useAppConfig_ts__WEBPACK_IMPORTED_MODULE_0__.M)();const client=new _src_gen_TechApi_index_ts__WEBPACK_IMPORTED_MODULE_1__.eN({baseUrl:config.api.replace(/\/$/,""),baseApiParams:{headers:{Authorization:config.token?`Bearer ${config.token}`:"",From:config.owner}}});return new _src_gen_TechApi_index_ts__WEBPACK_IMPORTED_MODULE_1__.eT(client)}},9056:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{eN:()=>HttpClient,eT:()=>TechApi});class HttpClient{baseUrl="";securityData=null;securityWorker;abortControllers=new Map;customFetch=(...fetchParams)=>fetch(...fetchParams);baseApiParams={credentials:"same-origin",headers:{},redirect:"follow",referrerPolicy:"no-referrer"};constructor(apiConfig={}){Object.assign(this,apiConfig)}setSecurityData=data=>{this.securityData=data};encodeQueryParam(key,value){const encodedKey=encodeURIComponent(key);return`${encodedKey}=${encodeURIComponent("number"==typeof value?value:`${value}`)}`}addQueryParam(query,key){return this.encodeQueryParam(key,query[key])}addArrayQueryParam(query,key){const value=query[key];return value.map(v=>this.encodeQueryParam(key,v)).join("&")}toQueryString(rawQuery){const query=rawQuery||{};const keys=Object.keys(query).filter(key=>void 0!==query[key]);return keys.map(key=>Array.isArray(query[key])?this.addArrayQueryParam(query,key):this.addQueryParam(query,key)).join("&")}addQueryParams(rawQuery){const queryString=this.toQueryString(rawQuery);return queryString?`?${queryString}`:""}contentFormatters={["application/json"]:input=>null!==input&&("object"==typeof input||"string"==typeof input)?JSON.stringify(input):input,["application/vnd.api+json"]:input=>null!==input&&("object"==typeof input||"string"==typeof input)?JSON.stringify(input):input,["text/plain"]:input=>null!==input&&"string"!=typeof input?JSON.stringify(input):input,["multipart/form-data"]:input=>{if(input instanceof FormData)return input;return Object.keys(input||{}).reduce((formData,key)=>{const property=input[key];formData.append(key,property instanceof Blob?property:"object"==typeof property&&null!==property?JSON.stringify(property):`${property}`);return formData},new FormData)},["application/x-www-form-urlencoded"]:input=>this.toQueryString(input)};mergeRequestParams(params1,params2){return{...this.baseApiParams,...params1,...params2||{},headers:{...this.baseApiParams.headers||{},...params1.headers||{},...params2&¶ms2.headers||{}}}}createAbortSignal=cancelToken=>{if(this.abortControllers.has(cancelToken)){const abortController=this.abortControllers.get(cancelToken);if(abortController)return abortController.signal;return}const abortController=new AbortController;this.abortControllers.set(cancelToken,abortController);return abortController.signal};abortRequest=cancelToken=>{const abortController=this.abortControllers.get(cancelToken);if(abortController){abortController.abort();this.abortControllers.delete(cancelToken)}};request=async({body,secure,path,type,query,format,baseUrl,cancelToken,...params})=>{const secureParams=("boolean"==typeof secure?secure:this.baseApiParams.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{};const requestParams=this.mergeRequestParams(params,secureParams);const queryString=query&&this.toQueryString(query);const payloadFormatter=this.contentFormatters[type||"application/json"];const responseFormat=format||requestParams.format;return this.customFetch(`${baseUrl||this.baseUrl||""}${path}${queryString?`?${queryString}`:""}`,{...requestParams,headers:{...requestParams.headers||{},...type&&"multipart/form-data"!==type?{"Content-Type":type}:{}},signal:(cancelToken?this.createAbortSignal(cancelToken):requestParams.signal)||null,body:null==body?null:payloadFormatter(body)}).then(async response=>{const r=response;r.data=null;r.error=null;const responseToParse=responseFormat?response.clone():response;const data=responseFormat?await responseToParse[responseFormat]().then(data=>{if(r.ok)r.data=data;else r.error=data;return r}).catch(e=>{r.error=e;return r}):r;if(cancelToken)this.abortControllers.delete(cancelToken);if(!response.ok)throw data;return data})}}class TechApi{http;constructor(http){this.http=http}status=(params={})=>this.http.request({path:"/status",method:"GET",...params});getDashboard=(params={})=>this.http.request({path:"/dashboard",method:"GET",format:"json",...params});getCompanies=(params={})=>this.http.request({path:"/companies",method:"GET",format:"json",...params});webhook={postSmsWebhook:(query,params={})=>this.http.request({path:"/sms/webhook",method:"POST",query:query,...params})};amex={getTransactionsV1:(query,params={})=>this.http.request({path:"/v1/amex/transactions",method:"GET",query:query,...params})};etatSaisie={getLatestV1:(params={})=>this.http.request({path:"/v1/etat-saisie/latest",method:"GET",format:"json",...params}),recomputeV1:(params={})=>this.http.request({path:"/v1/etat-saisie/recompute",method:"POST",format:"json",...params})};financeJobs={getStockV1:(params={})=>this.http.request({path:"/v1/finance-jobs/stock",method:"GET",format:"json",...params}),listTasksV1:(query,params={})=>this.http.request({path:"/v1/finance-jobs/tasks",method:"GET",query:query,format:"json",...params}),unstickV1:({id,...query},params={})=>this.http.request({path:`/v1/finance-jobs/tasks/${id}/unstick`,method:"POST",format:"json",...params}),retryV1:({id,...query},params={})=>this.http.request({path:`/v1/finance-jobs/tasks/${id}/retry`,method:"POST",format:"json",...params}),discardV1:({id,...query},params={})=>this.http.request({path:`/v1/finance-jobs/tasks/${id}/discard`,method:"POST",format:"json",...params}),setOwnerV1:({id,...query},data,params={})=>this.http.request({path:`/v1/finance-jobs/tasks/${id}/owner`,method:"PUT",body:data,type:"application/json",format:"json",...params}),deleteRedisLockV1:({id,...query},params={})=>this.http.request({path:`/v1/finance-jobs/tasks/${id}/redis-lock`,method:"DELETE",format:"json",...params}),runRecipeV1:(data,params={})=>this.http.request({path:"/v1/finance-jobs/run-recipe",method:"POST",body:data,type:"application/json",format:"json",...params}),getRunnersV1:(params={})=>this.http.request({path:"/v1/finance-jobs/runners",method:"GET",format:"json",...params})};github={getJobsRunnersV1:(params={})=>this.http.request({path:"/v1/github/jobs/runners",method:"GET",format:"json",...params}),getLabelsV1:({host,...query},params={})=>this.http.request({path:`/v1/github/labels/${host}`,method:"GET",format:"json",...params}),getJobLogsV1:(query,params={})=>this.http.request({path:"/v1/github/job-logs",method:"GET",query:query,format:"json",...params})};gsheet={getStockV1:(params={})=>this.http.request({path:"/v1/gsheet/stock",method:"GET",format:"json",...params}),listTasksV1:(query,params={})=>this.http.request({path:"/v1/gsheet/tasks",method:"GET",query:query,format:"json",...params}),unstickV1:({id,...query},params={})=>this.http.request({path:`/v1/gsheet/tasks/${id}/unstick`,method:"POST",format:"json",...params}),discardV1:({id,...query},params={})=>this.http.request({path:`/v1/gsheet/tasks/${id}/discard`,method:"POST",format:"json",...params}),setOwnerV1:({id,...query},data,params={})=>this.http.request({path:`/v1/gsheet/tasks/${id}/owner`,method:"PUT",body:data,type:"application/json",format:"json",...params}),deleteRedisLockV1:({id,...query},params={})=>this.http.request({path:`/v1/gsheet/tasks/${id}/redis-lock`,method:"DELETE",format:"json",...params})};notion={getKikouV1:(params={})=>this.http.request({path:"/v1/notion/kikou",method:"GET",format:"json",...params})};payfit={getChartV1:(query,params={})=>this.http.request({path:"/v1/payfit/chart",method:"GET",query:query,...params})};sobank={getExportsV1:(query,params={})=>this.http.request({path:"/v1/sobank/exports",method:"GET",query:query,format:"json",...params})};synchro={getRunStatsV1:(params={})=>this.http.request({path:"/v1/synchro/run/stats",method:"GET",format:"json",...params}),getTasksV1:(query,params={})=>this.http.request({path:"/v1/synchro/tasks",method:"GET",query:query,format:"json",...params}),getJobsDefaultsV1:(params={})=>this.http.request({path:"/v1/synchro/jobs/defaults",method:"GET",format:"json",...params}),putStopTaskV1:({id,...query},params={})=>this.http.request({path:`/v1/synchro/tasks/stop/${id}`,method:"PUT",...params}),resetOwnerStatsV1:({owner,value,...query},params={})=>this.http.request({path:`/v1/synchro/run/stats/${owner}/${value}`,method:"PUT",...params})}}},7936:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{$:()=>AppConfigProvider,M:()=>useAppConfig});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(3106);const AppConfigCtx=(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null);const AppConfigProvider=AppConfigCtx.Provider;function useAppConfig(){const config=(0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(AppConfigCtx);if(!config)throw new Error("Called `useAppConfig` outside a `<AppConfigProvider />`");return config}},7034:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{C:()=>Providers});var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(5893);var _airporting_app_front__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(1380);var _mantine_core__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(207);var _mantine_modals__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(4142);var _mantine_notifications__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(1455);var _tanstack_react_query__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(6197);var radash__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(9877);var _hooks_useAppConfig__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(7936);const theme=(0,_mantine_core__WEBPACK_IMPORTED_MODULE_2__.createTheme)((0,radash__WEBPACK_IMPORTED_MODULE_6__.assign)(_airporting_app_front__WEBPACK_IMPORTED_MODULE_1__.theme,{components:{}}));const cssVarResolver=x=>(0,radash__WEBPACK_IMPORTED_MODULE_6__.assign)(_airporting_app_front__WEBPACK_IMPORTED_MODULE_1__.cssVarResolver(x),{dark:{},light:{},variables:{}});function Providers(props){const{children,config,mantine,tanstack}=props;return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_hooks_useAppConfig__WEBPACK_IMPORTED_MODULE_7__.$,{value:config,children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tanstack_react_query__WEBPACK_IMPORTED_MODULE_5__.QueryClientProvider,{client:tanstack?.queryClient??new _tanstack_react_query__WEBPACK_IMPORTED_MODULE_5__.QueryClient,children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_2__.MantineProvider,{theme:theme,cssVariablesResolver:cssVarResolver,defaultColorScheme:mantine?.defaultColorScheme,forceColorScheme:mantine?.forceColorScheme,children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_modals__WEBPACK_IMPORTED_MODULE_3__.ModalsProvider,{children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_notifications__WEBPACK_IMPORTED_MODULE_4__.Notifications,{}),children]})})})})}}}]);
|
|
10
|
+
*/var REACT_ELEMENT_TYPE=Symbol.for("react.transitional.element"),REACT_FRAGMENT_TYPE=Symbol.for("react.fragment");function jsxProd(type,config,maybeKey){var key=null;void 0!==maybeKey&&(key=""+maybeKey);void 0!==config.key&&(key=""+config.key);if("key"in config){maybeKey={};for(var propName in config)"key"!==propName&&(maybeKey[propName]=config[propName])}else maybeKey=config;config=maybeKey.ref;return{$$typeof:REACT_ELEMENT_TYPE,type:type,key:key,ref:void 0!==config?config:null,props:maybeKey}}exports.Fragment=REACT_FRAGMENT_TYPE;exports.jsx=jsxProd;exports.jsxs=jsxProd},5893:function(module,__unused_webpack_exports,__webpack_require__){module.exports=__webpack_require__(631)},4148:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{h:()=>useApi});var _src_gen_TechApi_index_ts__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(9056);var _src_hooks_useAppConfig_ts__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(7936);function useApi(){const config=(0,_src_hooks_useAppConfig_ts__WEBPACK_IMPORTED_MODULE_0__.M)();const client=new _src_gen_TechApi_index_ts__WEBPACK_IMPORTED_MODULE_1__.eN({baseUrl:config.api.replace(/\/$/,""),baseApiParams:{headers:{Authorization:config.token?`Bearer ${config.token}`:"",From:config.owner}}});return new _src_gen_TechApi_index_ts__WEBPACK_IMPORTED_MODULE_1__.eT(client)}},9056:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{eN:()=>HttpClient,eT:()=>TechApi});class HttpClient{baseUrl="";securityData=null;securityWorker;abortControllers=new Map;customFetch=(...fetchParams)=>fetch(...fetchParams);baseApiParams={credentials:"same-origin",headers:{},redirect:"follow",referrerPolicy:"no-referrer"};constructor(apiConfig={}){Object.assign(this,apiConfig)}setSecurityData=data=>{this.securityData=data};encodeQueryParam(key,value){const encodedKey=encodeURIComponent(key);return`${encodedKey}=${encodeURIComponent("number"==typeof value?value:`${value}`)}`}addQueryParam(query,key){return this.encodeQueryParam(key,query[key])}addArrayQueryParam(query,key){const value=query[key];return value.map(v=>this.encodeQueryParam(key,v)).join("&")}toQueryString(rawQuery){const query=rawQuery||{};const keys=Object.keys(query).filter(key=>void 0!==query[key]);return keys.map(key=>Array.isArray(query[key])?this.addArrayQueryParam(query,key):this.addQueryParam(query,key)).join("&")}addQueryParams(rawQuery){const queryString=this.toQueryString(rawQuery);return queryString?`?${queryString}`:""}contentFormatters={["application/json"]:input=>null!==input&&("object"==typeof input||"string"==typeof input)?JSON.stringify(input):input,["application/vnd.api+json"]:input=>null!==input&&("object"==typeof input||"string"==typeof input)?JSON.stringify(input):input,["text/plain"]:input=>null!==input&&"string"!=typeof input?JSON.stringify(input):input,["multipart/form-data"]:input=>{if(input instanceof FormData)return input;return Object.keys(input||{}).reduce((formData,key)=>{const property=input[key];formData.append(key,property instanceof Blob?property:"object"==typeof property&&null!==property?JSON.stringify(property):`${property}`);return formData},new FormData)},["application/x-www-form-urlencoded"]:input=>this.toQueryString(input)};mergeRequestParams(params1,params2){return{...this.baseApiParams,...params1,...params2||{},headers:{...this.baseApiParams.headers||{},...params1.headers||{},...params2&¶ms2.headers||{}}}}createAbortSignal=cancelToken=>{if(this.abortControllers.has(cancelToken)){const abortController=this.abortControllers.get(cancelToken);if(abortController)return abortController.signal;return}const abortController=new AbortController;this.abortControllers.set(cancelToken,abortController);return abortController.signal};abortRequest=cancelToken=>{const abortController=this.abortControllers.get(cancelToken);if(abortController){abortController.abort();this.abortControllers.delete(cancelToken)}};request=async({body,secure,path,type,query,format,baseUrl,cancelToken,...params})=>{const secureParams=("boolean"==typeof secure?secure:this.baseApiParams.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{};const requestParams=this.mergeRequestParams(params,secureParams);const queryString=query&&this.toQueryString(query);const payloadFormatter=this.contentFormatters[type||"application/json"];const responseFormat=format||requestParams.format;return this.customFetch(`${baseUrl||this.baseUrl||""}${path}${queryString?`?${queryString}`:""}`,{...requestParams,headers:{...requestParams.headers||{},...type&&"multipart/form-data"!==type?{"Content-Type":type}:{}},signal:(cancelToken?this.createAbortSignal(cancelToken):requestParams.signal)||null,body:null==body?null:payloadFormatter(body)}).then(async response=>{const r=response;r.data=null;r.error=null;const responseToParse=responseFormat?response.clone():response;const data=responseFormat?await responseToParse[responseFormat]().then(data=>{if(r.ok)r.data=data;else r.error=data;return r}).catch(e=>{r.error=e;return r}):r;if(cancelToken)this.abortControllers.delete(cancelToken);if(!response.ok)throw data;return data})}}class TechApi{http;constructor(http){this.http=http}status=(params={})=>this.http.request({path:"/status",method:"GET",...params});getDashboard=(params={})=>this.http.request({path:"/dashboard",method:"GET",format:"json",...params});getCompanies=(params={})=>this.http.request({path:"/companies",method:"GET",format:"json",...params});webhook={postSmsWebhook:(query,params={})=>this.http.request({path:"/sms/webhook",method:"POST",query:query,...params})};amex={getTransactionsV1:(query,params={})=>this.http.request({path:"/v1/amex/transactions",method:"GET",query:query,...params})};etatSaisie={getLatestV1:(params={})=>this.http.request({path:"/v1/etat-saisie/latest",method:"GET",format:"json",...params}),getDossiersV1:(params={})=>this.http.request({path:"/v1/etat-saisie/dossiers",method:"GET",format:"json",...params}),setManagedV1:({id,...query},data,params={})=>this.http.request({path:`/v1/etat-saisie/dossiers/${id}`,method:"PATCH",body:data,type:"application/json",format:"json",...params}),recomputeV1:(params={})=>this.http.request({path:"/v1/etat-saisie/recompute",method:"POST",format:"json",...params})};financeJobs={getStockV1:(params={})=>this.http.request({path:"/v1/finance-jobs/stock",method:"GET",format:"json",...params}),listTasksV1:(query,params={})=>this.http.request({path:"/v1/finance-jobs/tasks",method:"GET",query:query,format:"json",...params}),unstickV1:({id,...query},params={})=>this.http.request({path:`/v1/finance-jobs/tasks/${id}/unstick`,method:"POST",format:"json",...params}),retryV1:({id,...query},params={})=>this.http.request({path:`/v1/finance-jobs/tasks/${id}/retry`,method:"POST",format:"json",...params}),discardV1:({id,...query},params={})=>this.http.request({path:`/v1/finance-jobs/tasks/${id}/discard`,method:"POST",format:"json",...params}),setOwnerV1:({id,...query},data,params={})=>this.http.request({path:`/v1/finance-jobs/tasks/${id}/owner`,method:"PUT",body:data,type:"application/json",format:"json",...params}),deleteRedisLockV1:({id,...query},params={})=>this.http.request({path:`/v1/finance-jobs/tasks/${id}/redis-lock`,method:"DELETE",format:"json",...params}),runRecipeV1:(data,params={})=>this.http.request({path:"/v1/finance-jobs/run-recipe",method:"POST",body:data,type:"application/json",format:"json",...params}),getRunnersV1:(params={})=>this.http.request({path:"/v1/finance-jobs/runners",method:"GET",format:"json",...params})};github={getJobsRunnersV1:(params={})=>this.http.request({path:"/v1/github/jobs/runners",method:"GET",format:"json",...params}),getLabelsV1:({host,...query},params={})=>this.http.request({path:`/v1/github/labels/${host}`,method:"GET",format:"json",...params}),getJobLogsV1:(query,params={})=>this.http.request({path:"/v1/github/job-logs",method:"GET",query:query,format:"json",...params})};gsheet={getStockV1:(params={})=>this.http.request({path:"/v1/gsheet/stock",method:"GET",format:"json",...params}),listTasksV1:(query,params={})=>this.http.request({path:"/v1/gsheet/tasks",method:"GET",query:query,format:"json",...params}),unstickV1:({id,...query},params={})=>this.http.request({path:`/v1/gsheet/tasks/${id}/unstick`,method:"POST",format:"json",...params}),discardV1:({id,...query},params={})=>this.http.request({path:`/v1/gsheet/tasks/${id}/discard`,method:"POST",format:"json",...params}),setOwnerV1:({id,...query},data,params={})=>this.http.request({path:`/v1/gsheet/tasks/${id}/owner`,method:"PUT",body:data,type:"application/json",format:"json",...params}),deleteRedisLockV1:({id,...query},params={})=>this.http.request({path:`/v1/gsheet/tasks/${id}/redis-lock`,method:"DELETE",format:"json",...params})};notion={getKikouV1:(params={})=>this.http.request({path:"/v1/notion/kikou",method:"GET",format:"json",...params})};payfit={getChartV1:(query,params={})=>this.http.request({path:"/v1/payfit/chart",method:"GET",query:query,...params})};sobank={getExportsV1:(query,params={})=>this.http.request({path:"/v1/sobank/exports",method:"GET",query:query,format:"json",...params})};synchro={getRunStatsV1:(params={})=>this.http.request({path:"/v1/synchro/run/stats",method:"GET",format:"json",...params}),getTasksV1:(query,params={})=>this.http.request({path:"/v1/synchro/tasks",method:"GET",query:query,format:"json",...params}),getJobsDefaultsV1:(params={})=>this.http.request({path:"/v1/synchro/jobs/defaults",method:"GET",format:"json",...params}),putStopTaskV1:({id,...query},params={})=>this.http.request({path:`/v1/synchro/tasks/stop/${id}`,method:"PUT",...params}),resetOwnerStatsV1:({owner,value,...query},params={})=>this.http.request({path:`/v1/synchro/run/stats/${owner}/${value}`,method:"PUT",...params})}}},7936:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{$:()=>AppConfigProvider,M:()=>useAppConfig});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(3106);const AppConfigCtx=(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null);const AppConfigProvider=AppConfigCtx.Provider;function useAppConfig(){const config=(0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(AppConfigCtx);if(!config)throw new Error("Called `useAppConfig` outside a `<AppConfigProvider />`");return config}},7034:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{C:()=>Providers});var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(5893);var _airporting_app_front__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(1380);var _mantine_core__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(207);var _mantine_modals__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(4142);var _mantine_notifications__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(1455);var _tanstack_react_query__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(6197);var radash__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(9877);var _hooks_useAppConfig__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(7936);const theme=(0,_mantine_core__WEBPACK_IMPORTED_MODULE_2__.createTheme)((0,radash__WEBPACK_IMPORTED_MODULE_6__.assign)(_airporting_app_front__WEBPACK_IMPORTED_MODULE_1__.theme,{components:{}}));const cssVarResolver=x=>(0,radash__WEBPACK_IMPORTED_MODULE_6__.assign)(_airporting_app_front__WEBPACK_IMPORTED_MODULE_1__.cssVarResolver(x),{dark:{},light:{},variables:{}});function Providers(props){const{children,config,mantine,tanstack}=props;return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_hooks_useAppConfig__WEBPACK_IMPORTED_MODULE_7__.$,{value:config,children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tanstack_react_query__WEBPACK_IMPORTED_MODULE_5__.QueryClientProvider,{client:tanstack?.queryClient??new _tanstack_react_query__WEBPACK_IMPORTED_MODULE_5__.QueryClient,children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_2__.MantineProvider,{theme:theme,cssVariablesResolver:cssVarResolver,defaultColorScheme:mantine?.defaultColorScheme,forceColorScheme:mantine?.forceColorScheme,children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_modals__WEBPACK_IMPORTED_MODULE_3__.ModalsProvider,{children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_notifications__WEBPACK_IMPORTED_MODULE_4__.Notifications,{}),children]})})})})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useDossiers(): import("@tanstack/react-query").UseQueryResult<import("../../../gen/TechApi/index.ts").EtatSaisieDossierMapItem[], Error>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type SetManagedVariables = {
|
|
2
|
+
id: number;
|
|
3
|
+
managed: boolean;
|
|
4
|
+
};
|
|
5
|
+
export declare function useSetManaged(): import("@tanstack/react-query").UseMutationResult<import("../../../gen/TechApi/index.ts").SetManagedResponse, Error, SetManagedVariables, unknown>;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function DossiersTab(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function logoDevUrl(domain: string): string;
|
|
@@ -28,6 +28,7 @@ export interface EtatSaisieCustomerRow {
|
|
|
28
28
|
client: string;
|
|
29
29
|
devise: string;
|
|
30
30
|
dossier: string;
|
|
31
|
+
managed: boolean;
|
|
31
32
|
nb_ecritures: number;
|
|
32
33
|
solde_crediteur_eur: number;
|
|
33
34
|
source: string;
|
|
@@ -36,12 +37,21 @@ export interface EtatSaisieDossierLine {
|
|
|
36
37
|
dossier: string;
|
|
37
38
|
gla_active: boolean;
|
|
38
39
|
last_entry_date: string | null;
|
|
40
|
+
managed: boolean;
|
|
41
|
+
reason: string | null;
|
|
39
42
|
solde_attente_eur: number;
|
|
40
43
|
source: string;
|
|
41
44
|
status: string;
|
|
42
45
|
total_clients_eur: number;
|
|
43
46
|
total_fournisseurs_eur: number;
|
|
44
47
|
}
|
|
48
|
+
export interface EtatSaisieDossierMapItem {
|
|
49
|
+
airporting_id: number;
|
|
50
|
+
display_name: string;
|
|
51
|
+
managed: boolean;
|
|
52
|
+
provider: string;
|
|
53
|
+
slug: string;
|
|
54
|
+
}
|
|
45
55
|
export interface EtatSaisieSummary {
|
|
46
56
|
top_5_customer_creditors: EtatSaisieTopCustomerItem[];
|
|
47
57
|
top_5_supplier_debtors: EtatSaisieTopSupplierItem[];
|
|
@@ -55,6 +65,7 @@ export interface EtatSaisieSupplierRow {
|
|
|
55
65
|
devise: string;
|
|
56
66
|
dossier: string;
|
|
57
67
|
fournisseur: string;
|
|
68
|
+
managed: boolean;
|
|
58
69
|
nb_ecritures: number;
|
|
59
70
|
solde_debiteur_eur: number;
|
|
60
71
|
source: string;
|
|
@@ -69,6 +80,7 @@ export interface EtatSaisieSuspenseRow {
|
|
|
69
80
|
lettre: boolean;
|
|
70
81
|
libelle_compte: string | null;
|
|
71
82
|
libelle_ecriture: string | null;
|
|
83
|
+
managed: boolean;
|
|
72
84
|
numero_compte: string | null;
|
|
73
85
|
numero_piece: string | null;
|
|
74
86
|
solde_net: number;
|
|
@@ -76,6 +88,7 @@ export interface EtatSaisieSuspenseRow {
|
|
|
76
88
|
}
|
|
77
89
|
export interface EtatSaisieTopCustomerItem {
|
|
78
90
|
dossier: string;
|
|
91
|
+
managed: boolean;
|
|
79
92
|
nb_clients: number;
|
|
80
93
|
rank: number;
|
|
81
94
|
source: string;
|
|
@@ -85,6 +98,7 @@ export interface EtatSaisieTopCustomerItem {
|
|
|
85
98
|
}
|
|
86
99
|
export interface EtatSaisieTopSupplierItem {
|
|
87
100
|
dossier: string;
|
|
101
|
+
managed: boolean;
|
|
88
102
|
nb_fournisseurs: number;
|
|
89
103
|
rank: number;
|
|
90
104
|
source: string;
|
|
@@ -94,6 +108,7 @@ export interface EtatSaisieTopSupplierItem {
|
|
|
94
108
|
}
|
|
95
109
|
export interface EtatSaisieTopSuspenseItem {
|
|
96
110
|
dossier: string;
|
|
111
|
+
managed: boolean;
|
|
97
112
|
nb_ecritures: number;
|
|
98
113
|
rank: number;
|
|
99
114
|
solde_eur: number;
|
|
@@ -188,6 +203,9 @@ export interface GetDashboardResponse {
|
|
|
188
203
|
pennylane: GetDashboardPennylaneResponse;
|
|
189
204
|
synchro: GetSynchroDashboardResponse;
|
|
190
205
|
}
|
|
206
|
+
export interface GetEtatSaisieDossiersResponse {
|
|
207
|
+
dossiers: EtatSaisieDossierMapItem[];
|
|
208
|
+
}
|
|
191
209
|
export interface GetEtatSaisieLatestResponse {
|
|
192
210
|
as_of: string | null;
|
|
193
211
|
available: boolean;
|
|
@@ -224,6 +242,7 @@ export interface GetFinanceJobsStockResponse {
|
|
|
224
242
|
byOwner: FinanceJobsBreakdownEntry[];
|
|
225
243
|
done_today: number;
|
|
226
244
|
errored: number;
|
|
245
|
+
errored_today: number;
|
|
227
246
|
oldest: {
|
|
228
247
|
ageHours: number;
|
|
229
248
|
created: string;
|
|
@@ -433,6 +452,15 @@ export interface SetFinanceJobsOwnerBody {
|
|
|
433
452
|
export interface SetGsheetOwnerBody {
|
|
434
453
|
owner: string;
|
|
435
454
|
}
|
|
455
|
+
export interface SetManagedBody {
|
|
456
|
+
managed: boolean;
|
|
457
|
+
}
|
|
458
|
+
export interface SetManagedResponse {
|
|
459
|
+
ok: boolean;
|
|
460
|
+
}
|
|
461
|
+
export interface SetManagedV1Params {
|
|
462
|
+
id: number;
|
|
463
|
+
}
|
|
436
464
|
export interface SetOwnerV1Params {
|
|
437
465
|
id: number;
|
|
438
466
|
}
|
|
@@ -545,6 +573,36 @@ export declare namespace EtatSaisie {
|
|
|
545
573
|
type RequestHeaders = {};
|
|
546
574
|
type ResponseBody = GetEtatSaisieLatestResponse;
|
|
547
575
|
}
|
|
576
|
+
/**
|
|
577
|
+
* No description
|
|
578
|
+
* @tags EtatSaisie
|
|
579
|
+
* @name GetDossiersV1
|
|
580
|
+
* @request GET:/v1/etat-saisie/dossiers
|
|
581
|
+
* @response `200` `GetEtatSaisieDossiersResponse`
|
|
582
|
+
*/
|
|
583
|
+
namespace GetDossiersV1 {
|
|
584
|
+
type RequestParams = {};
|
|
585
|
+
type RequestQuery = {};
|
|
586
|
+
type RequestBody = never;
|
|
587
|
+
type RequestHeaders = {};
|
|
588
|
+
type ResponseBody = GetEtatSaisieDossiersResponse;
|
|
589
|
+
}
|
|
590
|
+
/**
|
|
591
|
+
* No description
|
|
592
|
+
* @tags EtatSaisie
|
|
593
|
+
* @name SetManagedV1
|
|
594
|
+
* @request PATCH:/v1/etat-saisie/dossiers/{id}
|
|
595
|
+
* @response `200` `SetManagedResponse`
|
|
596
|
+
*/
|
|
597
|
+
namespace SetManagedV1 {
|
|
598
|
+
type RequestParams = {
|
|
599
|
+
id: number;
|
|
600
|
+
};
|
|
601
|
+
type RequestQuery = {};
|
|
602
|
+
type RequestBody = SetManagedBody;
|
|
603
|
+
type RequestHeaders = {};
|
|
604
|
+
type ResponseBody = SetManagedResponse;
|
|
605
|
+
}
|
|
548
606
|
/**
|
|
549
607
|
* No description
|
|
550
608
|
* @tags EtatSaisie
|
|
@@ -1125,6 +1183,24 @@ export declare class TechApi<SecurityDataType extends unknown> {
|
|
|
1125
1183
|
* @response `200` `GetEtatSaisieLatestResponse`
|
|
1126
1184
|
*/
|
|
1127
1185
|
getLatestV1: (params?: RequestParams) => Promise<HttpResponse<GetEtatSaisieLatestResponse, any>>;
|
|
1186
|
+
/**
|
|
1187
|
+
* No description
|
|
1188
|
+
*
|
|
1189
|
+
* @tags EtatSaisie
|
|
1190
|
+
* @name GetDossiersV1
|
|
1191
|
+
* @request GET:/v1/etat-saisie/dossiers
|
|
1192
|
+
* @response `200` `GetEtatSaisieDossiersResponse`
|
|
1193
|
+
*/
|
|
1194
|
+
getDossiersV1: (params?: RequestParams) => Promise<HttpResponse<GetEtatSaisieDossiersResponse, any>>;
|
|
1195
|
+
/**
|
|
1196
|
+
* No description
|
|
1197
|
+
*
|
|
1198
|
+
* @tags EtatSaisie
|
|
1199
|
+
* @name SetManagedV1
|
|
1200
|
+
* @request PATCH:/v1/etat-saisie/dossiers/{id}
|
|
1201
|
+
* @response `200` `SetManagedResponse`
|
|
1202
|
+
*/
|
|
1203
|
+
setManagedV1: ({ id, ...query }: SetManagedV1Params, data: SetManagedBody, params?: RequestParams) => Promise<HttpResponse<SetManagedResponse, any>>;
|
|
1128
1204
|
/**
|
|
1129
1205
|
* No description
|
|
1130
1206
|
*
|
package/dist/mf/@mf-types.zip
CHANGED
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(globalThis["chunk_tech_app"]=globalThis["chunk_tech_app"]||[]).push([["7915"],{1354:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{m:()=>PageHeader});var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(5893);var _mantine_core__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(207);var _tabler_icons_react__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(9632);var react__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(3106);function formatRelative(now,then){const seconds=Math.max(0,Math.floor((now-then)/1e3));if(seconds<5)return"\xe0 l’instant";if(seconds<60)return`il y a ${seconds}s`;const minutes=Math.floor(seconds/60);if(minutes<60)return`il y a ${minutes} min`;const hours=Math.floor(minutes/60);return`il y a ${hours} h`}function PageHeader({title,badge,updatedAt,isFetching,isError,onRefresh,actions}){const[now,setNow]=(0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(()=>Date.now());(0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(()=>{if(!updatedAt)return;const id=window.setInterval(()=>setNow(Date.now()),1e3);return()=>window.clearInterval(id)},[updatedAt]);const relative=updatedAt?formatRelative(now,updatedAt):null;const color=isError?"orange":isFetching?"teal":"dimmed";return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{justify:"space-between",align:"center",mih:48,mb:"md",children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{gap:"sm",align:"center",children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Title,{order:2,children:title}),badge]}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{gap:"sm",align:"center",children:[relative&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Text,{size:"xs",c:color,fw:isFetching?600:400,"data-testid":"page-header-freshness",children:isError?"\xe9chec maj":isFetching?"maj…":relative}),onRefresh&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Tooltip,{label:"Rafra\xeechir",children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.ActionIcon,{variant:"default",size:"md",onClick:onRefresh,loading:isFetching,"aria-label":"Refresh",children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_2__.IconRefresh,{size:16})})}),actions]})]})}},7497:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{default:()=>EtatSaisie});var jsx_runtime=__webpack_require__(5893);var index_js_=__webpack_require__(3106);var providers=__webpack_require__(7034);var index_mjs_=__webpack_require__(207);var modern_index_js_=__webpack_require__(6197);var useApi=__webpack_require__(4148);function useEtatSaisieLatest(){const api=(0,useApi.h)();return(0,modern_index_js_.useQuery)({queryKey:["tech","etat-saisie","latest"],queryFn:async()=>(await api.etatSaisie.getLatestV1()).data,refetchOnWindowFocus:true})}function useEtatSaisieRecompute(){const api=(0,useApi.h)();const qc=(0,modern_index_js_.useQueryClient)();return(0,modern_index_js_.useMutation)({mutationFn:async()=>(await api.etatSaisie.recomputeV1()).data,onSuccess:()=>qc.invalidateQueries({queryKey:["tech","etat-saisie","latest"]})})}function DetailTable(props){const{columns,rows,onRowClick}=props;const[sortKey,setSortKey]=(0,index_js_.useState)(null);const[asc,setAsc]=(0,index_js_.useState)(false);const sorted=[...rows].sort((a,b)=>{if(!sortKey)return 0;const av=a[sortKey];const bv=b[sortKey];if("number"==typeof av&&"number"==typeof bv)return asc?av-bv:bv-av;return asc?String(av).localeCompare(String(bv)):String(bv).localeCompare(String(av))});const toggle=k=>{if(sortKey===k)setAsc(v=>!v);else{setSortKey(k);setAsc(false)}};const fmt=(v,numeric)=>{if(numeric&&"number"==typeof v)return v.toLocaleString("fr-FR",{minimumFractionDigits:2,maximumFractionDigits:2});if("boolean"==typeof v)return v?"✓":"";return null==v?"—":String(v)};return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Table,{striped:true,highlightOnHover:true,withTableBorder:true,stickyHeader:true,children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Thead,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Tr,{children:columns.map(c=>/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Table.Th,{onClick:()=>toggle(c.key),style:{cursor:"pointer"},children:[c.label,sortKey===c.key?asc?" ▲":" ▼":""]},c.key))})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Tbody,{children:0===sorted.length?/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Tr,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{colSpan:columns.length,children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{c:"dimmed",ta:"center",children:"Aucune ligne"})})}):sorted.map((row,i)=>/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Tr,{onClick:onRowClick?()=>onRowClick(row):void 0,style:onRowClick?{cursor:"pointer"}:void 0,children:columns.map(c=>/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{style:c.numeric?{textAlign:"right",fontVariantNumeric:"tabular-nums"}:void 0,children:c.render?c.render(row):fmt(row[c.key],c.numeric)},c.key))},i))})]})}var PageHeader=__webpack_require__(1354);const STALE_THRESHOLD_DAYS=30;function staleBadge(isoDate){if(!isoDate)return null;const days=Math.floor((Date.now()-new Date(isoDate).getTime())/864e5);if(days<STALE_THRESHOLD_DAYS)return null;return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Badge,{ml:6,size:"xs",color:"red",variant:"light",children:["+",days,"j"]})}function withDossierFilter(rows,dossier){if(!dossier)return rows;return rows.filter(r=>r.dossier===dossier)}function EtatSaisieApp(){const latest=useEtatSaisieLatest();const recompute=useEtatSaisieRecompute();const[tab,setTab]=(0,index_js_.useState)("resume");const[selectedDossier,setSelectedDossier]=(0,index_js_.useState)(null);const[drillDossier,setDrillDossier]=(0,index_js_.useState)(null);const d=latest.data;const allDossiers=(0,index_js_.useMemo)(()=>{if(!d?.available)return[];const set=new Set;for(const r of d.suspense_rows??[])set.add(r.dossier);for(const r of d.supplier_rows??[])set.add(r.dossier);for(const r of d.customer_rows??[])set.add(r.dossier);for(const r of d.no_data??[])set.add(r.dossier);for(const r of d.not_managed??[])set.add(r.dossier);for(const r of d.summary?.top_5_suspense??[])set.add(r.dossier);for(const r of d.summary?.top_5_supplier_debtors??[])set.add(r.dossier);for(const r of d.summary?.top_5_customer_creditors??[])set.add(r.dossier);return[...set].sort()},[d]);const openDrill=row=>setDrillDossier(row.dossier);const drillData=(0,index_js_.useMemo)(()=>{if(!drillDossier||!d?.available)return null;return{suspense:(d.suspense_rows??[]).filter(r=>r.dossier===drillDossier),supplier:(d.supplier_rows??[]).filter(r=>r.dossier===drillDossier),customer:(d.customer_rows??[]).filter(r=>r.dossier===drillDossier)}},[drillDossier,d]);return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Container,{fluid:true,my:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(PageHeader.m,{title:"\xc9tat saisie",updatedAt:d?.computed_at?new Date(d.computed_at).getTime():latest.dataUpdatedAt,isFetching:latest.isFetching,isError:latest.isError,onRefresh:()=>latest.refetch(),actions:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Button,{loading:recompute.isPending,onClick:()=>recompute.mutate(),variant:"light",children:"Recalculer"})}),d&&!d.available?/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{c:"dimmed",children:"Aucun snapshot disponible — lancez \xab Recalculer \xbb ou attendez le run nocturne."}):/*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{mb:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Select,{label:"Focus dossier",placeholder:"Tous les dossiers",data:allDossiers.map(dos=>({value:dos,label:dos})),value:selectedDossier,onChange:setSelectedDossier,searchable:true,clearable:true,w:320}),selectedDossier&&/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Button,{variant:"subtle",onClick:()=>setSelectedDossier(null),mt:22,children:"R\xe9initialiser"})]}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Tabs,{value:tab,onChange:setTab,children:[/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Tabs.List,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Tabs.Tab,{value:"resume",children:"R\xe9sum\xe9"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Tabs.Tab,{value:"s471",children:"D\xe9tail 471"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Tabs.Tab,{value:"s401",children:"Fournisseurs d\xe9biteurs (401)"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Tabs.Tab,{value:"s411",children:"Clients cr\xe9diteurs (411)"})]}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Tabs.Panel,{value:"resume",pt:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.SimpleGrid,{cols:4,mb:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Card,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"xs",c:"dimmed",children:"Scann\xe9s"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{fw:700,size:"xl",children:d?.summary?.companies_scanned??0})]}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Card,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"xs",c:"dimmed",children:"Propres"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{fw:700,size:"xl",c:"green",children:d?.summary?.companies_clean??0})]}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Card,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"xs",c:"dimmed",children:"En anomalie"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{fw:700,size:"xl",c:"orange",children:d?.summary?.companies_with_anomalies??0})]}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Card,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"xs",c:"dimmed",children:"En erreur"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{fw:700,size:"xl",c:"red",children:d?.summary?.companies_in_error??0})]})]}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Title,{order:4,mt:"md",children:"Top 5 comptes d'attente (471)"}),/*#__PURE__*/(0,jsx_runtime.jsx)(DetailTable,{columns:TOP_SUSPENSE_COLS,rows:withDossierFilter(d?.summary?.top_5_suspense??[],selectedDossier),onRowClick:openDrill}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Title,{order:4,mt:"md",children:"Top 5 fournisseurs d\xe9biteurs (401)"}),/*#__PURE__*/(0,jsx_runtime.jsx)(DetailTable,{columns:TOP_SUPPLIER_COLS,rows:withDossierFilter(d?.summary?.top_5_supplier_debtors??[],selectedDossier),onRowClick:openDrill}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Title,{order:4,mt:"md",children:"Top 5 clients cr\xe9diteurs (411)"}),/*#__PURE__*/(0,jsx_runtime.jsx)(DetailTable,{columns:TOP_CUSTOMER_COLS,rows:withDossierFilter(d?.summary?.top_5_customer_creditors??[],selectedDossier),onRowClick:openDrill}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Title,{order:4,mt:"md",children:"Dossiers \xe0 relancer (no_data)"}),/*#__PURE__*/(0,jsx_runtime.jsx)(DetailTable,{columns:DOSSIER_COLS,rows:withDossierFilter(d?.no_data??[],selectedDossier),onRowClick:openDrill}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Title,{order:4,mt:"md",children:"Dossiers non manag\xe9s (hors agr\xe9gats)"}),/*#__PURE__*/(0,jsx_runtime.jsx)(DetailTable,{columns:DOSSIER_COLS,rows:withDossierFilter(d?.not_managed??[],selectedDossier),onRowClick:openDrill})]}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Tabs.Panel,{value:"s471",pt:"md",children:/*#__PURE__*/(0,jsx_runtime.jsx)(DetailTable,{columns:SUSPENSE_COLS,rows:withDossierFilter(d?.suspense_rows??[],selectedDossier),onRowClick:openDrill})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Tabs.Panel,{value:"s401",pt:"md",children:/*#__PURE__*/(0,jsx_runtime.jsx)(DetailTable,{columns:SUPPLIER_COLS,rows:withDossierFilter(d?.supplier_rows??[],selectedDossier),onRowClick:openDrill})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Tabs.Panel,{value:"s411",pt:"md",children:/*#__PURE__*/(0,jsx_runtime.jsx)(DetailTable,{columns:CUSTOMER_COLS,rows:withDossierFilter(d?.customer_rows??[],selectedDossier),onRowClick:openDrill})})]})]}),latest.isError?/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{c:"red",mt:"md",children:"Erreur de chargement."}):null,/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Drawer,{opened:!!drillDossier,onClose:()=>setDrillDossier(null),position:"right",size:"xl",title:drillDossier?/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{gap:"xs",children:[/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Title,{order:4,children:["Dossier ",drillDossier]}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Button,{size:"xs",variant:"light",onClick:()=>{setSelectedDossier(drillDossier);setDrillDossier(null)},children:"Focus sur ce dossier"})]}):null,children:drillData&&/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Stack,{gap:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsxs)("div",{children:[/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Title,{order:5,mb:6,children:["Comptes d'attente 471 (",drillData.suspense.length,")"]}),/*#__PURE__*/(0,jsx_runtime.jsx)(DetailTable,{columns:DRILL_SUSPENSE_COLS,rows:drillData.suspense})]}),/*#__PURE__*/(0,jsx_runtime.jsxs)("div",{children:[/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Title,{order:5,mb:6,children:["Fournisseurs d\xe9biteurs 401 (",drillData.supplier.length,")"]}),/*#__PURE__*/(0,jsx_runtime.jsx)(DetailTable,{columns:DRILL_SUPPLIER_COLS,rows:drillData.supplier})]}),/*#__PURE__*/(0,jsx_runtime.jsxs)("div",{children:[/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Title,{order:5,mb:6,children:["Clients cr\xe9diteurs 411 (",drillData.customer.length,")"]}),/*#__PURE__*/(0,jsx_runtime.jsx)(DetailTable,{columns:DRILL_CUSTOMER_COLS,rows:drillData.customer})]})]})})]})}const TOP_SUSPENSE_COLS=[{key:"rank",label:"#",numeric:true},{key:"source",label:"Source"},{key:"dossier",label:"Dossier"},{key:"solde_eur",label:"Solde 471 (€)",numeric:true},{key:"nb_ecritures",label:"Nb \xe9cr.",numeric:true},{key:"top_libelle",label:"Top \xe9criture"},{key:"top_montant",label:"Montant",numeric:true}];const TOP_SUPPLIER_COLS=[{key:"rank",label:"#",numeric:true},{key:"source",label:"Source"},{key:"dossier",label:"Dossier"},{key:"total_eur",label:"Total d\xe9biteur (€)",numeric:true},{key:"nb_fournisseurs",label:"Nb fourn.",numeric:true},{key:"top_nom",label:"Top fournisseur"},{key:"top_montant",label:"Montant",numeric:true}];const TOP_CUSTOMER_COLS=[{key:"rank",label:"#",numeric:true},{key:"source",label:"Source"},{key:"dossier",label:"Dossier"},{key:"total_eur",label:"Total cr\xe9diteur (€)",numeric:true},{key:"nb_clients",label:"Nb clients",numeric:true},{key:"top_nom",label:"Top client"},{key:"top_montant",label:"Montant",numeric:true}];const DOSSIER_COLS=[{key:"source",label:"Source"},{key:"dossier",label:"Dossier"},{key:"status",label:"Statut"},{key:"solde_attente_eur",label:"Solde attente (€)",numeric:true},{key:"total_fournisseurs_eur",label:"Total fourn. (€)",numeric:true},{key:"total_clients_eur",label:"Total clients (€)",numeric:true},{key:"last_entry_date",label:"Derni\xe8re \xe9criture",render:row=>/*#__PURE__*/(0,jsx_runtime.jsxs)("span",{children:[row.last_entry_date??"—",staleBadge(row.last_entry_date)]})}];const SUSPENSE_COLS=[{key:"source",label:"Source"},{key:"dossier",label:"Dossier"},{key:"date",label:"Date"},{key:"numero_compte",label:"N\xb0 Compte"},{key:"libelle_compte",label:"Libell\xe9 compte"},{key:"libelle_ecriture",label:"Libell\xe9 \xe9criture"},{key:"journal",label:"Journal"},{key:"numero_piece",label:"N\xb0 Pi\xe8ce"},{key:"debit",label:"D\xe9bit",numeric:true},{key:"credit",label:"Cr\xe9dit",numeric:true},{key:"solde_net",label:"Solde net",numeric:true},{key:"lettre",label:"Lettr\xe9"},{key:"devise",label:"Devise"}];const SUPPLIER_COLS=[{key:"source",label:"Source"},{key:"dossier",label:"Dossier"},{key:"fournisseur",label:"Fournisseur"},{key:"solde_debiteur_eur",label:"Solde d\xe9biteur (€)",numeric:true},{key:"nb_ecritures",label:"Nb \xe9cr. non lettr\xe9es",numeric:true},{key:"devise",label:"Devise"}];const CUSTOMER_COLS=[{key:"source",label:"Source"},{key:"dossier",label:"Dossier"},{key:"client",label:"Client"},{key:"solde_crediteur_eur",label:"Solde cr\xe9diteur (€)",numeric:true},{key:"nb_ecritures",label:"Nb \xe9cr. non lettr\xe9es",numeric:true},{key:"devise",label:"Devise"}];const DRILL_SUSPENSE_COLS=[{key:"date",label:"Date"},{key:"numero_compte",label:"N\xb0 Compte"},{key:"libelle_ecriture",label:"Libell\xe9"},{key:"debit",label:"D\xe9bit",numeric:true},{key:"credit",label:"Cr\xe9dit",numeric:true},{key:"solde_net",label:"Solde net",numeric:true},{key:"lettre",label:"Lettr\xe9"}];const DRILL_SUPPLIER_COLS=[{key:"fournisseur",label:"Fournisseur"},{key:"solde_debiteur_eur",label:"Solde d\xe9biteur (€)",numeric:true},{key:"nb_ecritures",label:"Nb \xe9cr.",numeric:true},{key:"devise",label:"Devise"}];const DRILL_CUSTOMER_COLS=[{key:"client",label:"Client"},{key:"solde_crediteur_eur",label:"Solde cr\xe9diteur (€)",numeric:true},{key:"nb_ecritures",label:"Nb \xe9cr.",numeric:true},{key:"devise",label:"Devise"}];function EtatSaisie(props){return/*#__PURE__*/(0,jsx_runtime.jsx)(index_js_.StrictMode,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(providers.C,{...props,children:/*#__PURE__*/(0,jsx_runtime.jsx)(EtatSaisieApp,{})})})}}}]);
|
|
1
|
+
"use strict";(globalThis["chunk_tech_app"]=globalThis["chunk_tech_app"]||[]).push([["7915"],{1354:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{m:()=>PageHeader});var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(5893);var _mantine_core__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(207);var _tabler_icons_react__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(9632);var react__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(3106);function formatRelative(now,then){const seconds=Math.max(0,Math.floor((now-then)/1e3));if(seconds<5)return"\xe0 l’instant";if(seconds<60)return`il y a ${seconds}s`;const minutes=Math.floor(seconds/60);if(minutes<60)return`il y a ${minutes} min`;const hours=Math.floor(minutes/60);return`il y a ${hours} h`}function PageHeader({title,badge,updatedAt,isFetching,isError,onRefresh,actions}){const[now,setNow]=(0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(()=>Date.now());(0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(()=>{if(!updatedAt)return;const id=window.setInterval(()=>setNow(Date.now()),1e3);return()=>window.clearInterval(id)},[updatedAt]);const relative=updatedAt?formatRelative(now,updatedAt):null;const color=isError?"orange":isFetching?"teal":"dimmed";return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{justify:"space-between",align:"center",mih:48,mb:"md",children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{gap:"sm",align:"center",children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Title,{order:2,children:title}),badge]}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{gap:"sm",align:"center",children:[relative&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Text,{size:"xs",c:color,fw:isFetching?600:400,"data-testid":"page-header-freshness",children:isError?"\xe9chec maj":isFetching?"maj…":relative}),onRefresh&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Tooltip,{label:"Rafra\xeechir",children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.ActionIcon,{variant:"default",size:"md",onClick:onRefresh,loading:isFetching,"aria-label":"Refresh",children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_2__.IconRefresh,{size:16})})}),actions]})]})}},9483:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{default:()=>EtatSaisie});var jsx_runtime=__webpack_require__(5893);var index_js_=__webpack_require__(3106);var providers=__webpack_require__(7034);var index_mjs_=__webpack_require__(207);var modern_index_js_=__webpack_require__(6197);var useApi=__webpack_require__(4148);function useEtatSaisieLatest(){const api=(0,useApi.h)();return(0,modern_index_js_.useQuery)({queryKey:["tech","etat-saisie","latest"],queryFn:async()=>(await api.etatSaisie.getLatestV1()).data,refetchOnWindowFocus:true})}function useEtatSaisieRecompute(){const api=(0,useApi.h)();const qc=(0,modern_index_js_.useQueryClient)();return(0,modern_index_js_.useMutation)({mutationFn:async()=>(await api.etatSaisie.recomputeV1()).data,onSuccess:()=>qc.invalidateQueries({queryKey:["tech","etat-saisie","latest"]})})}function DetailTable(props){const{columns,rows,onRowClick}=props;const[sortKey,setSortKey]=(0,index_js_.useState)(null);const[asc,setAsc]=(0,index_js_.useState)(false);const sorted=[...rows].sort((a,b)=>{if(!sortKey)return 0;const av=a[sortKey];const bv=b[sortKey];if("number"==typeof av&&"number"==typeof bv)return asc?av-bv:bv-av;return asc?String(av).localeCompare(String(bv)):String(bv).localeCompare(String(av))});const toggle=k=>{if(sortKey===k)setAsc(v=>!v);else{setSortKey(k);setAsc(false)}};const fmt=(v,numeric)=>{if(numeric&&"number"==typeof v)return v.toLocaleString("fr-FR",{minimumFractionDigits:2,maximumFractionDigits:2});if("boolean"==typeof v)return v?"✓":"";if(null==v)return"—";if("object"==typeof v)return"—";return String(v)};return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Table,{striped:true,highlightOnHover:true,withTableBorder:true,stickyHeader:true,children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Thead,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Tr,{children:columns.map(c=>/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Table.Th,{onClick:()=>toggle(c.key),style:{cursor:"pointer"},children:[c.label,sortKey===c.key?asc?" ▲":" ▼":""]},c.key))})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Tbody,{children:0===sorted.length?/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Tr,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{colSpan:columns.length,children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{c:"dimmed",ta:"center",children:"Aucune ligne"})})}):sorted.map((row,i)=>/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Tr,{onClick:onRowClick?()=>onRowClick(row):void 0,style:onRowClick?{cursor:"pointer"}:void 0,children:columns.map(c=>/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{style:c.numeric?{textAlign:"right",fontVariantNumeric:"tabular-nums"}:void 0,children:c.render?c.render(row):fmt(row[c.key],c.numeric)},c.key))},i))})]})}function useDossiers(){const api=(0,useApi.h)();return(0,modern_index_js_.useQuery)({queryKey:["tech","etat-saisie","dossiers"],queryFn:async()=>(await api.etatSaisie.getDossiersV1()).data.dossiers,refetchOnWindowFocus:true})}function useSetManaged(){const api=(0,useApi.h)();const qc=(0,modern_index_js_.useQueryClient)();return(0,modern_index_js_.useMutation)({mutationFn:async variables=>(await api.etatSaisie.setManagedV1({id:variables.id},{managed:variables.managed})).data,onSuccess:()=>{qc.invalidateQueries({queryKey:["tech","etat-saisie","dossiers"]});qc.invalidateQueries({queryKey:["tech","etat-saisie","latest"]})}})}const LOGO_DEV_TOKEN="pk_BVN4OQv0Qs-bnqjdIgTppg";function logoDevUrl(domain){return`https://img.logo.dev/${domain}?token=${LOGO_DEV_TOKEN}`}const PROVIDER_DOMAIN={pennylane:"pennylane.com",zohobooks:"zoho.com",xero:"xero.com",odoo:"odoo.com"};function QuickBooksIcon(props){const{size}=props;return/*#__PURE__*/(0,jsx_runtime.jsxs)("svg",{width:size,height:size,viewBox:"0 0 24 24",role:"img","aria-label":"QuickBooks",children:[/*#__PURE__*/(0,jsx_runtime.jsx)("title",{children:"QuickBooks"}),/*#__PURE__*/(0,jsx_runtime.jsx)("circle",{cx:"12",cy:"12",r:"12",fill:"#2CA01C"}),/*#__PURE__*/(0,jsx_runtime.jsx)("text",{x:"12",y:"16.5",textAnchor:"middle",fontSize:"12",fontWeight:"700",fill:"#ffffff",fontFamily:"Arial, Helvetica, sans-serif",children:"qb"})]})}function ProviderIcon(props){const{provider}=props;if(!provider)return null;if("quickbooks"===provider)return/*#__PURE__*/(0,jsx_runtime.jsx)(QuickBooksIcon,{size:20});const domain=PROVIDER_DOMAIN[provider];if(!domain)return/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Badge,{size:"sm",variant:"light",color:"gray",title:provider,children:provider.slice(0,2).toUpperCase()});return/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Image,{src:logoDevUrl(domain),alt:provider,title:provider,w:20,h:20,fit:"contain",radius:"sm",style:{aspectRatio:1}})}function DossiersTab(){const dossiers=useDossiers();const setManaged=useSetManaged();const[filter,setFilter]=(0,index_js_.useState)("");const rows=(0,index_js_.useMemo)(()=>{const all=dossiers.data??[];const needle=filter.trim().toLowerCase();const filtered=needle?all.filter(dossier=>dossier.display_name.toLowerCase().includes(needle)||dossier.slug.toLowerCase().includes(needle)):all;return[...filtered].sort((a,b)=>a.display_name.localeCompare(b.display_name))},[dossiers.data,filter]);if(dossiers.isError)return/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{c:"red",mt:"md",children:"Erreur de chargement des dossiers."});return/*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Group,{mb:"md",children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.TextInput,{placeholder:"Filtrer par nom ou slug",value:filter,onChange:event=>setFilter(event.currentTarget.value),w:320})}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Table,{striped:true,highlightOnHover:true,withTableBorder:true,stickyHeader:true,children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Thead,{children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Table.Tr,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{children:"Source"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{children:"Dossier"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{children:"Manag\xe9"})]})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Tbody,{children:0===rows.length?/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Tr,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{colSpan:3,children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{c:"dimmed",ta:"center",children:"Aucun dossier"})})}):rows.map(dossier=>/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Table.Tr,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(ProviderIcon,{provider:dossier.provider})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{children:dossier.display_name}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Switch,{checked:dossier.managed,onChange:event=>setManaged.mutate({id:dossier.airporting_id,managed:event.currentTarget.checked})})})]},`${dossier.airporting_id}:${dossier.provider}`))})]})]})}function ManagedBadge(props){const{managed}=props;if(!managed)return null;return/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Image,{src:logoDevUrl("airporting.com"),alt:"Manag\xe9 par Airporting",title:"Manag\xe9 par Airporting",w:18,h:18,fit:"contain",radius:"sm",style:{aspectRatio:1}})}var PageHeader=__webpack_require__(1354);const STALE_THRESHOLD_DAYS=30;function staleBadge(isoDate){if(!isoDate)return null;const days=Math.floor((Date.now()-new Date(isoDate).getTime())/864e5);if(days<STALE_THRESHOLD_DAYS)return null;return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Badge,{ml:6,size:"xs",color:"red",variant:"light",children:["+",days,"j"]})}function withDossierFilter(rows,dossier){if(!dossier)return rows;return rows.filter(r=>r.dossier===dossier)}function withManagedFilter(rows,managedOnly){if(!managedOnly)return rows;return rows.filter(r=>true===r.managed)}function EtatSaisieApp(){const latest=useEtatSaisieLatest();const recompute=useEtatSaisieRecompute();const[tab,setTab]=(0,index_js_.useState)("resume");const[selectedDossier,setSelectedDossier]=(0,index_js_.useState)(null);const[managedOnly,setManagedOnly]=(0,index_js_.useState)(true);const[drillDossier,setDrillDossier]=(0,index_js_.useState)(null);const d=latest.data;const allDossiers=(0,index_js_.useMemo)(()=>{if(!d?.available)return[];const set=new Set;for(const r of d.suspense_rows??[])set.add(r.dossier);for(const r of d.supplier_rows??[])set.add(r.dossier);for(const r of d.customer_rows??[])set.add(r.dossier);for(const r of d.no_data??[])set.add(r.dossier);for(const r of d.not_managed??[])set.add(r.dossier);for(const r of d.summary?.top_5_suspense??[])set.add(r.dossier);for(const r of d.summary?.top_5_supplier_debtors??[])set.add(r.dossier);for(const r of d.summary?.top_5_customer_creditors??[])set.add(r.dossier);return[...set].sort()},[d]);const openDrill=row=>setDrillDossier(row.dossier);const drillData=(0,index_js_.useMemo)(()=>{if(!drillDossier||!d?.available)return null;return{suspense:(d.suspense_rows??[]).filter(r=>r.dossier===drillDossier),supplier:(d.supplier_rows??[]).filter(r=>r.dossier===drillDossier),customer:(d.customer_rows??[]).filter(r=>r.dossier===drillDossier)}},[drillDossier,d]);return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Container,{fluid:true,my:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(PageHeader.m,{title:"\xc9tat saisie",updatedAt:d?.computed_at?new Date(d.computed_at).getTime():latest.dataUpdatedAt,isFetching:latest.isFetching,isError:latest.isError,onRefresh:()=>latest.refetch(),actions:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Button,{loading:recompute.isPending,onClick:()=>recompute.mutate(),variant:"light",children:"Recalculer"})}),d&&!d.available?/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{c:"dimmed",children:"Aucun snapshot disponible — lancez \xab Recalculer \xbb ou attendez le run nocturne."}):/*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{mb:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Select,{label:"Focus dossier",placeholder:"Tous les dossiers",data:allDossiers.map(dos=>({value:dos,label:dos})),value:selectedDossier,onChange:setSelectedDossier,searchable:true,clearable:true,w:320}),selectedDossier&&/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Button,{variant:"subtle",onClick:()=>setSelectedDossier(null),mt:22,children:"R\xe9initialiser"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.SegmentedControl,{mt:22,value:managedOnly?"managed":"all",onChange:v=>setManagedOnly("managed"===v),data:[{label:"Manag\xe9s",value:"managed"},{label:"Tous",value:"all"}]})]}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Tabs,{value:tab,onChange:setTab,children:[/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Tabs.List,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Tabs.Tab,{value:"resume",children:"R\xe9sum\xe9"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Tabs.Tab,{value:"s471",children:"D\xe9tail 471"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Tabs.Tab,{value:"s401",children:"Fournisseurs d\xe9biteurs (401)"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Tabs.Tab,{value:"s411",children:"Clients cr\xe9diteurs (411)"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Tabs.Tab,{value:"dossiers",children:"Dossiers"})]}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Tabs.Panel,{value:"resume",pt:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.SimpleGrid,{cols:4,mb:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Card,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"xs",c:"dimmed",children:"Scann\xe9s"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{fw:700,size:"xl",children:d?.summary?.companies_scanned??0})]}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Card,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"xs",c:"dimmed",children:"Propres"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{fw:700,size:"xl",c:"green",children:d?.summary?.companies_clean??0})]}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Card,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"xs",c:"dimmed",children:"En anomalie"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{fw:700,size:"xl",c:"orange",children:d?.summary?.companies_with_anomalies??0})]}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Card,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"xs",c:"dimmed",children:"En erreur"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{fw:700,size:"xl",c:"red",children:d?.summary?.companies_in_error??0})]})]}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Title,{order:4,mt:"md",children:"Top 5 comptes d'attente (471)"}),/*#__PURE__*/(0,jsx_runtime.jsx)(DetailTable,{columns:TOP_SUSPENSE_COLS,rows:withDossierFilter(d?.summary?.top_5_suspense??[],selectedDossier),onRowClick:openDrill}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Title,{order:4,mt:"md",children:"Top 5 fournisseurs d\xe9biteurs (401)"}),/*#__PURE__*/(0,jsx_runtime.jsx)(DetailTable,{columns:TOP_SUPPLIER_COLS,rows:withDossierFilter(d?.summary?.top_5_supplier_debtors??[],selectedDossier),onRowClick:openDrill}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Title,{order:4,mt:"md",children:"Top 5 clients cr\xe9diteurs (411)"}),/*#__PURE__*/(0,jsx_runtime.jsx)(DetailTable,{columns:TOP_CUSTOMER_COLS,rows:withDossierFilter(d?.summary?.top_5_customer_creditors??[],selectedDossier),onRowClick:openDrill}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Title,{order:4,mt:"md",children:"Dossiers \xe0 rafra\xeechir (donn\xe9es potentiellement p\xe9rim\xe9es)"}),/*#__PURE__*/(0,jsx_runtime.jsx)(DetailTable,{columns:NO_DATA_COLS,rows:withDossierFilter(d?.no_data??[],selectedDossier),onRowClick:openDrill}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Title,{order:4,mt:"md",children:"Dossiers non manag\xe9s (hors agr\xe9gats)"}),/*#__PURE__*/(0,jsx_runtime.jsx)(DetailTable,{columns:DOSSIER_COLS,rows:withDossierFilter(d?.not_managed??[],selectedDossier),onRowClick:openDrill})]}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Tabs.Panel,{value:"s471",pt:"md",children:/*#__PURE__*/(0,jsx_runtime.jsx)(DetailTable,{columns:SUSPENSE_COLS,rows:withManagedFilter(withDossierFilter(d?.suspense_rows??[],selectedDossier),managedOnly),onRowClick:openDrill})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Tabs.Panel,{value:"s401",pt:"md",children:/*#__PURE__*/(0,jsx_runtime.jsx)(DetailTable,{columns:SUPPLIER_COLS,rows:withManagedFilter(withDossierFilter(d?.supplier_rows??[],selectedDossier),managedOnly),onRowClick:openDrill})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Tabs.Panel,{value:"s411",pt:"md",children:/*#__PURE__*/(0,jsx_runtime.jsx)(DetailTable,{columns:CUSTOMER_COLS,rows:withManagedFilter(withDossierFilter(d?.customer_rows??[],selectedDossier),managedOnly),onRowClick:openDrill})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Tabs.Panel,{value:"dossiers",pt:"md",children:/*#__PURE__*/(0,jsx_runtime.jsx)(DossiersTab,{})})]})]}),latest.isError?/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{c:"red",mt:"md",children:"Erreur de chargement."}):null,/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Drawer,{opened:!!drillDossier,onClose:()=>setDrillDossier(null),position:"right",size:"xl",title:drillDossier?/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{gap:"xs",children:[/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Title,{order:4,children:["Dossier ",drillDossier]}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Button,{size:"xs",variant:"light",onClick:()=>{setSelectedDossier(drillDossier);setDrillDossier(null)},children:"Focus sur ce dossier"})]}):null,children:drillData&&/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Stack,{gap:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsxs)("div",{children:[/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Title,{order:5,mb:6,children:["Comptes d'attente 471 (",drillData.suspense.length,")"]}),/*#__PURE__*/(0,jsx_runtime.jsx)(DetailTable,{columns:DRILL_SUSPENSE_COLS,rows:drillData.suspense})]}),/*#__PURE__*/(0,jsx_runtime.jsxs)("div",{children:[/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Title,{order:5,mb:6,children:["Fournisseurs d\xe9biteurs 401 (",drillData.supplier.length,")"]}),/*#__PURE__*/(0,jsx_runtime.jsx)(DetailTable,{columns:DRILL_SUPPLIER_COLS,rows:drillData.supplier})]}),/*#__PURE__*/(0,jsx_runtime.jsxs)("div",{children:[/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Title,{order:5,mb:6,children:["Clients cr\xe9diteurs 411 (",drillData.customer.length,")"]}),/*#__PURE__*/(0,jsx_runtime.jsx)(DetailTable,{columns:DRILL_CUSTOMER_COLS,rows:drillData.customer})]})]})})]})}const TOP_SUSPENSE_COLS=[{key:"rank",label:"#",numeric:true},{key:"source",label:"Source",render:r=>/*#__PURE__*/(0,jsx_runtime.jsx)(ProviderIcon,{provider:r.source})},{key:"managed",label:"Manag\xe9",render:r=>/*#__PURE__*/(0,jsx_runtime.jsx)(ManagedBadge,{managed:r.managed})},{key:"dossier",label:"Dossier"},{key:"solde_eur",label:"Solde 471 (€)",numeric:true},{key:"nb_ecritures",label:"Nb \xe9cr.",numeric:true},{key:"top_libelle",label:"Top \xe9criture"},{key:"top_montant",label:"Montant",numeric:true}];const TOP_SUPPLIER_COLS=[{key:"rank",label:"#",numeric:true},{key:"source",label:"Source",render:r=>/*#__PURE__*/(0,jsx_runtime.jsx)(ProviderIcon,{provider:r.source})},{key:"managed",label:"Manag\xe9",render:r=>/*#__PURE__*/(0,jsx_runtime.jsx)(ManagedBadge,{managed:r.managed})},{key:"dossier",label:"Dossier"},{key:"total_eur",label:"Total d\xe9biteur (€)",numeric:true},{key:"nb_fournisseurs",label:"Nb fourn.",numeric:true},{key:"top_nom",label:"Top fournisseur"},{key:"top_montant",label:"Montant",numeric:true}];const TOP_CUSTOMER_COLS=[{key:"rank",label:"#",numeric:true},{key:"source",label:"Source",render:r=>/*#__PURE__*/(0,jsx_runtime.jsx)(ProviderIcon,{provider:r.source})},{key:"managed",label:"Manag\xe9",render:r=>/*#__PURE__*/(0,jsx_runtime.jsx)(ManagedBadge,{managed:r.managed})},{key:"dossier",label:"Dossier"},{key:"total_eur",label:"Total cr\xe9diteur (€)",numeric:true},{key:"nb_clients",label:"Nb clients",numeric:true},{key:"top_nom",label:"Top client"},{key:"top_montant",label:"Montant",numeric:true}];const DOSSIER_COLS=[{key:"source",label:"Source",render:r=>/*#__PURE__*/(0,jsx_runtime.jsx)(ProviderIcon,{provider:r.source})},{key:"managed",label:"Manag\xe9",render:r=>/*#__PURE__*/(0,jsx_runtime.jsx)(ManagedBadge,{managed:r.managed})},{key:"dossier",label:"Dossier"},{key:"status",label:"Statut"},{key:"solde_attente_eur",label:"Solde attente (€)",numeric:true},{key:"total_fournisseurs_eur",label:"Total fourn. (€)",numeric:true},{key:"total_clients_eur",label:"Total clients (€)",numeric:true},{key:"last_entry_date",label:"Derni\xe8re \xe9criture",render:row=>/*#__PURE__*/(0,jsx_runtime.jsxs)("span",{children:[row.last_entry_date??"—",staleBadge(row.last_entry_date)]})}];const NO_DATA_COLS=[{key:"source",label:"Source",render:r=>/*#__PURE__*/(0,jsx_runtime.jsx)(ProviderIcon,{provider:r.source})},{key:"managed",label:"Manag\xe9",render:r=>/*#__PURE__*/(0,jsx_runtime.jsx)(ManagedBadge,{managed:r.managed})},{key:"dossier",label:"Dossier"},{key:"reason",label:"Cause",render:r=>"empty"===r.reason?/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Badge,{size:"xs",color:"gray",variant:"light",children:"Vide"}):"stale"===r.reason?/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Badge,{size:"xs",color:"yellow",variant:"light",children:"P\xe9rim\xe9"}):null},{key:"status",label:"Statut"},{key:"last_entry_date",label:"Derni\xe8re \xe9criture",render:row=>/*#__PURE__*/(0,jsx_runtime.jsxs)("span",{children:[row.last_entry_date??"—",staleBadge(row.last_entry_date)]})}];const SUSPENSE_COLS=[{key:"source",label:"Source",render:r=>/*#__PURE__*/(0,jsx_runtime.jsx)(ProviderIcon,{provider:r.source})},{key:"managed",label:"Manag\xe9",render:r=>/*#__PURE__*/(0,jsx_runtime.jsx)(ManagedBadge,{managed:r.managed})},{key:"dossier",label:"Dossier"},{key:"date",label:"Date"},{key:"numero_compte",label:"N\xb0 Compte"},{key:"libelle_compte",label:"Libell\xe9 compte"},{key:"libelle_ecriture",label:"Libell\xe9 \xe9criture"},{key:"journal",label:"Journal"},{key:"numero_piece",label:"N\xb0 Pi\xe8ce"},{key:"debit",label:"D\xe9bit",numeric:true},{key:"credit",label:"Cr\xe9dit",numeric:true},{key:"solde_net",label:"Solde net",numeric:true},{key:"lettre",label:"Lettr\xe9"},{key:"devise",label:"Devise"}];const SUPPLIER_COLS=[{key:"source",label:"Source",render:r=>/*#__PURE__*/(0,jsx_runtime.jsx)(ProviderIcon,{provider:r.source})},{key:"managed",label:"Manag\xe9",render:r=>/*#__PURE__*/(0,jsx_runtime.jsx)(ManagedBadge,{managed:r.managed})},{key:"dossier",label:"Dossier"},{key:"fournisseur",label:"Fournisseur"},{key:"solde_debiteur_eur",label:"Solde d\xe9biteur (€)",numeric:true},{key:"nb_ecritures",label:"Nb \xe9cr. non lettr\xe9es",numeric:true},{key:"devise",label:"Devise"}];const CUSTOMER_COLS=[{key:"source",label:"Source",render:r=>/*#__PURE__*/(0,jsx_runtime.jsx)(ProviderIcon,{provider:r.source})},{key:"managed",label:"Manag\xe9",render:r=>/*#__PURE__*/(0,jsx_runtime.jsx)(ManagedBadge,{managed:r.managed})},{key:"dossier",label:"Dossier"},{key:"client",label:"Client"},{key:"solde_crediteur_eur",label:"Solde cr\xe9diteur (€)",numeric:true},{key:"nb_ecritures",label:"Nb \xe9cr. non lettr\xe9es",numeric:true},{key:"devise",label:"Devise"}];const DRILL_SUSPENSE_COLS=[{key:"date",label:"Date"},{key:"numero_compte",label:"N\xb0 Compte"},{key:"libelle_ecriture",label:"Libell\xe9"},{key:"debit",label:"D\xe9bit",numeric:true},{key:"credit",label:"Cr\xe9dit",numeric:true},{key:"solde_net",label:"Solde net",numeric:true},{key:"lettre",label:"Lettr\xe9"}];const DRILL_SUPPLIER_COLS=[{key:"fournisseur",label:"Fournisseur"},{key:"solde_debiteur_eur",label:"Solde d\xe9biteur (€)",numeric:true},{key:"nb_ecritures",label:"Nb \xe9cr.",numeric:true},{key:"devise",label:"Devise"}];const DRILL_CUSTOMER_COLS=[{key:"client",label:"Client"},{key:"solde_crediteur_eur",label:"Solde cr\xe9diteur (€)",numeric:true},{key:"nb_ecritures",label:"Nb \xe9cr.",numeric:true},{key:"devise",label:"Devise"}];function EtatSaisie(props){return/*#__PURE__*/(0,jsx_runtime.jsx)(index_js_.StrictMode,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(providers.C,{...props,children:/*#__PURE__*/(0,jsx_runtime.jsx)(EtatSaisieApp,{})})})}}}]);
|