@remoteoss/remote-flows 0.23.0 → 0.24.0

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.
Files changed (250) hide show
  1. package/dist/{chunk-Q5ZRKZMK.js → chunk-2M7EBC4K.js} +2 -2
  2. package/dist/chunk-2YTBWEC7.js +2 -0
  3. package/dist/chunk-2YTBWEC7.js.map +1 -0
  4. package/dist/chunk-347YWDTK.js +2 -0
  5. package/dist/chunk-347YWDTK.js.map +1 -0
  6. package/dist/{chunk-IXAWEBRI.js → chunk-3O3Q24JL.js} +2 -2
  7. package/dist/chunk-3O3Q24JL.js.map +1 -0
  8. package/dist/{chunk-FMBYJANY.js → chunk-4DCENNLW.js} +2 -2
  9. package/dist/{chunk-N6KOPITR.js → chunk-4M4OJPUA.js} +2 -2
  10. package/dist/{chunk-U2LOBJFU.js → chunk-4URY37KB.js} +2 -2
  11. package/dist/{chunk-TB75BHYW.js → chunk-5XHKOMX5.js} +2 -2
  12. package/dist/chunk-6U2UCWVR.js +2 -0
  13. package/dist/chunk-6U2UCWVR.js.map +1 -0
  14. package/dist/{chunk-NIH7XLAK.js → chunk-A7HJICVX.js} +2 -2
  15. package/dist/{chunk-5A54AHAT.js → chunk-BDPCUDJB.js} +2 -2
  16. package/dist/{chunk-5H5INKOY.js → chunk-BGU3LZ2S.js} +2 -2
  17. package/dist/chunk-BJOF6IEZ.js +2 -0
  18. package/dist/chunk-BJOF6IEZ.js.map +1 -0
  19. package/dist/{chunk-BNHN4CEM.js → chunk-BMDZJNJV.js} +2 -2
  20. package/dist/{chunk-3W7RKLJX.js → chunk-BVN2DKO5.js} +2 -2
  21. package/dist/{chunk-HEQLPSHZ.js → chunk-C2BBQDCU.js} +2 -2
  22. package/dist/{chunk-S2XKE7EA.js → chunk-D5RCRFJM.js} +2 -2
  23. package/dist/{chunk-LEXD5FVL.js → chunk-DYWOG7Q2.js} +2 -2
  24. package/dist/{chunk-RDCWARSM.js → chunk-EFPZOIQ2.js} +2 -2
  25. package/dist/{chunk-XMAQ4NRR.js → chunk-EZV6DOVQ.js} +2 -2
  26. package/dist/chunk-EZWZMPD2.js +2 -0
  27. package/dist/chunk-EZWZMPD2.js.map +1 -0
  28. package/dist/{chunk-L2IKFFQX.js → chunk-GGXK727I.js} +2 -2
  29. package/dist/{chunk-NGTESOKF.js → chunk-HFI2MD3H.js} +2 -2
  30. package/dist/{chunk-ILPYR7RQ.js → chunk-HLPKGITX.js} +2 -2
  31. package/dist/{chunk-RF5SLMJF.js → chunk-ISZQNKMD.js} +2 -2
  32. package/dist/{chunk-DUD7B2IY.js → chunk-IUJXAZHK.js} +2 -2
  33. package/dist/{chunk-IYGJ5QJB.js → chunk-IUZ7DEXC.js} +2 -2
  34. package/dist/{chunk-O4DIUKVP.js → chunk-KPTF6LPP.js} +2 -2
  35. package/dist/{chunk-PKRI35YC.js → chunk-KYSKA2UK.js} +2 -2
  36. package/dist/{chunk-2T2N5226.js → chunk-L2BJK3K5.js} +2 -2
  37. package/dist/{chunk-FBJCDOO7.js → chunk-LRGEEPGK.js} +2 -2
  38. package/dist/{chunk-B7I7YVNK.js → chunk-MP2T74PU.js} +2 -2
  39. package/dist/{chunk-PWPFCC6I.js → chunk-NVYMAOQ7.js} +2 -2
  40. package/dist/{chunk-SA3D5OH4.js → chunk-NYEZAOUI.js} +2 -2
  41. package/dist/{chunk-2DSNHYHZ.js → chunk-NYM7QGN2.js} +2 -2
  42. package/dist/{chunk-GKS3W6KT.js → chunk-O5MKPE6I.js} +2 -2
  43. package/dist/{chunk-PAT3EA43.js → chunk-O7REUCKR.js} +2 -2
  44. package/dist/{chunk-64NSBY5G.js → chunk-OEAHDUWE.js} +2 -2
  45. package/dist/chunk-Q3A4A2HL.js +2 -0
  46. package/dist/{chunk-LUDRB7LC.js → chunk-QKLIYOMA.js} +2 -2
  47. package/dist/{chunk-JVSD4JOU.js → chunk-RC3XP5WU.js} +2 -2
  48. package/dist/chunk-REDYWUCC.js +2 -0
  49. package/dist/chunk-REDYWUCC.js.map +1 -0
  50. package/dist/{chunk-4NAVUB7D.js → chunk-RINDVT6U.js} +2 -2
  51. package/dist/{chunk-7IZGKQII.js → chunk-RQXKQTRD.js} +2 -2
  52. package/dist/{chunk-VT4GSXMI.js → chunk-SHF5L3PW.js} +2 -2
  53. package/dist/{chunk-G4QOEPDP.js → chunk-UIO6B4GN.js} +2 -2
  54. package/dist/{chunk-4HT7RNFP.js → chunk-UTBVLDKY.js} +2 -2
  55. package/dist/{chunk-JF3KJ6PA.js → chunk-VUP76ZMQ.js} +2 -2
  56. package/dist/{chunk-CRHH6IPF.js → chunk-VYDVPM5S.js} +2 -2
  57. package/dist/{chunk-3XDJ2LRT.js → chunk-WFMQ2IDE.js} +2 -2
  58. package/dist/{chunk-HPBT677J.js → chunk-WNXB2Y65.js} +2 -2
  59. package/dist/{chunk-IM525UMG.js → chunk-YPHOFQ5O.js} +2 -2
  60. package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.d.ts +1 -1
  61. package/dist/flows/ContractAmendment/ContractAmendmentFlow.d.ts +3 -3
  62. package/dist/flows/ContractAmendment/ContractAmendmentFlow.js +1 -1
  63. package/dist/flows/ContractAmendment/ContractAmendmentForm.d.ts +1 -1
  64. package/dist/flows/ContractAmendment/ContractAmendmentForm.js +1 -1
  65. package/dist/flows/ContractAmendment/context.d.ts +3 -3
  66. package/dist/flows/ContractAmendment/hooks.d.ts +3 -3
  67. package/dist/flows/ContractAmendment/hooks.js +1 -1
  68. package/dist/flows/ContractAmendment/index.d.ts +3 -3
  69. package/dist/flows/ContractAmendment/index.js +1 -1
  70. package/dist/flows/ContractAmendment/utils.d.ts +1 -1
  71. package/dist/flows/ContractorOnboarding/ContractorOnboarding.d.ts +5 -5
  72. package/dist/flows/ContractorOnboarding/ContractorOnboarding.js +1 -1
  73. package/dist/flows/ContractorOnboarding/api.d.ts +2 -2
  74. package/dist/flows/ContractorOnboarding/api.js +1 -1
  75. package/dist/flows/ContractorOnboarding/components/BasicInformationStep.d.ts +4 -4
  76. package/dist/flows/ContractorOnboarding/components/BasicInformationStep.js +1 -1
  77. package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.d.ts +5 -5
  78. package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.js +1 -1
  79. package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.d.ts +5 -5
  80. package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.js +1 -1
  81. package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.d.ts +5 -5
  82. package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.js +1 -1
  83. package/dist/flows/ContractorOnboarding/components/OnboardingInvite.d.ts +3 -3
  84. package/dist/flows/ContractorOnboarding/components/OnboardingInvite.js +1 -1
  85. package/dist/flows/ContractorOnboarding/components/PricingPlan.d.ts +5 -5
  86. package/dist/flows/ContractorOnboarding/components/PricingPlan.js +1 -1
  87. package/dist/flows/ContractorOnboarding/components/SelectCountryStep.d.ts +4 -4
  88. package/dist/flows/ContractorOnboarding/components/SelectCountryStep.js +1 -1
  89. package/dist/flows/ContractorOnboarding/context.d.ts +5 -5
  90. package/dist/flows/ContractorOnboarding/hooks.d.ts +5 -5
  91. package/dist/flows/ContractorOnboarding/hooks.js +1 -1
  92. package/dist/flows/ContractorOnboarding/index.d.ts +5 -5
  93. package/dist/flows/ContractorOnboarding/index.js +1 -1
  94. package/dist/flows/ContractorOnboarding/types.d.ts +5 -5
  95. package/dist/flows/CostCalculator/CostCalculatorFlow.d.ts +3 -3
  96. package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
  97. package/dist/flows/CostCalculator/CostCalculatorForm.d.ts +3 -3
  98. package/dist/flows/CostCalculator/CostCalculatorForm.js +1 -1
  99. package/dist/flows/CostCalculator/EstimationResults/EstimationResults.d.ts +1 -1
  100. package/dist/flows/CostCalculator/EstimationResults/EstimationResults.js +1 -1
  101. package/dist/flows/CostCalculator/Results/CostCalculatorBenefitsBreakdown.js +1 -1
  102. package/dist/flows/CostCalculator/Results/CostCalculatorContributionsBreakdown.js +1 -1
  103. package/dist/flows/CostCalculator/Results/CostCalculatorExtraStatutoryPaymentsBreakdown.js +1 -1
  104. package/dist/flows/CostCalculator/Results/CostCalculatorGrossSalary.js +1 -1
  105. package/dist/flows/CostCalculator/Results/CostCalculatorResults.d.ts +1 -1
  106. package/dist/flows/CostCalculator/Results/CostCalculatorResults.js +1 -1
  107. package/dist/flows/CostCalculator/SummaryResults/SummaryResults.d.ts +1 -1
  108. package/dist/flows/CostCalculator/api.d.ts +1 -1
  109. package/dist/flows/CostCalculator/api.js +1 -1
  110. package/dist/flows/CostCalculator/components/SalaryField.d.ts +2 -2
  111. package/dist/flows/CostCalculator/components/SalaryField.js +1 -1
  112. package/dist/flows/CostCalculator/context.d.ts +3 -3
  113. package/dist/flows/CostCalculator/hooks.d.ts +3 -3
  114. package/dist/flows/CostCalculator/hooks.js +1 -1
  115. package/dist/flows/CostCalculator/index.d.ts +3 -3
  116. package/dist/flows/CostCalculator/index.js +1 -1
  117. package/dist/flows/CostCalculator/types.d.ts +1 -1
  118. package/dist/flows/CostCalculator/utils.d.ts +3 -3
  119. package/dist/flows/CostCalculator/utils.js +1 -1
  120. package/dist/flows/Onboarding/OnboardingFlow.d.ts +4 -4
  121. package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
  122. package/dist/flows/Onboarding/api.d.ts +6 -6
  123. package/dist/flows/Onboarding/api.js +1 -1
  124. package/dist/flows/Onboarding/components/AnnualGrossSalary.d.ts +2 -2
  125. package/dist/flows/Onboarding/components/AnnualGrossSalary.js +1 -1
  126. package/dist/flows/Onboarding/components/BasicInformationStep.d.ts +4 -4
  127. package/dist/flows/Onboarding/components/BasicInformationStep.js +1 -1
  128. package/dist/flows/Onboarding/components/BenefitsStep.d.ts +4 -4
  129. package/dist/flows/Onboarding/components/BenefitsStep.js +1 -1
  130. package/dist/flows/Onboarding/components/ContractDetailsStep.d.ts +4 -4
  131. package/dist/flows/Onboarding/components/ContractDetailsStep.js +1 -1
  132. package/dist/flows/Onboarding/components/OnboardingForm.d.ts +4 -4
  133. package/dist/flows/Onboarding/components/OnboardingForm.js +1 -1
  134. package/dist/flows/Onboarding/components/OnboardingInvite.d.ts +3 -3
  135. package/dist/flows/Onboarding/components/OnboardingInvite.js +1 -1
  136. package/dist/flows/Onboarding/components/ReviewStep.d.ts +4 -4
  137. package/dist/flows/Onboarding/components/SaveDraftButton.d.ts +3 -3
  138. package/dist/flows/Onboarding/components/SelectCountryStep.d.ts +4 -4
  139. package/dist/flows/Onboarding/components/SelectCountryStep.js +1 -1
  140. package/dist/flows/Onboarding/context.d.ts +4 -4
  141. package/dist/flows/Onboarding/hooks.d.ts +4 -4
  142. package/dist/flows/Onboarding/hooks.js +1 -1
  143. package/dist/flows/Onboarding/index.d.ts +4 -4
  144. package/dist/flows/Onboarding/index.js +1 -1
  145. package/dist/flows/Onboarding/types.d.ts +4 -4
  146. package/dist/flows/Onboarding/utils.d.ts +4 -4
  147. package/dist/flows/Termination/AdditionalDetailsForm.d.ts +4 -5
  148. package/dist/flows/Termination/AdditionalDetailsForm.js +1 -1
  149. package/dist/flows/Termination/EmployeeComunicationForm.d.ts +4 -5
  150. package/dist/flows/Termination/EmployeeComunicationForm.js +1 -1
  151. package/dist/flows/Termination/PaidTimeOffForm.d.ts +4 -5
  152. package/dist/flows/Termination/PaidTimeOffForm.js +1 -1
  153. package/dist/flows/Termination/TerminationDetailsForm.d.ts +4 -5
  154. package/dist/flows/Termination/TerminationDetailsForm.js +1 -1
  155. package/dist/flows/Termination/TerminationFlow.d.ts +4 -5
  156. package/dist/flows/Termination/TerminationFlow.js +1 -1
  157. package/dist/flows/Termination/TerminationForm.d.ts +4 -5
  158. package/dist/flows/Termination/TerminationForm.js +1 -1
  159. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOff.d.ts +16 -5
  160. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOff.js +1 -1
  161. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.d.ts +19 -0
  162. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.js +2 -0
  163. package/dist/flows/Termination/components/PaidTimeOff/types.d.ts +6 -0
  164. package/dist/flows/Termination/components/PaidTimeOff/types.js +1 -0
  165. package/dist/flows/Termination/components/PaidTimeOff/types.js.map +1 -0
  166. package/dist/flows/Termination/components/TerminationDialogInfoContent/TerminationDialogInfoContent.js +1 -1
  167. package/dist/flows/Termination/context.d.ts +4 -5
  168. package/dist/flows/Termination/hooks.d.ts +4 -5
  169. package/dist/flows/Termination/hooks.js +1 -1
  170. package/dist/flows/Termination/index.d.ts +8 -5
  171. package/dist/flows/Termination/index.js +1 -1
  172. package/dist/flows/Termination/json-schemas/jsonSchema.js +1 -1
  173. package/dist/flows/Termination/json-schemas/schema.js +1 -1
  174. package/dist/flows/Termination/types.d.ts +4 -5
  175. package/dist/flows/api.d.ts +4 -5
  176. package/dist/flows/api.js +1 -1
  177. package/dist/index.d.ts +12 -74
  178. package/dist/index.js +1 -1
  179. package/dist/index.js.map +1 -1
  180. package/dist/internals.js +1 -1
  181. package/dist/{mutations-juOpbR-A.d.ts → mutations-CAhYrKGA.d.ts} +1 -1
  182. package/dist/{remoteFlows-D1VLPcdi.d.ts → remoteFlows-HxRw2Djx.d.ts} +10 -2
  183. package/dist/types-1R2vg9SL.d.ts +179 -0
  184. package/dist/{types-CCzA9vuJ.d.ts → types-BsT_1de7.d.ts} +3 -3
  185. package/dist/{types-CBySMyLF.d.ts → types-DU4HZ7C6.d.ts} +4 -4
  186. package/dist/{types-Cl_jsVYv.d.ts → types-r1cKZ-RE.d.ts} +2 -5
  187. package/dist/{types.gen-CxiSXabT.d.ts → types.gen-oeDSqezz.d.ts} +11 -3
  188. package/package.json +1 -1
  189. package/dist/chunk-2UAG6WDW.js +0 -2
  190. package/dist/chunk-7XRPOR7L.js +0 -2
  191. package/dist/chunk-7XRPOR7L.js.map +0 -1
  192. package/dist/chunk-AHBACWMD.js +0 -2
  193. package/dist/chunk-AHBACWMD.js.map +0 -1
  194. package/dist/chunk-CGUTMSAU.js +0 -2
  195. package/dist/chunk-CGUTMSAU.js.map +0 -1
  196. package/dist/chunk-G34OX26W.js +0 -2
  197. package/dist/chunk-G34OX26W.js.map +0 -1
  198. package/dist/chunk-HYIC33YR.js +0 -2
  199. package/dist/chunk-HYIC33YR.js.map +0 -1
  200. package/dist/chunk-IXAWEBRI.js.map +0 -1
  201. package/dist/chunk-SGJSMTYG.js +0 -2
  202. package/dist/chunk-SGJSMTYG.js.map +0 -1
  203. package/dist/flows/Termination/TimeOff.d.ts +0 -11
  204. package/dist/flows/Termination/TimeOff.js +0 -2
  205. /package/dist/{chunk-Q5ZRKZMK.js.map → chunk-2M7EBC4K.js.map} +0 -0
  206. /package/dist/{chunk-FMBYJANY.js.map → chunk-4DCENNLW.js.map} +0 -0
  207. /package/dist/{chunk-N6KOPITR.js.map → chunk-4M4OJPUA.js.map} +0 -0
  208. /package/dist/{chunk-U2LOBJFU.js.map → chunk-4URY37KB.js.map} +0 -0
  209. /package/dist/{chunk-TB75BHYW.js.map → chunk-5XHKOMX5.js.map} +0 -0
  210. /package/dist/{chunk-NIH7XLAK.js.map → chunk-A7HJICVX.js.map} +0 -0
  211. /package/dist/{chunk-5A54AHAT.js.map → chunk-BDPCUDJB.js.map} +0 -0
  212. /package/dist/{chunk-5H5INKOY.js.map → chunk-BGU3LZ2S.js.map} +0 -0
  213. /package/dist/{chunk-BNHN4CEM.js.map → chunk-BMDZJNJV.js.map} +0 -0
  214. /package/dist/{chunk-3W7RKLJX.js.map → chunk-BVN2DKO5.js.map} +0 -0
  215. /package/dist/{chunk-HEQLPSHZ.js.map → chunk-C2BBQDCU.js.map} +0 -0
  216. /package/dist/{chunk-S2XKE7EA.js.map → chunk-D5RCRFJM.js.map} +0 -0
  217. /package/dist/{chunk-LEXD5FVL.js.map → chunk-DYWOG7Q2.js.map} +0 -0
  218. /package/dist/{chunk-RDCWARSM.js.map → chunk-EFPZOIQ2.js.map} +0 -0
  219. /package/dist/{chunk-XMAQ4NRR.js.map → chunk-EZV6DOVQ.js.map} +0 -0
  220. /package/dist/{chunk-L2IKFFQX.js.map → chunk-GGXK727I.js.map} +0 -0
  221. /package/dist/{chunk-NGTESOKF.js.map → chunk-HFI2MD3H.js.map} +0 -0
  222. /package/dist/{chunk-ILPYR7RQ.js.map → chunk-HLPKGITX.js.map} +0 -0
  223. /package/dist/{chunk-RF5SLMJF.js.map → chunk-ISZQNKMD.js.map} +0 -0
  224. /package/dist/{chunk-DUD7B2IY.js.map → chunk-IUJXAZHK.js.map} +0 -0
  225. /package/dist/{chunk-IYGJ5QJB.js.map → chunk-IUZ7DEXC.js.map} +0 -0
  226. /package/dist/{chunk-O4DIUKVP.js.map → chunk-KPTF6LPP.js.map} +0 -0
  227. /package/dist/{chunk-PKRI35YC.js.map → chunk-KYSKA2UK.js.map} +0 -0
  228. /package/dist/{chunk-2T2N5226.js.map → chunk-L2BJK3K5.js.map} +0 -0
  229. /package/dist/{chunk-FBJCDOO7.js.map → chunk-LRGEEPGK.js.map} +0 -0
  230. /package/dist/{chunk-B7I7YVNK.js.map → chunk-MP2T74PU.js.map} +0 -0
  231. /package/dist/{chunk-PWPFCC6I.js.map → chunk-NVYMAOQ7.js.map} +0 -0
  232. /package/dist/{chunk-SA3D5OH4.js.map → chunk-NYEZAOUI.js.map} +0 -0
  233. /package/dist/{chunk-2DSNHYHZ.js.map → chunk-NYM7QGN2.js.map} +0 -0
  234. /package/dist/{chunk-GKS3W6KT.js.map → chunk-O5MKPE6I.js.map} +0 -0
  235. /package/dist/{chunk-PAT3EA43.js.map → chunk-O7REUCKR.js.map} +0 -0
  236. /package/dist/{chunk-64NSBY5G.js.map → chunk-OEAHDUWE.js.map} +0 -0
  237. /package/dist/{chunk-2UAG6WDW.js.map → chunk-Q3A4A2HL.js.map} +0 -0
  238. /package/dist/{chunk-LUDRB7LC.js.map → chunk-QKLIYOMA.js.map} +0 -0
  239. /package/dist/{chunk-JVSD4JOU.js.map → chunk-RC3XP5WU.js.map} +0 -0
  240. /package/dist/{chunk-4NAVUB7D.js.map → chunk-RINDVT6U.js.map} +0 -0
  241. /package/dist/{chunk-7IZGKQII.js.map → chunk-RQXKQTRD.js.map} +0 -0
  242. /package/dist/{chunk-VT4GSXMI.js.map → chunk-SHF5L3PW.js.map} +0 -0
  243. /package/dist/{chunk-G4QOEPDP.js.map → chunk-UIO6B4GN.js.map} +0 -0
  244. /package/dist/{chunk-4HT7RNFP.js.map → chunk-UTBVLDKY.js.map} +0 -0
  245. /package/dist/{chunk-JF3KJ6PA.js.map → chunk-VUP76ZMQ.js.map} +0 -0
  246. /package/dist/{chunk-CRHH6IPF.js.map → chunk-VYDVPM5S.js.map} +0 -0
  247. /package/dist/{chunk-3XDJ2LRT.js.map → chunk-WFMQ2IDE.js.map} +0 -0
  248. /package/dist/{chunk-HPBT677J.js.map → chunk-WNXB2Y65.js.map} +0 -0
  249. /package/dist/{chunk-IM525UMG.js.map → chunk-YPHOFQ5O.js.map} +0 -0
  250. /package/dist/flows/Termination/{TimeOff.js.map → components/PaidTimeOff/PaidTimeOffContainer.js.map} +0 -0
@@ -0,0 +1,179 @@
1
+ import { E as EmploymentShowResponse, T as ListTimeoffResponse, W as TimeoffStatus, X as TimeoffType, Y as ListLeavePoliciesSummaryResponse } from './types.gen-oeDSqezz.js';
2
+ import * as _tanstack_react_query from '@tanstack/react-query';
3
+ import { UseQueryResult } from '@tanstack/react-query';
4
+ import { ContractAmendmentParams } from './flows/ContractAmendment/types.js';
5
+
6
+ type UseEmployment = Pick<ContractAmendmentParams, 'employmentId'>;
7
+ /**
8
+ * Hook to retrieve employment details for a specific employment ID.
9
+ *
10
+ * @param {Object} params - The parameters for the query.
11
+ * @param {string} params.employmentId - The ID of the employment to fetch details for.
12
+ * @returns {UseQueryResult<any, unknown>} - The result of the query, including the employment details.
13
+ */
14
+ declare const useEmploymentQuery: ({ employmentId }: UseEmployment) => _tanstack_react_query.UseQueryResult<EmploymentShowResponse | undefined, Error>;
15
+ /**
16
+ * Hook to retrieve time off data for a specific employment.
17
+ *
18
+ * @param {Object} params - The parameters for the query.
19
+ * @param {string} [params.employmentId] - The ID of the employment to fetch time off data for.
20
+ * @param {TimeoffStatus} [params.status] - The status of the time off requests to filter by (e.g., 'approved', 'pending').
21
+ * @returns {UseQueryResult<any, unknown>} - The result of the query, including the time off data.
22
+ *
23
+ */
24
+ declare const useTimeOffQuery: <TData = ListTimeoffResponse>({ employmentId, status, timeoffType, options, }: {
25
+ employmentId?: string;
26
+ status?: TimeoffStatus;
27
+ timeoffType?: TimeoffType;
28
+ options?: {
29
+ enabled?: boolean;
30
+ select?: (data: ListTimeoffResponse | undefined) => TData;
31
+ };
32
+ }) => _tanstack_react_query.UseQueryResult<TData, Error>;
33
+ type PaidTimeoffBreakdownResponse = {
34
+ bookedDays: number;
35
+ timeoffs: {
36
+ status: string;
37
+ duration: number;
38
+ startDate: string;
39
+ endDate: string;
40
+ formattedDate: string;
41
+ }[];
42
+ };
43
+ /**
44
+ * Hook to retrieve paid time off breakdown for a specific employment.
45
+ *
46
+ * @param {Object} params - The parameters for the query.
47
+ * @param {string} [params.employmentId] - The ID of the employment to fetch paid time off breakdown for.
48
+ * @returns {UseQueryResult<any, unknown>} - The result of the query, including the paid time off breakdown.
49
+ *
50
+ */
51
+ declare const usePaidTimeoffBreakdownQuery: ({ employmentId, options, }: {
52
+ employmentId?: string;
53
+ options?: {
54
+ enabled?: boolean;
55
+ };
56
+ }) => _tanstack_react_query.UseQueryResult<PaidTimeoffBreakdownResponse, Error>;
57
+ type BookedTimeoffBeforeDateResponse = {
58
+ bookedDaysBeforeTermination: number;
59
+ bookedDaysAfterTermination: number;
60
+ };
61
+ /**
62
+ * Hook to retrieve booked time off data before and after a specific date for a specific employment.
63
+ *
64
+ * @param {Object} params - The parameters for the query.
65
+ * @param {string} [params.employmentId] - The ID of the employment to fetch booked time off data for.
66
+ * @param {string} [params.date] - The date to fetch booked time off data for.
67
+ * @returns {BookedTimeoffBeforeDateResponse} - The booked time off data before and after the specific date.
68
+ *
69
+ * This hooks it's not taking into account unlimited time off or half days yet or even we you request several days in one request.
70
+ */
71
+ declare const useBookedTimeoffBeforeAndAfterTerminationQuery: ({ employmentId, date, options, }: {
72
+ employmentId: string;
73
+ date: string;
74
+ options?: {
75
+ enabled: boolean;
76
+ };
77
+ }) => _tanstack_react_query.UseQueryResult<BookedTimeoffBeforeDateResponse, Error>;
78
+ type SummaryTimeOffDataResponse = {
79
+ entitledDays: number;
80
+ bookedDays: number;
81
+ usedDays: number;
82
+ approvedDaysBeforeTermination: number;
83
+ approvedDaysAfterTermination: number;
84
+ remainingDays: number;
85
+ };
86
+ /**
87
+ * Hook to retrieve summary time off data for a specific employment.
88
+ *
89
+ * @param {Object} params - The parameters for the query.
90
+ * @param {string} [params.employmentId] - The ID of the employment to fetch summary time off data for.
91
+ * @param {string} [params.proposedTerminationDate] - The proposed termination date to fetch summary time off data for.
92
+ * @returns {SummaryTimeOffDataResponse} - The summary time off data.
93
+ *
94
+ * This hook doesn't take into account unlimited time off or half days yet.
95
+ *
96
+ */
97
+ declare const useSummaryTimeOffDataQuery: ({ employmentId, proposedTerminationDate, }: {
98
+ employmentId: string;
99
+ proposedTerminationDate: string;
100
+ }) => {
101
+ data: {
102
+ entitledDays: number;
103
+ bookedDays: number;
104
+ usedDays: number;
105
+ approvedDaysBeforeTermination: number;
106
+ approvedDaysAfterTermination: number;
107
+ remainingDays: number;
108
+ };
109
+ isLoading: boolean;
110
+ isError: boolean;
111
+ error: Error | null;
112
+ };
113
+ /**
114
+ * Hook to retrieve time off balance for a specific employment.
115
+ *
116
+ * @param {Object} params - The parameters for the query.
117
+ * @param {string} [params.employmentId] - The ID of the employment to fetch time off balance for.
118
+ * @returns {UseQueryResult<any, unknown>} - The result of the query, including the time off balance.
119
+ *
120
+ */
121
+ declare const useTimeOffLeavePoliciesSummaryQuery: ({ employmentId, }: {
122
+ employmentId?: string;
123
+ }) => _tanstack_react_query.UseQueryResult<ListLeavePoliciesSummaryResponse | undefined, Error>;
124
+
125
+ type PaidTimeOffRenderProps = {
126
+ /**
127
+ * The query result for the leave policies summary.
128
+ * @see {@link useTimeOffLeavePoliciesSummaryQuery}
129
+ */
130
+ leavePoliciesSummaryQuery: UseQueryResult<ListLeavePoliciesSummaryResponse | undefined, Error>;
131
+ /**
132
+ * The formatted proposed termination date.
133
+ */
134
+ formattedProposedTerminationDate: string;
135
+ /**
136
+ * The name of the employee.
137
+ */
138
+ employeeName: string;
139
+ /**
140
+ * The proposed termination date.
141
+ */
142
+ proposedTerminationDate: string;
143
+ /**
144
+ * The function to open the details drawer.
145
+ */
146
+ onOpenChange: () => void;
147
+ /**
148
+ * Whether the details drawer is open.
149
+ */
150
+ open: boolean;
151
+ /**
152
+ * The query result for the paid time off breakdown.
153
+ * @see {@link usePaidTimeoffBreakdownQuery}
154
+ */
155
+ timeoffQuery: UseQueryResult<PaidTimeoffBreakdownResponse | undefined, Error>;
156
+ /**
157
+ * The query result for the booked time off before and after termination.
158
+ * @see {@link useBookedTimeoffBeforeAndAfterTerminationQuery}
159
+ */
160
+ bookedTimeBeforeAndAfterTerminationQuery: UseQueryResult<BookedTimeoffBeforeDateResponse | undefined, Error>;
161
+ /**
162
+ * The summary data for the paid time off.
163
+ * @see {@link useSummaryTimeOffDataQuery}
164
+ */
165
+ summaryData: {
166
+ data: SummaryTimeOffDataResponse;
167
+ isLoading: boolean;
168
+ isError: boolean;
169
+ error: Error | null;
170
+ };
171
+ };
172
+ type PaidTimeOffContainerProps = {
173
+ employmentId: string;
174
+ proposedTerminationDate: string;
175
+ employeeName: string;
176
+ render: (props: PaidTimeOffRenderProps) => React.ReactNode;
177
+ };
178
+
179
+ export { type BookedTimeoffBeforeDateResponse as B, type PaidTimeOffRenderProps as P, type SummaryTimeOffDataResponse as S, type PaidTimeOffContainerProps as a, useTimeOffQuery as b, type PaidTimeoffBreakdownResponse as c, usePaidTimeoffBreakdownQuery as d, useBookedTimeoffBeforeAndAfterTerminationQuery as e, useSummaryTimeOffDataQuery as f, useTimeOffLeavePoliciesSummaryQuery as g, useEmploymentQuery as u };
@@ -1,10 +1,10 @@
1
- import { u as EmploymentCreationResponse, A as EmploymentResponse, S as SuccessResponse, y as PostCreateEmployment2Error, B as PatchUpdateEmployment2Error, G as PutUpdateBenefitOfferError, j as Employment$1, z as EmploymentCreateParams } from './types.gen-CxiSXabT.js';
1
+ import { n as EmploymentCreationResponse, q as EmploymentResponse, S as SuccessResponse, o as PostCreateEmployment2Error, r as PatchUpdateEmployment2Error, t as PutUpdateBenefitOfferError, j as Employment$1, p as EmploymentCreateParams } from './types.gen-oeDSqezz.js';
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
3
  import { OnboardingBack } from './flows/Onboarding/components/OnboardingBack.js';
4
4
  import { OnboardingInvite } from './flows/Onboarding/components/OnboardingInvite.js';
5
- import { N as NormalizedFieldError, S as SuccessResponse$1, E as ErrorResponse } from './mutations-juOpbR-A.js';
5
+ import { N as NormalizedFieldError, S as SuccessResponse$1, E as ErrorResponse } from './mutations-CAhYrKGA.js';
6
6
  import { OnboardingSubmit } from './flows/Onboarding/components/OnboardingSubmit.js';
7
- import { C as Components, M as Meta, J as JSFFieldset } from './remoteFlows-D1VLPcdi.js';
7
+ import { C as Components, M as Meta, J as JSFFieldset } from './remoteFlows-HxRw2Djx.js';
8
8
  import * as _tanstack_query_core from '@tanstack/query-core';
9
9
  import * as React$1 from 'react';
10
10
  import * as _remoteoss_json_schema_form from '@remoteoss/json-schema-form';
@@ -1,18 +1,18 @@
1
- import { j as Employment, F as File, g as CreateContractDocumentResponse, f as SignContractDocument, S as SuccessResponse } from './types.gen-CxiSXabT.js';
1
+ import { j as Employment, F as File, g as CreateContractDocumentResponse, f as SignContractDocument, S as SuccessResponse } from './types.gen-oeDSqezz.js';
2
2
  import { OnboardingBack } from './flows/ContractorOnboarding/components/OnboardingBack.js';
3
3
  import { OnboardingSubmit } from './flows/ContractorOnboarding/components/OnboardingSubmit.js';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
- import { N as NormalizedFieldError } from './mutations-juOpbR-A.js';
5
+ import { N as NormalizedFieldError } from './mutations-CAhYrKGA.js';
6
6
  import * as _tanstack_query_core from '@tanstack/query-core';
7
7
  import * as _remoteoss_json_schema_form from '@remoteoss/json-schema-form';
8
8
  import { Fields } from '@remoteoss/json-schema-form';
9
9
  import * as React$1 from 'react';
10
10
  import { STEPS } from './flows/ContractorOnboarding/utils.js';
11
11
  import { Step } from './flows/useStepState.js';
12
- import { M as Meta, J as JSFFieldset, $ as $TSFixMe } from './remoteFlows-D1VLPcdi.js';
12
+ import { M as Meta, J as JSFFieldset, $ as $TSFixMe } from './remoteFlows-HxRw2Djx.js';
13
13
  import { FieldValues } from 'react-hook-form';
14
14
  import { BasicInformationStep } from './flows/ContractorOnboarding/components/BasicInformationStep.js';
15
- import { g as SelectCountryStep } from './types-CCzA9vuJ.js';
15
+ import { g as SelectCountryStep } from './types-BsT_1de7.js';
16
16
  import { FlowOptions, JSFModify } from './flows/types.js';
17
17
  import { OnboardingInvite } from './flows/Onboarding/components/OnboardingInvite.js';
18
18
 
@@ -1,13 +1,12 @@
1
- import { O as OffboardingResponse, P as PostCreateOffboardingError, $ as TerminationDetailsParams } from './types.gen-CxiSXabT.js';
1
+ import { O as OffboardingResponse, P as PostCreateOffboardingError, $ as TerminationDetailsParams } from './types.gen-oeDSqezz.js';
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
- import { E as ErrorResponse, S as SuccessResponse } from './mutations-juOpbR-A.js';
3
+ import { E as ErrorResponse, S as SuccessResponse } from './mutations-CAhYrKGA.js';
4
4
  import * as _remoteoss_json_schema_form from '@remoteoss/json-schema-form';
5
5
  import { $TSFixMe } from '@remoteoss/json-schema-form';
6
6
  import { Step } from './flows/useStepState.js';
7
7
  import { StepTerminationKeys } from './flows/Termination/utils.js';
8
8
  import { TerminationBack } from './flows/Termination/TerminationBack.js';
9
9
  import { TerminationSubmit } from './flows/Termination/TerminationSubmit.js';
10
- import { TimeOff } from './flows/Termination/TimeOff.js';
11
10
  import { JSFModify } from './flows/types.js';
12
11
 
13
12
  type AdditionalDetailsFormProps = {
@@ -145,7 +144,6 @@ type TerminationRenderProps = {
145
144
  * The components used in the termination flow.
146
145
  * This includes different steps, submit button, back button and timeoff.
147
146
  * @see {@link TerminationSubmit}
148
- * @see {@link TimeOff}
149
147
  * @see {@link TerminationBack}
150
148
  * @see {@link EmployeeCommunicationForm}
151
149
  * @see {@link TerminationDetailsForm}
@@ -154,7 +152,6 @@ type TerminationRenderProps = {
154
152
  */
155
153
  components: {
156
154
  SubmitButton: typeof TerminationSubmit;
157
- TimeOff: typeof TimeOff;
158
155
  Back: typeof TerminationBack;
159
156
  EmployeeComunicationStep: typeof EmployeeCommunicationForm;
160
157
  TerminationDetailsStep: typeof TerminationDetailsForm;
@@ -806,6 +806,14 @@ type LeavePolicySummary = {
806
806
  * The balance is the entitlement minus the taken timeoff (i.e 10 entitlement - 3 taken = 7 balance)
807
807
  */
808
808
  balance: UnlimitedDaysandHoursResponse | LimitedDaysandHoursResponse;
809
+ /**
810
+ * Includes all upcoming requested time off.
811
+ */
812
+ booked: {
813
+ days: number;
814
+ hours: number;
815
+ type: 'limited';
816
+ };
809
817
  /**
810
818
  * The current entitlement is the accrued time entitled for the employee plus any other extra entitlements (such as carryover).
811
819
  */
@@ -980,7 +988,7 @@ type Company = {
980
988
  /**
981
989
  * Fields can vary depending on the country. Please, check the required fields structure using the [Show form schema endpoint](#operation/get_show_form_country).
982
990
  * Use the desired country and `address_details` as the form name for the placeholders.
983
- * The response complies with the [JSON Schema](https://remote.com/resources/api/how-json-schemas-work) specification.
991
+ * The response complies with the [JSON Schema](https://developer.remote.com/docs/how-json-schemas-work) specification.
984
992
  *
985
993
  */
986
994
  address_details: {
@@ -989,7 +997,7 @@ type Company = {
989
997
  /**
990
998
  * Fields can vary depending on the country. Please, check the required fields structure using the [Show form schema endpoint](#operation/get_show_form_country).
991
999
  * Use the desired country and `bank_account_details` as the form name for the placeholders.
992
- * The response complies with the [JSON Schema](https://remote.com/resources/api/how-json-schemas-work) specification.
1000
+ * The response complies with the [JSON Schema](https://developer.remote.com/docs/how-json-schemas-work) specification.
993
1001
  *
994
1002
  */
995
1003
  bank_account_details?: {
@@ -1581,4 +1589,4 @@ type PostSignContractDocumentErrors = {
1581
1589
  };
1582
1590
  type PostSignContractDocumentError = PostSignContractDocumentErrors[keyof PostSignContractDocumentErrors];
1583
1591
 
1584
- export type { TerminationDetailsParams as $, EmploymentResponse as A, PatchUpdateEmployment2Error as B, CreateOffboardingParams as C, EmploymentFullParams as D, EmploymentShowResponse as E, File as F, PutUpdateBenefitOfferError as G, MagicLinkResponse as H, UnprocessableEntityResponse as I, MagicLinkParams as J, ConvertCurrencyResponse as K, ListTimeoffResponse as L, MinimalRegion as M, PostConvertRawCurrencyConverterError as N, OffboardingResponse as O, PostCreateOffboardingError as P, ConvertCurrencyParams as Q, PostCreateContractEligibilityError as R, SuccessResponse as S, CreateContractEligibilityParams as T, UnifiedEmploymentUpsertBenefitOffersRequest as U, ValidationError as V, TimeoffStatus as W, TimeoffType as X, ListLeavePoliciesSummaryResponse as Y, Currency as Z, HelpCenterArticle as _, ContractAmendmentAutomatableResponse as a, PostAutomatableContractAmendmentError as b, ContractAmendmentResponse as c, PostCreateContractAmendmentError as d, PostSignContractDocumentError as e, SignContractDocument as f, CreateContractDocumentResponse as g, PostCreateContractDocumentError as h, CreateContractDocument as i, Employment as j, CostCalculatorEstimateResponse as k, PostCreateEstimationError as l, CostCalculatorEstimatePdfResponse as m, PostCreateEstimationPdfError as n, CostCalculatorEstimateParams as o, CostCalculatorEstimateCsvResponse as p, PostCreateEstimationCsvError as q, MinimalCountry as r, EmploymentTermType as s, CostCalculatorEmployment as t, EmploymentCreationResponse as u, Company as v, PostInviteEmploymentInvitationError as w, PostCreateRiskReserveError as x, PostCreateEmployment2Error as y, EmploymentCreateParams as z };
1592
+ export type { TerminationDetailsParams as $, CreateContractEligibilityParams as A, CostCalculatorEstimateResponse as B, CreateOffboardingParams as C, PostCreateEstimationError as D, EmploymentShowResponse as E, File as F, CostCalculatorEstimatePdfResponse as G, PostCreateEstimationPdfError as H, CostCalculatorEstimateParams as I, CostCalculatorEstimateCsvResponse as J, PostCreateEstimationCsvError as K, MinimalRegion as L, MagicLinkResponse as M, MinimalCountry as N, OffboardingResponse as O, PostCreateOffboardingError as P, EmploymentTermType as Q, CostCalculatorEmployment as R, SuccessResponse as S, ListTimeoffResponse as T, UnifiedEmploymentUpsertBenefitOffersRequest as U, ValidationError as V, TimeoffStatus as W, TimeoffType as X, ListLeavePoliciesSummaryResponse as Y, Currency as Z, HelpCenterArticle as _, ContractAmendmentAutomatableResponse as a, PostAutomatableContractAmendmentError as b, ContractAmendmentResponse as c, PostCreateContractAmendmentError as d, PostSignContractDocumentError as e, SignContractDocument as f, CreateContractDocumentResponse as g, PostCreateContractDocumentError as h, CreateContractDocument as i, Employment as j, Company as k, PostInviteEmploymentInvitationError as l, PostCreateRiskReserveError as m, EmploymentCreationResponse as n, PostCreateEmployment2Error as o, EmploymentCreateParams as p, EmploymentResponse as q, PatchUpdateEmployment2Error as r, EmploymentFullParams as s, PutUpdateBenefitOfferError as t, UnprocessableEntityResponse as u, MagicLinkParams as v, ConvertCurrencyResponse as w, PostConvertRawCurrencyConverterError as x, ConvertCurrencyParams as y, PostCreateContractEligibilityError as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remoteoss/remote-flows",
3
- "version": "0.23.0",
3
+ "version": "0.24.0",
4
4
  "scripts": {
5
5
  "build": "NODE_ENV=production tsup",
6
6
  "ci": "npm run build && npm run check-format && npm run check-exports && npm run lint && npm run type-check && npm run test",
@@ -1,2 +0,0 @@
1
- import{a as m}from"./chunk-4T6PRR6R.js";import{a as e}from"./chunk-GC23RRCI.js";import{a as i}from"./chunk-XSHHMBMT.js";import{a as o}from"./chunk-N6G4VZXF.js";var p={employee_communication:o,termination_details:e,paid_time_off:m,additional_information:i};export{p as a};
2
- //# sourceMappingURL=chunk-2UAG6WDW.js.map
@@ -1,2 +0,0 @@
1
- import{a as o}from"./chunk-P37U34EQ.js";function i(e){if(!e||!e.errors||typeof e.errors!="object")return[];let n=[];return Object.entries(e.errors).forEach(([t,a])=>{if(Array.isArray(a)){n.push({field:t,messages:a.map(r=>String(r))});return}a&&typeof a=="object"&&Object.entries(a).forEach(([r,s])=>{Array.isArray(s)&&n.push({field:r,messages:s.map(l=>String(l))})})}),n}o(i,"extractFieldErrors");function u(e){return{mutateAsync:o(n=>new Promise((t,a)=>{e.mutate(n,{onSuccess:o(r=>{if(r.data)t({data:r.data,error:null});else{let s=i(r.error);t({data:null,error:r.error?.message?new Error(r.error.message):new Error("Something went wrong. Please try again later."),rawError:r.error,fieldErrors:s})}},"onSuccess"),onError:o(r=>{let s=i(r);a({data:null,error:r,rawError:r,fieldErrors:s})},"onError")})}),"mutateAsync")}}o(u,"mutationToPromise");function d(e,n){return!e||e.length===0?[]:e.map(t=>{let r=n?.[t.field]?.label||t.field;return{...t,userFriendlyLabel:r,field:t.field,messages:t.messages}})}o(d,"normalizeFieldErrors");export{u as a,d as b};
2
- //# sourceMappingURL=chunk-7XRPOR7L.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/lib/mutations.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { Meta } from '@/src/types/remoteFlows';\nimport { UseMutationResult } from '@tanstack/react-query';\n\ntype MutationData<T> =\n T extends UseMutationResult<infer R, any, any, any> ? R : never;\ntype MutationVariables<T> =\n T extends UseMutationResult<any, any, infer V, any> ? V : never;\ntype MutationError<T> =\n T extends UseMutationResult<any, infer E, any, any> ? E : never;\n\nexport interface SuccessResponse<D> {\n data: D;\n error: null;\n}\n\nexport interface FieldError {\n field: string;\n messages: string[];\n}\n\nexport interface ErrorResponse<E> {\n data: null;\n error: E;\n rawError: Record<string, unknown>;\n fieldErrors: FieldError[];\n}\n\ntype PromiseResult<D, E> = SuccessResponse<D> | ErrorResponse<E>;\n\n/**\n * Extracts field errors from error response into a structured format\n * @param error - The error response object\n * @returns Array of field errors with field name and messages\n */\nexport function extractFieldErrors(error: any): FieldError[] {\n if (!error || !error.errors || typeof error.errors !== 'object') return [];\n\n const fieldErrors: FieldError[] = [];\n\n Object.entries(error.errors).forEach(([key, value]) => {\n if (Array.isArray(value)) {\n fieldErrors.push({\n field: key,\n messages: value.map((msg: any) => String(msg)),\n });\n return;\n }\n if (value && typeof value === 'object') {\n Object.entries(value).forEach(([nestedKey, nestedValue]) => {\n if (Array.isArray(nestedValue)) {\n fieldErrors.push({\n field: nestedKey,\n messages: nestedValue.map((msg: any) => String(msg)),\n });\n }\n });\n }\n });\n return fieldErrors;\n}\n/**\n * Converts a mutation to a promise-based API. We avoid using the\n * `mutateAsync` method from react-query for 2 reasons:\n * 1. We lose the isPending state of the mutation\n * 2. We want to return the data and error in a consistent way\n * (either data or error is null)\n * @param mutation\n * @returns\n */\nexport function mutationToPromise<\n T extends UseMutationResult<any, any, any, any>,\n>(mutation: T) {\n type Data = MutationData<T>;\n type Variables = MutationVariables<T>;\n type Error = MutationError<T>;\n\n return {\n mutateAsync: (values: Variables): Promise<PromiseResult<Data, Error>> => {\n return new Promise((resolve, reject) => {\n mutation.mutate(values, {\n onSuccess: (response) => {\n if (response.data) {\n resolve({\n data: response.data as Data,\n error: null,\n });\n } else {\n const fieldErrors = extractFieldErrors(response.error);\n resolve({\n data: null,\n error: response.error?.message\n ? (new Error(response.error.message) as unknown as Error)\n : (new Error(\n 'Something went wrong. Please try again later.',\n ) as unknown as Error),\n rawError: response.error,\n fieldErrors,\n });\n }\n },\n onError: (error) => {\n const fieldErrors = extractFieldErrors(error);\n reject({\n data: null,\n error: error as Error,\n rawError: error,\n fieldErrors,\n });\n },\n });\n });\n },\n };\n}\n\n/**\n * Enhanced FieldError interface with user-friendly labels\n */\nexport interface NormalizedFieldError extends FieldError {\n userFriendlyLabel: string;\n}\n\n/**\n * Utility function to normalize field errors using field metadata\n * @param fieldErrors - Array of field errors from API response\n * @param meta - Field metadata containing field names and labels\n * @returns Normalized field errors with user-friendly labels\n */\nexport function normalizeFieldErrors(\n fieldErrors: FieldError[],\n meta?: Meta,\n): NormalizedFieldError[] {\n if (!fieldErrors || fieldErrors.length === 0) {\n return [];\n }\n\n return fieldErrors.map((fieldError) => {\n const fieldMeta = meta?.[fieldError.field];\n const userFriendlyLabel = fieldMeta?.label || fieldError.field;\n\n return {\n ...fieldError,\n userFriendlyLabel,\n // Keep the original field name for form integration\n field: fieldError.field,\n messages: fieldError.messages,\n };\n });\n}\n"],"mappings":"wCAmCO,SAASA,EAAmBC,EAA0B,CAC3D,GAAI,CAACA,GAAS,CAACA,EAAM,QAAU,OAAOA,EAAM,QAAW,SAAU,MAAO,CAAC,EAEzE,IAAMC,EAA4B,CAAC,EAEnC,cAAO,QAAQD,EAAM,MAAM,EAAE,QAAQ,CAAC,CAACE,EAAKC,CAAK,IAAM,CACrD,GAAI,MAAM,QAAQA,CAAK,EAAG,CACxBF,EAAY,KAAK,CACf,MAAOC,EACP,SAAUC,EAAM,IAAKC,GAAa,OAAOA,CAAG,CAAC,CAC/C,CAAC,EACD,MACF,CACID,GAAS,OAAOA,GAAU,UAC5B,OAAO,QAAQA,CAAK,EAAE,QAAQ,CAAC,CAACE,EAAWC,CAAW,IAAM,CACtD,MAAM,QAAQA,CAAW,GAC3BL,EAAY,KAAK,CACf,MAAOI,EACP,SAAUC,EAAY,IAAKF,GAAa,OAAOA,CAAG,CAAC,CACrD,CAAC,CAEL,CAAC,CAEL,CAAC,EACMH,CACT,CAzBgBM,EAAAR,EAAA,sBAmCT,SAASS,EAEdC,EAAa,CAKb,MAAO,CACL,YAAaF,EAACG,GACL,IAAI,QAAQ,CAACC,EAASC,IAAW,CACtCH,EAAS,OAAOC,EAAQ,CACtB,UAAWH,EAACM,GAAa,CACvB,GAAIA,EAAS,KACXF,EAAQ,CACN,KAAME,EAAS,KACf,MAAO,IACT,CAAC,MACI,CACL,IAAMZ,EAAcF,EAAmBc,EAAS,KAAK,EACrDF,EAAQ,CACN,KAAM,KACN,MAAOE,EAAS,OAAO,QAClB,IAAI,MAAMA,EAAS,MAAM,OAAO,EAChC,IAAI,MACH,+CACF,EACJ,SAAUA,EAAS,MACnB,YAAAZ,CACF,CAAC,CACH,CACF,EAnBW,aAoBX,QAASM,EAACP,GAAU,CAClB,IAAMC,EAAcF,EAAmBC,CAAK,EAC5CY,EAAO,CACL,KAAM,KACN,MAAOZ,EACP,SAAUA,EACV,YAAAC,CACF,CAAC,CACH,EARS,UASX,CAAC,CACH,CAAC,EAjCU,cAmCf,CACF,CA5CgBM,EAAAC,EAAA,qBA2DT,SAASM,EACdb,EACAc,EACwB,CACxB,MAAI,CAACd,GAAeA,EAAY,SAAW,EAClC,CAAC,EAGHA,EAAY,IAAKe,GAAe,CAErC,IAAMC,EADYF,IAAOC,EAAW,KAAK,GACJ,OAASA,EAAW,MAEzD,MAAO,CACL,GAAGA,EACH,kBAAAC,EAEA,MAAOD,EAAW,MAClB,SAAUA,EAAW,QACvB,CACF,CAAC,CACH,CApBgBT,EAAAO,EAAA","names":["extractFieldErrors","error","fieldErrors","key","value","msg","nestedKey","nestedValue","__name","mutationToPromise","mutation","values","resolve","reject","response","normalizeFieldErrors","meta","fieldError","userFriendlyLabel"]}
@@ -1,2 +0,0 @@
1
- import{a as f}from"./chunk-7IZGKQII.js";import{a as r}from"./chunk-P5WUODPR.js";import{a as n}from"./chunk-SGJSMTYG.js";import{a as t}from"./chunk-CGUTMSAU.js";import{a as T}from"./chunk-SA3D5OH4.js";import{a}from"./chunk-64NSBY5G.js";import{a as p}from"./chunk-U2LOBJFU.js";import{a as e}from"./chunk-6VRUYYUV.js";import{a as m}from"./chunk-MRYRNB7Y.js";import{a as i}from"./chunk-P37U34EQ.js";import{useId as F}from"react";import{jsx as P}from"react/jsx-runtime";var x=i(({employmentId:l,render:d,options:s,initialValues:u})=>{let c=F(),o=t({employmentId:l,options:s,initialValues:u});return P(m.Provider,{value:{formId:c,terminationBag:o},children:d({terminationBag:o,components:{SubmitButton:r,TimeOff:n,Back:e,EmployeeComunicationStep:a,TerminationDetailsStep:f,PaidTimeOffStep:p,AdditionalDetailsStep:T}})})},"TerminationFlow");export{x as a};
2
- //# sourceMappingURL=chunk-AHBACWMD.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/flows/Termination/TerminationFlow.tsx"],"sourcesContent":["import { TerminationContext } from '@/src/flows/Termination/context';\nimport { useId } from 'react';\nimport { useTermination } from '@/src/flows/Termination/hooks';\nimport { TerminationSubmit } from '@/src/flows/Termination/TerminationSubmit';\nimport { TimeOff } from '@/src/flows/Termination/TimeOff';\nimport { TerminationBack } from '@/src/flows/Termination/TerminationBack';\nimport { EmployeeCommunicationForm } from '@/src/flows/Termination/EmployeeComunicationForm';\nimport { TerminationDetailsForm } from '@/src/flows/Termination/TerminationDetailsForm';\nimport { PaidTimeOffForm } from '@/src/flows/Termination/PaidTimeOffForm';\nimport { AdditionalDetailsForm } from '@/src/flows/Termination/AdditionalDetailsForm';\nimport { TerminationFlowProps } from '@/src/flows/Termination/types';\n\nexport const TerminationFlow = ({\n employmentId,\n render,\n options,\n initialValues,\n}: TerminationFlowProps) => {\n const formId = useId();\n const terminationBag = useTermination({\n employmentId,\n options,\n initialValues,\n });\n\n return (\n <TerminationContext.Provider\n value={{\n formId: formId,\n terminationBag,\n }}\n >\n {render({\n terminationBag,\n components: {\n SubmitButton: TerminationSubmit,\n TimeOff: TimeOff,\n Back: TerminationBack,\n EmployeeComunicationStep: EmployeeCommunicationForm,\n TerminationDetailsStep: TerminationDetailsForm,\n PaidTimeOffStep: PaidTimeOffForm,\n AdditionalDetailsStep: AdditionalDetailsForm,\n },\n })}\n </TerminationContext.Provider>\n );\n};\n"],"mappings":"2YACA,OAAS,SAAAA,MAAa,QAyBlB,cAAAC,MAAA,oBAdG,IAAMC,EAAkBC,EAAA,CAAC,CAC9B,aAAAC,EACA,OAAAC,EACA,QAAAC,EACA,cAAAC,CACF,IAA4B,CAC1B,IAAMC,EAASC,EAAM,EACfC,EAAiBC,EAAe,CACpC,aAAAP,EACA,QAAAE,EACA,cAAAC,CACF,CAAC,EAED,OACEN,EAACW,EAAmB,SAAnB,CACC,MAAO,CACL,OAAQJ,EACR,eAAAE,CACF,EAEC,SAAAL,EAAO,CACN,eAAAK,EACA,WAAY,CACV,aAAcG,EACd,QAASC,EACT,KAAMC,EACN,yBAA0BC,EAC1B,uBAAwBC,EACxB,gBAAiBC,EACjB,sBAAuBC,CACzB,CACF,CAAC,EACH,CAEJ,EAlC+B","names":["useId","jsx","TerminationFlow","__name","employmentId","render","options","initialValues","formId","useId","terminationBag","useTermination","TerminationContext","TerminationSubmit","TimeOff","TerminationBack","EmployeeCommunicationForm","TerminationDetailsForm","PaidTimeOffForm","AdditionalDetailsForm"]}
@@ -1,2 +0,0 @@
1
- import{a as x}from"./chunk-G34OX26W.js";import{a as k}from"./chunk-JF3KJ6PA.js";import{a as P}from"./chunk-S4XU4SE7.js";import{a as g}from"./chunk-32GSS4UM.js";import{a as F}from"./chunk-FBJCDOO7.js";import{a as V}from"./chunk-7XRPOR7L.js";import{a as S}from"./chunk-B7I7YVNK.js";import{a as M,b as w}from"./chunk-Q5ZRKZMK.js";import{a as h}from"./chunk-PJBAQZ6G.js";import{a as T}from"./chunk-Z5WMKCRJ.js";import{c as m}from"./chunk-PAQW5BFW.js";import{a as r}from"./chunk-43WMZDDH.js";import{a as i}from"./chunk-P37U34EQ.js";import{createHeadlessForm as K}from"@remoteoss/json-schema-form";import Z from"lodash.omitby";import U from"lodash.isnull";import W from"lodash.omit";import{useMemo as j}from"react";import{jsx as N,jsxs as q}from"react/jsx-runtime";function _(t,e,d){return{presentation:{inputType:"hidden",Component:i(()=>q("div",{className:r("RemoteFlows__InformationStatement",d?.className),children:[N("h3",{className:r("RemoteFlows__InformationStatement__Title"),children:t}),N("p",{className:r("RemoteFlows__InformationStatement__Description"),children:e})]}),"Component")}}}i(_,"createInformationField");import{Fragment as Q,jsx as b,jsxs as X}from"react/jsx-runtime";function G(t){return{confidential:"",customer_informed_employee:"",customer_informed_employee_date:"",customer_informed_employee_description:"",personal_email:"",termination_reason:void 0,reason_description:"",termination_reason_files:[],will_challenge_termination:"",will_challenge_termination_description:null,agrees_to_pto_amount:"",agrees_to_pto_amount_notes:null,acknowledge_termination_procedure:!1,additional_comments:"",proposed_termination_date:"",risk_assessment_reasons:[],timesheet_file:void 0,...t}}i(G,"buildInitialValues");var Pe=i(({employmentId:t,options:e,initialValues:d})=>{let{fieldValues:c,setFieldValues:C,stepState:o,previousStep:v,nextStep:R}=h(P),{data:u}=F(t),f=G({...o.values?.employee_communication,...o.values?.termination_details,...o.values?.paid_time_off,...o.values?.additional_information,...d}),p=j(()=>({...o.values?.[o.currentStep.name],...f,...c}),[o.values,o.currentStep.name,c,f]),E=j(()=>({fields:{risk_assesment_info:_("Offboarding risk assessment","Employees may be protected from termination if they fall into certain categories. To help avoid claims from employees, let us know if the employee is part of one or more of these categories. Select all that apply.",{className:e?.jsfModify?.fields?.risk_assesment_info?.["x-jsf-presentation"]?.className}),proposed_termination_date_info:_("Proposed termination date",X(Q,{children:["In most cases, we must provide notice to the employee before termination. The required notice period depends on local labor laws, the employment agreement, and other factors. We'll use those factors to determine the required notice period.",b(S,{zendeskId:g.terminationNoticePeriods,className:r("text-sm",e?.jsfModify?.fields?.proposed_termination_date_info?.["x-jsf-presentation"]?.zendeskTriggerButtonClassName),children:"Learn about notice periods"})]}),{className:e?.jsfModify?.fields?.proposed_termination_date_info?.["x-jsf-presentation"]?.className}),paid_time_off_info:{...e?.jsfModify?.fields?.paid_time_off_info,presentation:{...e?.jsfModify?.fields?.paid_time_off_info?.["x-jsf-presentation"],Component:i(()=>b(x,{employeeName:u?.basic_information?.name,proposedTerminationDate:p.proposed_termination_date}),"Component")}}}}),[u?.basic_information?.name,p.proposed_termination_date,e?.jsfModify?.fields?.paid_time_off_info,e?.jsfModify?.fields?.proposed_termination_date_info,e?.jsfModify?.fields?.risk_assesment_info]),{data:s,isLoading:$}=w({formValues:p,jsfModify:{...e?.jsfModify,fields:{...e?.jsfModify?.fields,...E?.fields}},step:o.currentStep.name}),l=K(k.data.schema),y=M(),{mutateAsync:D}=V(y);async function I(a){if(!t)throw new Error("Employment id is missing");if(s){let n=m(a,l.fields,{isPartialValidation:!0}),{customer_informed_employee:z}=n,B=z==="yes"?{employee_awareness:{date:n.customer_informed_employee_date,note:n.customer_informed_employee_description}}:void 0,H=T(n,["agrees_to_pto_amount","confidential","customer_informed_employee","will_challenge_termination"]),L=W(H,"customer_informed_employee_date","customer_informed_employee_description"),A=Z({...L,...B},U);return D({employment_id:t,termination_details:A,type:"termination"})}}i(I,"onSubmit");function J(){v()}i(J,"back");function O(){R()}return i(O,"next"),{employmentId:t,stepState:o,fields:s?.fields||[],isLoading:$,isSubmitting:y.isPending,initialValues:f,handleValidation:i(a=>{if(s){let n=m(a,s?.fields);return s?.handleValidation(n)}return null},"handleValidation"),checkFieldUpdates:i(a=>{if(l){let n=m(a,l?.fields,{isPartialValidation:!0});C(n)}},"checkFieldUpdates"),parseFormValues:i(a=>m(a,l.fields,{isPartialValidation:!0}),"parseFormValues"),onSubmit:I,back:J,next:O}},"useTermination");export{Pe as a};
2
- //# sourceMappingURL=chunk-CGUTMSAU.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/flows/Termination/hooks.tsx","../src/components/form/jsf-utils/createFields.tsx"],"sourcesContent":["import {\n CreateOffboardingParams,\n TerminationDetailsParams,\n} from '@/src/client';\nimport { mutationToPromise } from '@/src/lib/mutations';\nimport { $TSFixMe, createHeadlessForm } from '@remoteoss/json-schema-form';\nimport omitBy from 'lodash.omitby';\nimport isNull from 'lodash.isnull';\nimport { parseJSFToValidate } from '@/src/components/form/utils';\nimport {\n TerminationFlowProps,\n TerminationFormValues,\n} from '@/src/flows/Termination/types';\nimport omit from 'lodash.omit';\nimport { parseFormRadioValues } from '@/src/flows/utils';\nimport { useStepState } from '@/src/flows/useStepState';\nimport { STEPS } from '@/src/flows/Termination/utils';\nimport { jsonSchema } from '@/src/flows/Termination/json-schemas/jsonSchema';\nimport { useCreateTermination, useTerminationSchema } from '@/src/flows/api';\nimport { useMemo } from 'react';\nimport { createInformationField } from '@/src/components/form/jsf-utils/createFields';\nimport { cn, ZendeskTriggerButton } from '@/src/internals';\nimport { zendeskArticles } from '@/src/components/shared/zendesk-drawer/utils';\nimport { PaidTimeOff } from '@/src/flows/Termination/components/PaidTimeOff/PaidTimeOff';\nimport { useEmployment } from '@/src/flows/Onboarding/api';\n\nfunction buildInitialValues(\n stepsInitialValues: Partial<TerminationFormValues>,\n): TerminationFormValues {\n const initialValues: TerminationFormValues = {\n confidential: '',\n customer_informed_employee: '',\n customer_informed_employee_date: '',\n customer_informed_employee_description: '',\n personal_email: '',\n termination_reason: undefined,\n reason_description: '',\n termination_reason_files: [],\n will_challenge_termination: '',\n will_challenge_termination_description: null,\n agrees_to_pto_amount: '',\n agrees_to_pto_amount_notes: null,\n acknowledge_termination_procedure: false,\n additional_comments: '',\n proposed_termination_date: '',\n risk_assessment_reasons: [],\n timesheet_file: undefined,\n ...stepsInitialValues,\n };\n\n return initialValues;\n}\n\ntype TerminationHookProps = Omit<TerminationFlowProps, 'render'>;\n\nexport const useTermination = ({\n employmentId,\n options,\n initialValues: terminationInitialValues,\n}: TerminationHookProps) => {\n const { fieldValues, setFieldValues, stepState, previousStep, nextStep } =\n useStepState<keyof typeof STEPS, TerminationFormValues>(STEPS);\n\n const { data: employment } = useEmployment(employmentId);\n\n const initialValues = buildInitialValues({\n ...stepState.values?.employee_communication,\n ...stepState.values?.termination_details,\n ...stepState.values?.paid_time_off,\n ...stepState.values?.additional_information,\n ...terminationInitialValues,\n });\n\n const formValues = useMemo(\n () => ({\n ...stepState.values?.[stepState.currentStep.name as keyof typeof STEPS], // Restore values for the current step\n ...initialValues,\n ...fieldValues,\n }),\n [stepState.values, stepState.currentStep.name, fieldValues, initialValues],\n );\n\n const customFields = useMemo(() => {\n return {\n fields: {\n risk_assesment_info: createInformationField(\n 'Offboarding risk assessment',\n 'Employees may be protected from termination if they fall into certain categories. To help avoid claims from employees, let us know if the employee is part of one or more of these categories. Select all that apply.',\n {\n className: (\n options?.jsfModify?.fields?.risk_assesment_info as $TSFixMe\n )?.['x-jsf-presentation']?.className,\n },\n ),\n proposed_termination_date_info: createInformationField(\n 'Proposed termination date',\n <>\n In most cases, we must provide notice to the employee before\n termination. The required notice period depends on local labor laws,\n the employment agreement, and other factors. We'll use those factors\n to determine the required notice period.\n <ZendeskTriggerButton\n zendeskId={zendeskArticles.terminationNoticePeriods}\n className={cn(\n 'text-sm',\n (\n options?.jsfModify?.fields\n ?.proposed_termination_date_info as $TSFixMe\n )?.['x-jsf-presentation']?.zendeskTriggerButtonClassName,\n )}\n >\n Learn about notice periods\n </ZendeskTriggerButton>\n </>,\n {\n className: (\n options?.jsfModify?.fields\n ?.proposed_termination_date_info as $TSFixMe\n )?.['x-jsf-presentation']?.className,\n },\n ),\n paid_time_off_info: {\n ...(options?.jsfModify?.fields?.paid_time_off_info as $TSFixMe),\n presentation: {\n ...(options?.jsfModify?.fields?.paid_time_off_info as $TSFixMe)?.[\n 'x-jsf-presentation'\n ],\n Component: () => {\n return (\n <PaidTimeOff\n employeeName={employment?.basic_information?.name as string}\n proposedTerminationDate={formValues.proposed_termination_date}\n />\n );\n },\n },\n },\n },\n };\n }, [\n employment?.basic_information?.name,\n formValues.proposed_termination_date,\n options?.jsfModify?.fields?.paid_time_off_info,\n options?.jsfModify?.fields?.proposed_termination_date_info,\n options?.jsfModify?.fields?.risk_assesment_info,\n ]);\n\n const { data: terminationHeadlessForm, isLoading: isLoadingTermination } =\n useTerminationSchema({\n formValues: formValues,\n jsfModify: {\n ...options?.jsfModify,\n fields: {\n ...options?.jsfModify?.fields,\n ...customFields?.fields,\n },\n },\n step: stepState.currentStep.name,\n });\n\n const entireTerminationSchema = createHeadlessForm(jsonSchema.data.schema);\n\n const createTermination = useCreateTermination();\n const { mutateAsync } = mutationToPromise(createTermination);\n\n async function onSubmit(values: TerminationFormValues) {\n if (!employmentId) {\n throw new Error('Employment id is missing');\n }\n\n if (terminationHeadlessForm) {\n // this is a hack because I need to validate all form values with the entire schema\n const parsedValues = parseJSFToValidate(\n values,\n entireTerminationSchema.fields,\n { isPartialValidation: true },\n );\n\n const { customer_informed_employee: customerInformedEmployee } =\n parsedValues;\n\n const employeeAwareness =\n customerInformedEmployee === 'yes'\n ? {\n employee_awareness: {\n date: parsedValues.customer_informed_employee_date,\n note: parsedValues.customer_informed_employee_description,\n },\n }\n : undefined;\n\n const radioFieldKeys = [\n 'agrees_to_pto_amount',\n 'confidential',\n 'customer_informed_employee',\n 'will_challenge_termination',\n ];\n\n const parsedRadioValues = parseFormRadioValues(\n parsedValues,\n radioFieldKeys,\n );\n\n const normalizedValues = omit(\n parsedRadioValues,\n 'customer_informed_employee_date',\n 'customer_informed_employee_description',\n );\n\n const terminationDetails: TerminationDetailsParams = omitBy(\n {\n ...normalizedValues,\n ...employeeAwareness,\n },\n isNull,\n ) as unknown as TerminationDetailsParams;\n\n const terminationPayload: CreateOffboardingParams = {\n employment_id: employmentId,\n termination_details: terminationDetails,\n type: 'termination',\n };\n\n return mutateAsync(terminationPayload);\n }\n\n return;\n }\n\n function back() {\n previousStep();\n }\n\n function next() {\n nextStep();\n }\n\n return {\n /**\n * Employment id passed useful to be used between components\n */\n employmentId,\n /**\n * Current step state containing the current step and total number of steps\n */\n stepState,\n /**\n * Array of form fields from the contract amendment schema\n */\n fields: terminationHeadlessForm?.fields || [],\n /**\n * Loading state indicating if the termination schema is being fetched\n */\n isLoading: isLoadingTermination,\n /**\n * Loading state indicating if a contract amendment mutation is in progress\n */\n isSubmitting: createTermination.isPending,\n /**\n * Initial form values\n */\n initialValues: initialValues,\n /**\n * Function to validate form values against the contract amendment schema\n * @param values - Form values to validate\n * @returns Validation result or null if no schema is available\n */\n handleValidation: (values: TerminationFormValues) => {\n if (terminationHeadlessForm) {\n const parsedValues = parseJSFToValidate(\n values,\n terminationHeadlessForm?.fields,\n );\n return terminationHeadlessForm?.handleValidation(parsedValues);\n }\n return null;\n },\n /**\n * Function to update the current form field values\n * @param values - New form values to set\n */\n checkFieldUpdates: (values: Partial<TerminationFormValues>) => {\n if (entireTerminationSchema) {\n const parsedValues = parseJSFToValidate(\n values,\n entireTerminationSchema?.fields,\n { isPartialValidation: true },\n );\n setFieldValues(parsedValues as TerminationFormValues);\n }\n },\n /**\n * Function to parse form values before submission\n * @param values - Form values to parse\n * @returns Parsed form values\n */\n parseFormValues: (values: TerminationFormValues) => {\n return parseJSFToValidate(values, entireTerminationSchema.fields, {\n isPartialValidation: true,\n });\n },\n /**\n * Function to handle form submission\n * @param values - Form values to submit\n * @returns Promise resolving to the mutation result\n */\n onSubmit,\n\n /**\n * Function to handle going back to the previous step\n * @returns {void}\n */\n back,\n\n /**\n * Function to handle going to the next step\n * @returns {void}\n */\n next,\n };\n};\n","import { cn } from '@/src/lib/utils';\nimport { $TSFixMe } from '@/src/types/remoteFlows';\n\ntype JSFPresentationConfig = {\n inputType?: string;\n Component?: React.ComponentType<$TSFixMe>;\n hidden?: boolean;\n [key: string]: unknown;\n};\n\ntype JSFFieldConfig = {\n 'x-jsf-presentation'?: JSFPresentationConfig;\n [key: string]: unknown;\n};\n\n/**\n * Creates an information field with standard styling\n */\nexport function createInformationField(\n title: React.ReactNode,\n description: React.ReactNode,\n options?: {\n className?: string;\n },\n): JSFFieldConfig {\n return {\n presentation: {\n inputType: 'hidden',\n Component: () => (\n <div\n className={cn(\n 'RemoteFlows__InformationStatement',\n options?.className,\n )}\n >\n <h3 className={cn('RemoteFlows__InformationStatement__Title')}>\n {title}\n </h3>\n <p className={cn('RemoteFlows__InformationStatement__Description')}>\n {description}\n </p>\n </div>\n ),\n },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EAACkC,GACTE,EAAmBF,EAAQR,EAAwB,OAAQ,CAChE,oBAAqB,EACvB,CAAC,EAHc,mBAUjB,SAAAO,EAMA,KAAAa,EAMA,KAAAC,CACF,CACF,EAzQ8B","names":["createHeadlessForm","omitBy","isNull","omit","useMemo","jsx","jsxs","createInformationField","title","description","options","__name","cn","Fragment","jsx","jsxs","buildInitialValues","stepsInitialValues","__name","useTermination","employmentId","options","terminationInitialValues","fieldValues","setFieldValues","stepState","previousStep","nextStep","useStepState","STEPS","employment","useEmployment","initialValues","formValues","useMemo","customFields","createInformationField","ZendeskTriggerButton","zendeskArticles","cn","PaidTimeOff","terminationHeadlessForm","isLoadingTermination","useTerminationSchema","entireTerminationSchema","createHeadlessForm","jsonSchema","createTermination","useCreateTermination","mutateAsync","mutationToPromise","onSubmit","values","parsedValues","parseJSFToValidate","customerInformedEmployee","employeeAwareness","parsedRadioValues","parseFormRadioValues","normalizedValues","omit","terminationDetails","omitBy","isNull","back","next"]}
@@ -1,2 +0,0 @@
1
- import{b as M}from"./chunk-MRYRNB7Y.js";import{c as v,d as L}from"./chunk-HYIC33YR.js";import{a as D,b as H,d as x,e as h,f as g}from"./chunk-TWIUL2P3.js";import{b as S}from"./chunk-WVDTHFGS.js";import{a as l}from"./chunk-43WMZDDH.js";import{a as T}from"./chunk-P37U34EQ.js";import*as n from"react";import{jsx as m}from"react/jsx-runtime";var w=n.forwardRef(({className:a,...o},t)=>m("div",{className:"relative w-full overflow-auto",children:m("table",{ref:t,className:l("w-full caption-bottom text-sm",a),...o})}));w.displayName="Table";var R=n.forwardRef(({className:a,...o},t)=>m("thead",{ref:t,className:l("[&_tr]:border-b",a),...o}));R.displayName="TableHeader";var N=n.forwardRef(({className:a,...o},t)=>m("tbody",{ref:t,className:l("[&_tr:last-child]:border-0",a),...o}));N.displayName="TableBody";var C=n.forwardRef(({className:a,...o},t)=>m("tfoot",{ref:t,className:l("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",a),...o}));C.displayName="TableFooter";var u=n.forwardRef(({className:a,...o},t)=>m("tr",{ref:t,className:l("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",a),...o}));u.displayName="TableRow";var f=n.forwardRef(({className:a,...o},t)=>m("th",{ref:t,className:l("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",a),...o}));f.displayName="TableHead";var p=n.forwardRef(({className:a,...o},t)=>m("td",{ref:t,className:l("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",a),...o}));p.displayName="TableCell";var k=n.forwardRef(({className:a,...o},t)=>m("caption",{ref:t,className:l("mt-4 text-sm text-muted-foreground",a),...o}));k.displayName="TableCaption";import{useState as B}from"react";import{jsx as e,jsxs as r}from"react/jsx-runtime";var d=T(a=>`${a} ${a===1?"day":"days"}`,"pluralizeDays"),A="RemoteFlows__SummaryRow flex justify-between items-center py-2 text-xs",_="RemoteFlows__SummaryRowBorder border-b border-b-1 border-b-[#E4E4E7]",b=T(({children:a,withBorder:o=!1,className:t=""})=>e("div",{className:l(A,o&&_,t),children:a}),"SummaryRow"),F=T(({entitledDays:a,takenDays:o,bookedDays:t,approvedDaysBeforeTermination:s,approvedDaysAfterTermination:c,remainingDays:i,proposedTerminationDate:E})=>{let y=new Date(E).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"});return r("div",{children:[r(b,{withBorder:!0,children:[e("label",{children:"Number of days entitled to per year"}),e("p",{className:"font-bold",children:d(a)})]}),r(b,{children:[e("label",{children:"Total days booked"}),e("p",{className:"font-bold",children:d(t)})]}),r(b,{children:[e("label",{children:"Number of days already used"}),e("p",{className:"font-bold",children:d(o)})]}),r(b,{children:[r("label",{children:["Approved for use before ",y]}),e("p",{className:"font-bold",children:d(s)})]}),r(b,{withBorder:!0,children:[r("label",{children:["Approved for use after ",y]}),e("p",{className:"font-bold",children:d(c)})]}),r(b,{children:[e("label",{children:"Total days remaining unused"}),e("p",{className:"font-bold",children:d(i)})]}),e(b,{className:"mb-2 py-0",children:r("p",{className:"text-xs text-[#222E39]",children:["Expiration date of unused days: ",y]})})]})},"SummaryTimeOff"),O=T(({employeeName:a,employmentId:o})=>{let[t,s]=B(!1),{data:c}=v({employmentId:o,options:{enabled:t}});return r(D,{direction:"right",open:t,onOpenChange:s,children:[e(H,{asChild:!0,children:e(S,{onClick:()=>{s(!0)},variant:"link",className:"text-xs text-[#3B82F6] font-bold p-0",children:"See detailed time off breakdown \u2197"})}),e(x,{className:"h-full w-[540px] mt-0 ml-auto px-4 RemoteFlows_DrawerTimeOff",children:r("div",{className:"h-full flex flex-col",children:[e(h,{children:r(g,{children:[a," paid time off breakdown"]})}),e("div",{className:"mb-2",children:r(w,{children:[e(R,{children:r(u,{children:[e(f,{className:"w-[250px]",children:"Dates"}),e(f,{children:"Duration"}),e(f,{children:"Status"})]})}),e(N,{children:c?.timeoffs.map(i=>r(u,{children:[e(p,{className:"font-medium w-[250px]",children:i.formattedDate}),e(p,{children:d(i.duration)}),e(p,{children:i.status})]},`${i.startDate}-${i.endDate}`))})]})}),r("p",{className:"text-xs",children:["Total of ",d(c?.bookedDays||0)," booked"]})]})})]})},"DrawerTimeOff"),K=T(({employeeName:a,proposedTerminationDate:o})=>{let{terminationBag:t}=M(),{data:s}=L({employmentId:t.employmentId}),c=new Date(o).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"});return r("div",{className:"py-3",children:[e("h3",{className:"RemoteFlows__PaidTimeOffTitle mb-2",children:"Paid time off"}),r("p",{className:"RemoteFlows__PaidTimeOffDescription text-sm mb-2",children:["The proposed termination date for ",a," is"," ",c,". You will need to pay them for any unused accrued days. Below is a breakdown of their time off entitlement and usage for the current annual leave period:"]}),r("div",{className:"mb-2",children:[s&&e(F,{entitledDays:(s?.data?.[0].annual_entitlement).days||0,takenDays:s?.data?.[0].taken.days||0,bookedDays:0,approvedDaysBeforeTermination:0,approvedDaysAfterTermination:0,remainingDays:0,proposedTerminationDate:o}),e(O,{employeeName:a,employmentId:t.employmentId})]})]})},"PaidTimeOff");export{K as a};
2
- //# sourceMappingURL=chunk-G34OX26W.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/ui/table.tsx","../src/flows/Termination/components/PaidTimeOff/PaidTimeOff.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '@/src/lib/utils';\n\nconst Table = React.forwardRef<\n HTMLTableElement,\n React.HTMLAttributes<HTMLTableElement>\n>(({ className, ...props }, ref) => (\n <div className='relative w-full overflow-auto'>\n <table\n ref={ref}\n className={cn('w-full caption-bottom text-sm', className)}\n {...props}\n />\n </div>\n));\nTable.displayName = 'Table';\n\nconst TableHeader = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <thead ref={ref} className={cn('[&_tr]:border-b', className)} {...props} />\n));\nTableHeader.displayName = 'TableHeader';\n\nconst TableBody = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <tbody\n ref={ref}\n className={cn('[&_tr:last-child]:border-0', className)}\n {...props}\n />\n));\nTableBody.displayName = 'TableBody';\n\nconst TableFooter = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <tfoot\n ref={ref}\n className={cn(\n 'border-t bg-muted/50 font-medium [&>tr]:last:border-b-0',\n className,\n )}\n {...props}\n />\n));\nTableFooter.displayName = 'TableFooter';\n\nconst TableRow = React.forwardRef<\n HTMLTableRowElement,\n React.HTMLAttributes<HTMLTableRowElement>\n>(({ className, ...props }, ref) => (\n <tr\n ref={ref}\n className={cn(\n 'border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted',\n className,\n )}\n {...props}\n />\n));\nTableRow.displayName = 'TableRow';\n\nconst TableHead = React.forwardRef<\n HTMLTableCellElement,\n React.ThHTMLAttributes<HTMLTableCellElement>\n>(({ className, ...props }, ref) => (\n <th\n ref={ref}\n className={cn(\n 'h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]',\n className,\n )}\n {...props}\n />\n));\nTableHead.displayName = 'TableHead';\n\nconst TableCell = React.forwardRef<\n HTMLTableCellElement,\n React.TdHTMLAttributes<HTMLTableCellElement>\n>(({ className, ...props }, ref) => (\n <td\n ref={ref}\n className={cn(\n 'p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]',\n className,\n )}\n {...props}\n />\n));\nTableCell.displayName = 'TableCell';\n\nconst TableCaption = React.forwardRef<\n HTMLTableCaptionElement,\n React.HTMLAttributes<HTMLTableCaptionElement>\n>(({ className, ...props }, ref) => (\n <caption\n ref={ref}\n className={cn('mt-4 text-sm text-muted-foreground', className)}\n {...props}\n />\n));\nTableCaption.displayName = 'TableCaption';\n\nexport {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableHead,\n TableRow,\n TableCell,\n TableCaption,\n};\n","import {\n usePaidTimeoffBreakdownQuery,\n useTimeOffLeavePoliciesSummaryQuery,\n} from '@/src/common/api';\nimport { Button } from '@/src/components/ui/button';\nimport { useTerminationContext } from '@/src/flows/Termination/context';\nimport { cn } from '@/src/lib/utils';\nimport { $TSFixMe } from '@/src/types/remoteFlows';\nimport {\n Drawer,\n DrawerTrigger,\n DrawerContent,\n DrawerHeader,\n DrawerTitle,\n} from '@/src/components/ui/drawer';\nimport {\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableHeader,\n TableRow,\n} from '@/src/components/ui/table';\nimport { useState } from 'react';\n\nconst pluralizeDays = (count: number) =>\n `${count} ${count === 1 ? 'day' : 'days'}`;\n\nconst rowBase =\n 'RemoteFlows__SummaryRow flex justify-between items-center py-2 text-xs';\nconst rowBorder =\n 'RemoteFlows__SummaryRowBorder border-b border-b-1 border-b-[#E4E4E7]';\n\nconst SummaryRow = ({\n children,\n withBorder = false,\n className = '',\n}: {\n children: React.ReactNode;\n withBorder?: boolean;\n className?: string;\n}) => {\n return (\n <div className={cn(rowBase, withBorder && rowBorder, className)}>\n {children}\n </div>\n );\n};\n\nconst SummaryTimeOff = ({\n entitledDays,\n takenDays,\n bookedDays,\n approvedDaysBeforeTermination,\n approvedDaysAfterTermination,\n remainingDays,\n proposedTerminationDate,\n}: {\n entitledDays: number;\n takenDays: number;\n bookedDays: number;\n approvedDaysBeforeTermination: number;\n approvedDaysAfterTermination: number;\n remainingDays: number;\n proposedTerminationDate: string;\n}) => {\n const formattedProposedTerminationDate = new Date(\n proposedTerminationDate,\n ).toLocaleDateString('en-US', {\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n });\n return (\n <div>\n <SummaryRow withBorder>\n <label>Number of days entitled to per year</label>\n <p className='font-bold'>{pluralizeDays(entitledDays)}</p>\n </SummaryRow>\n <SummaryRow>\n <label>Total days booked</label>\n <p className='font-bold'>{pluralizeDays(bookedDays)}</p>\n </SummaryRow>\n <SummaryRow>\n <label>Number of days already used</label>\n <p className='font-bold'>{pluralizeDays(takenDays)}</p>\n </SummaryRow>\n <SummaryRow>\n <label>\n Approved for use before {formattedProposedTerminationDate}\n </label>\n <p className='font-bold'>\n {pluralizeDays(approvedDaysBeforeTermination)}\n </p>\n </SummaryRow>\n <SummaryRow withBorder>\n <label>Approved for use after {formattedProposedTerminationDate}</label>\n <p className='font-bold'>\n {pluralizeDays(approvedDaysAfterTermination)}\n </p>\n </SummaryRow>\n <SummaryRow>\n <label>Total days remaining unused</label>\n <p className='font-bold'>{pluralizeDays(remainingDays)}</p>\n </SummaryRow>\n <SummaryRow className='mb-2 py-0'>\n <p className='text-xs text-[#222E39]'>\n Expiration date of unused days: {formattedProposedTerminationDate}\n </p>\n </SummaryRow>\n </div>\n );\n};\n\nconst DrawerTimeOff = ({\n employeeName,\n employmentId,\n}: {\n employeeName: string;\n employmentId: string;\n}) => {\n const [open, setOpen] = useState(false);\n const { data: timeoff } = usePaidTimeoffBreakdownQuery({\n employmentId,\n options: {\n enabled: open,\n },\n });\n\n return (\n <Drawer direction='right' open={open} onOpenChange={setOpen}>\n <DrawerTrigger asChild>\n <Button\n onClick={() => {\n setOpen(true);\n }}\n variant='link'\n className='text-xs text-[#3B82F6] font-bold p-0'\n >\n See detailed time off breakdown ↗\n </Button>\n </DrawerTrigger>\n <DrawerContent className='h-full w-[540px] mt-0 ml-auto px-4 RemoteFlows_DrawerTimeOff'>\n <div className='h-full flex flex-col'>\n <DrawerHeader>\n <DrawerTitle>{employeeName} paid time off breakdown</DrawerTitle>\n </DrawerHeader>\n <div className='mb-2'>\n <Table>\n <TableHeader>\n <TableRow>\n <TableHead className='w-[250px]'>Dates</TableHead>\n <TableHead>Duration</TableHead>\n <TableHead>Status</TableHead>\n </TableRow>\n </TableHeader>\n <TableBody>\n {timeoff?.timeoffs.map((timeoff) => (\n <TableRow key={`${timeoff.startDate}-${timeoff.endDate}`}>\n <TableCell className='font-medium w-[250px]'>\n {timeoff.formattedDate}\n </TableCell>\n <TableCell>{pluralizeDays(timeoff.duration)}</TableCell>\n <TableCell>{timeoff.status}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </div>\n <p className='text-xs'>\n Total of {pluralizeDays(timeoff?.bookedDays || 0)} booked\n </p>\n </div>\n </DrawerContent>\n </Drawer>\n );\n};\n\nexport const PaidTimeOff = ({\n employeeName,\n proposedTerminationDate,\n}: {\n employeeName: string;\n proposedTerminationDate: string;\n}) => {\n const { terminationBag } = useTerminationContext();\n\n const { data: leavePoliciesSummary } = useTimeOffLeavePoliciesSummaryQuery({\n employmentId: terminationBag.employmentId,\n });\n\n const formattedProposedTerminationDate = new Date(\n proposedTerminationDate,\n ).toLocaleDateString('en-US', {\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n });\n return (\n <div className='py-3'>\n <h3 className='RemoteFlows__PaidTimeOffTitle mb-2'>Paid time off</h3>\n <p className='RemoteFlows__PaidTimeOffDescription text-sm mb-2'>\n The proposed termination date for {employeeName} is{' '}\n {formattedProposedTerminationDate}. You will need to pay them for any\n unused accrued days. Below is a breakdown of their time off entitlement\n and usage for the current annual leave period:\n </p>\n <div className='mb-2'>\n {leavePoliciesSummary && (\n <SummaryTimeOff\n entitledDays={\n (leavePoliciesSummary?.data?.[0].annual_entitlement as $TSFixMe)\n .days || 0\n }\n takenDays={leavePoliciesSummary?.data?.[0].taken.days || 0}\n bookedDays={0}\n approvedDaysBeforeTermination={0}\n approvedDaysAfterTermination={0}\n remainingDays={0}\n proposedTerminationDate={proposedTerminationDate}\n />\n )}\n <DrawerTimeOff\n employeeName={employeeName}\n employmentId={terminationBag.employmentId}\n />\n </div>\n </div>\n );\n};\n"],"mappings":"mRAAA,UAAYA,MAAW,QASnB,cAAAC,MAAA,oBALJ,IAAMC,EAAc,aAGlB,CAAC,CAAE,UAAAC,EAAW,GAAGC,CAAM,EAAGC,IAC1BJ,EAAC,OAAI,UAAU,gCACb,SAAAA,EAAC,SACC,IAAKI,EACL,UAAWC,EAAG,gCAAiCH,CAAS,EACvD,GAAGC,EACN,EACF,CACD,EACDF,EAAM,YAAc,QAEpB,IAAMK,EAAoB,aAGxB,CAAC,CAAE,UAAAJ,EAAW,GAAGC,CAAM,EAAGC,IAC1BJ,EAAC,SAAM,IAAKI,EAAK,UAAWC,EAAG,kBAAmBH,CAAS,EAAI,GAAGC,EAAO,CAC1E,EACDG,EAAY,YAAc,cAE1B,IAAMC,EAAkB,aAGtB,CAAC,CAAE,UAAAL,EAAW,GAAGC,CAAM,EAAGC,IAC1BJ,EAAC,SACC,IAAKI,EACL,UAAWC,EAAG,6BAA8BH,CAAS,EACpD,GAAGC,EACN,CACD,EACDI,EAAU,YAAc,YAExB,IAAMC,EAAoB,aAGxB,CAAC,CAAE,UAAAN,EAAW,GAAGC,CAAM,EAAGC,IAC1BJ,EAAC,SACC,IAAKI,EACL,UAAWC,EACT,0DACAH,CACF,EACC,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,KAAM,SACR,CAAC,EACD,OACElB,EAAC,OAAI,UAAU,OACb,UAAAD,EAAC,MAAG,UAAU,qCAAqC,yBAAa,EAChEC,EAAC,KAAE,UAAU,mDAAmD,+CAC3BqB,EAAa,MAAI,IACnDF,EAAiC,8JAGpC,EACAnB,EAAC,OAAI,UAAU,OACZ,UAAA2C,GACC5C,EAACY,EAAA,CACC,cACGgC,GAAsB,OAAO,CAAC,EAAE,oBAC9B,MAAQ,EAEb,UAAWA,GAAsB,OAAO,CAAC,EAAE,MAAM,MAAQ,EACzD,WAAY,EACZ,8BAA+B,EAC/B,6BAA8B,EAC9B,cAAe,EACf,wBAAyBzB,EAC3B,EAEFnB,EAACqB,EAAA,CACC,aAAcC,EACd,aAAcoB,EAAe,aAC/B,GACF,GACF,CAEJ,EAnD2B","names":["React","jsx","Table","className","props","ref","cn","TableHeader","TableBody","TableFooter","TableRow","TableHead","TableCell","TableCaption","useState","jsx","jsxs","pluralizeDays","__name","count","rowBase","rowBorder","SummaryRow","children","withBorder","className","cn","SummaryTimeOff","entitledDays","takenDays","bookedDays","approvedDaysBeforeTermination","approvedDaysAfterTermination","remainingDays","proposedTerminationDate","formattedProposedTerminationDate","DrawerTimeOff","employeeName","employmentId","open","setOpen","useState","timeoff","usePaidTimeoffBreakdownQuery","Drawer","DrawerTrigger","Button","DrawerContent","DrawerHeader","DrawerTitle","Table","TableHeader","TableRow","TableHead","TableBody","TableCell","PaidTimeOff","terminationBag","useTerminationContext","leavePoliciesSummary","useTimeOffLeavePoliciesSummaryQuery"]}
@@ -1,2 +0,0 @@
1
- import{G as f,s as m,u}from"./chunk-IXAWEBRI.js";import{d as o}from"./chunk-3ZWDIEEM.js";import{a as e}from"./chunk-P37U34EQ.js";import{useQuery as s}from"@tanstack/react-query";var b=e(({employmentId:t})=>{let{client:r}=o();return s({queryKey:["employment",t],retry:!1,queryFn:e(()=>u({client:r,headers:{Authorization:""},path:{employment_id:t}}),"queryFn"),select:e(({data:a})=>a,"select")})},"useEmploymentQuery"),y=e(({employmentId:t,status:r,timeoffType:a,options:n})=>{let{client:l}=o();return s({queryKey:["timeoff",t,r],retry:!1,queryFn:e(()=>f({client:l,headers:{Authorization:""},query:{employment_id:t,status:r,timeoff_type:a}}),"queryFn"),select:e(({data:i})=>n?.select?.(i)??i,"select"),enabled:n?.enabled})},"useTimeOffQuery"),d=e((t,r)=>{let a=new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),n=new Date(r).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"});return`${a} \u2192 ${n}`},"formatDateRange"),_=e(({employmentId:t,options:r})=>y({employmentId:t,timeoffType:"paid_time_off",options:{enabled:r?.enabled,select:e(a=>({bookedDays:a?.data?.total_count||0,timeoffs:a?.data?.timeoffs?.map(n=>({status:n?.status,duration:n?.timeoff_days.length,startDate:n?.start_date,endDate:n?.end_date,formattedDate:d(n?.start_date,n?.end_date)}))||[]}),"select")}}),"usePaidTimeoffBreakdownQuery"),S=e(({employmentId:t})=>{let{client:r}=o();return s({queryKey:["timeoff-balance",t],retry:!1,queryFn:e(()=>m({client:r,headers:{Authorization:""},path:{employment_id:t}}),"queryFn"),select:e(({data:a})=>a,"select")})},"useTimeOffLeavePoliciesSummaryQuery");export{b as a,y as b,_ as c,S as d};
2
- //# sourceMappingURL=chunk-HYIC33YR.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/common/api.ts"],"sourcesContent":["import {\n getIndexLeavePoliciesSummary,\n getIndexTimeoff,\n getShowEmployment,\n ListTimeoffResponse,\n TimeoffStatus,\n TimeoffType,\n} from '@/src/client';\nimport { useClient } from '@/src/context';\nimport { ContractAmendmentParams } from '@/src/flows/ContractAmendment/types';\nimport { Client } from '@hey-api/client-fetch';\nimport { useQuery } from '@tanstack/react-query';\n\ntype UseEmployment = Pick<ContractAmendmentParams, 'employmentId'>;\n\n/**\n * Hook to retrieve employment details for a specific employment ID.\n *\n * @param {Object} params - The parameters for the query.\n * @param {string} params.employmentId - The ID of the employment to fetch details for.\n * @returns {UseQueryResult<any, unknown>} - The result of the query, including the employment details.\n */\nexport const useEmploymentQuery = ({ employmentId }: UseEmployment) => {\n const { client } = useClient();\n return useQuery({\n queryKey: ['employment', employmentId],\n retry: false,\n queryFn: () => {\n return getShowEmployment({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n path: { employment_id: employmentId },\n });\n },\n select: ({ data }) => data,\n });\n};\n\n/**\n * Hook to retrieve time off data for a specific employment.\n *\n * @param {Object} params - The parameters for the query.\n * @param {string} [params.employmentId] - The ID of the employment to fetch time off data for.\n * @param {TimeoffStatus} [params.status] - The status of the time off requests to filter by (e.g., 'approved', 'pending').\n * @returns {UseQueryResult<any, unknown>} - The result of the query, including the time off data.\n *\n */\nexport const useTimeOffQuery = <TData = ListTimeoffResponse>({\n employmentId,\n status,\n timeoffType,\n options,\n}: {\n employmentId?: string;\n status?: TimeoffStatus;\n timeoffType?: TimeoffType;\n options?: {\n enabled?: boolean;\n select?: (data: ListTimeoffResponse | undefined) => TData;\n };\n}) => {\n const { client } = useClient();\n return useQuery({\n queryKey: ['timeoff', employmentId, status],\n retry: false,\n queryFn: () => {\n return getIndexTimeoff({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n query: {\n employment_id: employmentId,\n status: status,\n timeoff_type: timeoffType,\n },\n });\n },\n select: ({ data }) => (options?.select?.(data) ?? data) as TData,\n enabled: options?.enabled,\n });\n};\n\nconst formatDateRange = (startDate: string, endDate: string) => {\n const start = new Date(startDate).toLocaleDateString('en-US', {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n });\n const end = new Date(endDate).toLocaleDateString('en-US', {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n });\n return `${start} → ${end}`;\n};\n\n/**\n * Hook to retrieve paid time off breakdown for a specific employment.\n *\n * @param {Object} params - The parameters for the query.\n * @param {string} [params.employmentId] - The ID of the employment to fetch paid time off breakdown for.\n * @returns {UseQueryResult<any, unknown>} - The result of the query, including the paid time off breakdown.\n *\n */\nexport const usePaidTimeoffBreakdownQuery = ({\n employmentId,\n options,\n}: {\n employmentId?: string;\n options?: {\n enabled?: boolean;\n };\n}) => {\n return useTimeOffQuery<{\n bookedDays: number;\n timeoffs: {\n status: string;\n duration: number;\n startDate: string;\n endDate: string;\n formattedDate: string;\n }[];\n }>({\n employmentId,\n timeoffType: 'paid_time_off',\n options: {\n enabled: options?.enabled,\n select: (data) => {\n return {\n bookedDays: data?.data?.total_count || 0,\n timeoffs:\n data?.data?.timeoffs?.map((timeoff) => {\n return {\n status: timeoff?.status,\n duration: timeoff?.timeoff_days.length,\n startDate: timeoff?.start_date,\n endDate: timeoff?.end_date,\n formattedDate: formatDateRange(\n timeoff?.start_date,\n timeoff?.end_date,\n ),\n };\n }) || [],\n };\n },\n },\n });\n};\n\n/**\n * Hook to retrieve time off balance for a specific employment.\n *\n * @param {Object} params - The parameters for the query.\n * @param {string} [params.employmentId] - The ID of the employment to fetch time off balance for.\n * @returns {UseQueryResult<any, unknown>} - The result of the query, including the time off balance.\n *\n */\nexport const useTimeOffLeavePoliciesSummaryQuery = ({\n employmentId,\n}: {\n employmentId?: string;\n}) => {\n const { client } = useClient();\n return useQuery({\n queryKey: ['timeoff-balance', employmentId],\n retry: false,\n queryFn: () => {\n return getIndexLeavePoliciesSummary({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n path: { employment_id: employmentId as string },\n });\n },\n select: ({ data }) => data,\n });\n};\n"],"mappings":"iIAWA,OAAS,YAAAA,MAAgB,wBAWlB,IAAMC,EAAqBC,EAAA,CAAC,CAAE,aAAAC,CAAa,IAAqB,CACrE,GAAM,CAAE,OAAAC,CAAO,EAAIC,EAAU,EAC7B,OAAOC,EAAS,CACd,SAAU,CAAC,aAAcH,CAAY,EACrC,MAAO,GACP,QAASD,EAAA,IACAK,EAAkB,CACvB,OAAQH,EACR,QAAS,CACP,cAAe,EACjB,EACA,KAAM,CAAE,cAAeD,CAAa,CACtC,CAAC,EAPM,WAST,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AhBM,SAkBV,CACF,CAAC,EA1CyC,gCAqD/BC,EAAsCnB,EAAA,CAAC,CAClD,aAAAC,CACF,IAEM,CACJ,GAAM,CAAE,OAAAC,CAAO,EAAIC,EAAU,EAC7B,OAAOC,EAAS,CACd,SAAU,CAAC,kBAAmBH,CAAY,EAC1C,MAAO,GACP,QAASD,EAAA,IACAoB,EAA6B,CAClC,OAAQlB,EACR,QAAS,CACP,cAAe,EACjB,EACA,KAAM,CAAE,cAAeD,CAAuB,CAChD,CAAC,EAPM,WAST,OAAQD,EAAA,CAAC,CAAE,KAAAM,CAAK,IAAMA,EAAd,SACV,CAAC,CACH,EApBmD","names":["useQuery","useEmploymentQuery","__name","employmentId","client","useClient","useQuery","getShowEmployment","data","useTimeOffQuery","status","timeoffType","options","getIndexTimeoff","formatDateRange","startDate","endDate","start","end","usePaidTimeoffBreakdownQuery","timeoff","useTimeOffLeavePoliciesSummaryQuery","getIndexLeavePoliciesSummary"]}