@solibo/solibo-query 1.10.5 → 1.11.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 (301) hide show
  1. package/dist/api/commands/communication/buySMSBundle.d.ts +1 -1
  2. package/dist/api/commands/communication/buySMSBundle.js +8 -3
  3. package/dist/api/commands/communication/buySMSBundle.js.map +1 -1
  4. package/dist/api/commands/company/saveCompanyDetailed.d.ts +1 -1
  5. package/dist/api/commands/company/saveCompanyDetailed.js +3 -0
  6. package/dist/api/commands/company/saveCompanyDetailed.js.map +1 -1
  7. package/dist/api/commands/company/saveImportDraft.d.ts +1 -1
  8. package/dist/api/commands/company/saveImportDraft.js +3 -0
  9. package/dist/api/commands/company/saveImportDraft.js.map +1 -1
  10. package/dist/api/commands/company/updateCompanyDetailed.d.ts +1 -1
  11. package/dist/api/commands/company/updateCompanyDetailed.js +6 -0
  12. package/dist/api/commands/company/updateCompanyDetailed.js.map +1 -1
  13. package/dist/api/commands/conversation/markConversationRead.d.ts +1 -1
  14. package/dist/api/commands/conversation/markConversationRead.js +15 -0
  15. package/dist/api/commands/conversation/markConversationRead.js.map +1 -1
  16. package/dist/api/commands/document/createDocumentReference.js +27 -0
  17. package/dist/api/commands/document/createDocumentReference.js.map +1 -1
  18. package/dist/api/commands/document/deleteDocument.d.ts +1 -1
  19. package/dist/api/commands/document/deleteDocument.js +26 -3
  20. package/dist/api/commands/document/deleteDocument.js.map +1 -1
  21. package/dist/api/commands/document/integratedDocumentMutations.d.ts +4 -4
  22. package/dist/api/commands/document/integratedDocumentMutations.js +23 -8
  23. package/dist/api/commands/document/integratedDocumentMutations.js.map +1 -1
  24. package/dist/api/commands/document/uploadDocument.js +45 -18
  25. package/dist/api/commands/document/uploadDocument.js.map +1 -1
  26. package/dist/api/commands/expense/approveExpense.d.ts +1 -1
  27. package/dist/api/commands/expense/approveExpense.js +12 -3
  28. package/dist/api/commands/expense/approveExpense.js.map +1 -1
  29. package/dist/api/commands/expense/createExpense.d.ts +1 -1
  30. package/dist/api/commands/expense/createExpense.js +4 -0
  31. package/dist/api/commands/expense/createExpense.js.map +1 -1
  32. package/dist/api/commands/expense/deleteExpense.d.ts +1 -1
  33. package/dist/api/commands/expense/deleteExpense.js +12 -3
  34. package/dist/api/commands/expense/deleteExpense.js.map +1 -1
  35. package/dist/api/commands/expense/rejectExpense.d.ts +1 -1
  36. package/dist/api/commands/expense/rejectExpense.js +12 -3
  37. package/dist/api/commands/expense/rejectExpense.js.map +1 -1
  38. package/dist/api/commands/homepage/createPost.d.ts +1 -1
  39. package/dist/api/commands/homepage/createPost.js +6 -0
  40. package/dist/api/commands/homepage/createPost.js.map +1 -1
  41. package/dist/api/commands/homepage/createPracticalInfo.d.ts +1 -1
  42. package/dist/api/commands/homepage/createPracticalInfo.js +11 -3
  43. package/dist/api/commands/homepage/createPracticalInfo.js.map +1 -1
  44. package/dist/api/commands/homepage/deletePost.d.ts +1 -1
  45. package/dist/api/commands/homepage/deletePost.js +14 -0
  46. package/dist/api/commands/homepage/deletePost.js.map +1 -1
  47. package/dist/api/commands/homepage/deletePracticalInfo.d.ts +1 -1
  48. package/dist/api/commands/homepage/deletePracticalInfo.js +16 -3
  49. package/dist/api/commands/homepage/deletePracticalInfo.js.map +1 -1
  50. package/dist/api/commands/homepage/updateFeedWeighting.d.ts +1 -1
  51. package/dist/api/commands/homepage/updateFeedWeighting.js +20 -3
  52. package/dist/api/commands/homepage/updateFeedWeighting.js.map +1 -1
  53. package/dist/api/commands/homepage/updatePost.d.ts +1 -1
  54. package/dist/api/commands/homepage/updatePost.js +9 -0
  55. package/dist/api/commands/homepage/updatePost.js.map +1 -1
  56. package/dist/api/commands/homepage/updatePracticalInfo.d.ts +1 -1
  57. package/dist/api/commands/homepage/updatePracticalInfo.js +16 -3
  58. package/dist/api/commands/homepage/updatePracticalInfo.js.map +1 -1
  59. package/dist/api/commands/invoicing/directSendInvoice.d.ts +9 -0
  60. package/dist/api/commands/invoicing/directSendInvoice.js +11 -0
  61. package/dist/api/commands/invoicing/directSendInvoice.js.map +1 -0
  62. package/dist/api/commands/issue/changeResponsible.d.ts +2 -2
  63. package/dist/api/commands/issue/changeResponsible.js +2 -0
  64. package/dist/api/commands/issue/changeResponsible.js.map +1 -1
  65. package/dist/api/commands/issue/closeIssue.d.ts +1 -1
  66. package/dist/api/commands/issue/closeIssue.js +1 -0
  67. package/dist/api/commands/issue/closeIssue.js.map +1 -1
  68. package/dist/api/commands/issue/createConversationToIssue.d.ts +1 -1
  69. package/dist/api/commands/issue/createConversationToIssue.js +1 -0
  70. package/dist/api/commands/issue/createConversationToIssue.js.map +1 -1
  71. package/dist/api/commands/issue/createIssue.d.ts +1 -1
  72. package/dist/api/commands/issue/createIssue.js +1 -0
  73. package/dist/api/commands/issue/createIssue.js.map +1 -1
  74. package/dist/api/commands/issue/createIssueToMeeting.d.ts +2 -2
  75. package/dist/api/commands/issue/createIssueToMeeting.js +2 -0
  76. package/dist/api/commands/issue/createIssueToMeeting.js.map +1 -1
  77. package/dist/api/commands/issue/createSectionToIssue.d.ts +1 -1
  78. package/dist/api/commands/issue/createSectionToIssue.js +1 -0
  79. package/dist/api/commands/issue/createSectionToIssue.js.map +1 -1
  80. package/dist/api/commands/issue/deleteSectionFromIssue.d.ts +1 -1
  81. package/dist/api/commands/issue/deleteSectionFromIssue.js +1 -0
  82. package/dist/api/commands/issue/deleteSectionFromIssue.js.map +1 -1
  83. package/dist/api/commands/issue/reOpenIssue.d.ts +1 -1
  84. package/dist/api/commands/issue/reOpenIssue.js +1 -0
  85. package/dist/api/commands/issue/reOpenIssue.js.map +1 -1
  86. package/dist/api/commands/issue/removeConversationFromIssue.d.ts +1 -1
  87. package/dist/api/commands/issue/removeConversationFromIssue.js +1 -0
  88. package/dist/api/commands/issue/removeConversationFromIssue.js.map +1 -1
  89. package/dist/api/commands/issue/removeIssueFromMeeting.d.ts +2 -2
  90. package/dist/api/commands/issue/removeIssueFromMeeting.js +2 -0
  91. package/dist/api/commands/issue/removeIssueFromMeeting.js.map +1 -1
  92. package/dist/api/commands/issue/updateIssue.d.ts +2 -2
  93. package/dist/api/commands/issue/updateIssue.js +2 -0
  94. package/dist/api/commands/issue/updateIssue.js.map +1 -1
  95. package/dist/api/commands/loan/deleteLoan.d.ts +1 -1
  96. package/dist/api/commands/loan/deleteLoan.js +16 -3
  97. package/dist/api/commands/loan/deleteLoan.js.map +1 -1
  98. package/dist/api/commands/loan/setMainDocumentId.d.ts +1 -1
  99. package/dist/api/commands/loan/setMainDocumentId.js +11 -3
  100. package/dist/api/commands/loan/setMainDocumentId.js.map +1 -1
  101. package/dist/api/commands/loan/updateLoan.d.ts +5 -5
  102. package/dist/api/commands/loan/updateLoan.js +55 -11
  103. package/dist/api/commands/loan/updateLoan.js.map +1 -1
  104. package/dist/api/commands/organization/assignParkingSpaceToOrganization.d.ts +1 -1
  105. package/dist/api/commands/organization/assignParkingSpaceToOrganization.js +9 -10
  106. package/dist/api/commands/organization/assignParkingSpaceToOrganization.js.map +1 -1
  107. package/dist/api/commands/organization/assignStorageRoomToOrganization.d.ts +1 -1
  108. package/dist/api/commands/organization/assignStorageRoomToOrganization.js +9 -10
  109. package/dist/api/commands/organization/assignStorageRoomToOrganization.js.map +1 -1
  110. package/dist/api/commands/organization/unAssignParkingSpaceToOrganization.d.ts +1 -1
  111. package/dist/api/commands/organization/unAssignParkingSpaceToOrganization.js +9 -10
  112. package/dist/api/commands/organization/unAssignParkingSpaceToOrganization.js.map +1 -1
  113. package/dist/api/commands/organization/unAssignStorageRoomToOrganization.d.ts +1 -1
  114. package/dist/api/commands/organization/unAssignStorageRoomToOrganization.js +9 -10
  115. package/dist/api/commands/organization/unAssignStorageRoomToOrganization.js.map +1 -1
  116. package/dist/api/commands/parkingSpaces/createParkingSpace.d.ts +1 -1
  117. package/dist/api/commands/parkingSpaces/createParkingSpace.js +4 -3
  118. package/dist/api/commands/parkingSpaces/createParkingSpace.js.map +1 -1
  119. package/dist/api/commands/parkingSpaces/deleteParkingSpace.d.ts +1 -1
  120. package/dist/api/commands/parkingSpaces/deleteParkingSpace.js +5 -14
  121. package/dist/api/commands/parkingSpaces/deleteParkingSpace.js.map +1 -1
  122. package/dist/api/commands/parkingSpaces/updateParkingSpace.d.ts +1 -1
  123. package/dist/api/commands/parkingSpaces/updateParkingSpace.js +4 -3
  124. package/dist/api/commands/parkingSpaces/updateParkingSpace.js.map +1 -1
  125. package/dist/api/commands/person/assignParkingSpaceToPerson.d.ts +1 -1
  126. package/dist/api/commands/person/assignParkingSpaceToPerson.js +9 -10
  127. package/dist/api/commands/person/assignParkingSpaceToPerson.js.map +1 -1
  128. package/dist/api/commands/person/assignStorageRoomToPerson.d.ts +1 -1
  129. package/dist/api/commands/person/assignStorageRoomToPerson.js +9 -10
  130. package/dist/api/commands/person/assignStorageRoomToPerson.js.map +1 -1
  131. package/dist/api/commands/person/unAssignParkingSpaceToPerson.d.ts +1 -1
  132. package/dist/api/commands/person/unAssignParkingSpaceToPerson.js +9 -10
  133. package/dist/api/commands/person/unAssignParkingSpaceToPerson.js.map +1 -1
  134. package/dist/api/commands/person/unAssignStorageRoomToPerson.d.ts +1 -1
  135. package/dist/api/commands/person/unAssignStorageRoomToPerson.js +9 -10
  136. package/dist/api/commands/person/unAssignStorageRoomToPerson.js.map +1 -1
  137. package/dist/api/commands/resident/createOccupancyRecord.d.ts +1 -1
  138. package/dist/api/commands/resident/createOccupancyRecord.js +7 -15
  139. package/dist/api/commands/resident/createOccupancyRecord.js.map +1 -1
  140. package/dist/api/commands/resident/createResident.d.ts +6 -1
  141. package/dist/api/commands/resident/createResident.js +11 -0
  142. package/dist/api/commands/resident/createResident.js.map +1 -1
  143. package/dist/api/commands/resident/deleteOccupancyRecord.d.ts +1 -1
  144. package/dist/api/commands/resident/deleteOccupancyRecord.js +7 -15
  145. package/dist/api/commands/resident/deleteOccupancyRecord.js.map +1 -1
  146. package/dist/api/commands/resident/residentActions.d.ts +18 -2
  147. package/dist/api/commands/resident/residentActions.js +17 -3
  148. package/dist/api/commands/resident/residentActions.js.map +1 -1
  149. package/dist/api/commands/resident/typedResidentMutations.d.ts +36 -0
  150. package/dist/api/commands/resident/typedResidentMutations.js +63 -0
  151. package/dist/api/commands/resident/typedResidentMutations.js.map +1 -0
  152. package/dist/api/commands/resident/updateOccupancyRecord.d.ts +1 -1
  153. package/dist/api/commands/resident/updateOccupancyRecord.js +7 -15
  154. package/dist/api/commands/resident/updateOccupancyRecord.js.map +1 -1
  155. package/dist/api/commands/resident/updateOrganizationReservations.js +8 -4
  156. package/dist/api/commands/resident/updateOrganizationReservations.js.map +1 -1
  157. package/dist/api/commands/resident/updateResident.d.ts +6 -1
  158. package/dist/api/commands/resident/updateResident.js +11 -0
  159. package/dist/api/commands/resident/updateResident.js.map +1 -1
  160. package/dist/api/commands/residentCommunication/residentCommunicationMutations.js +9 -0
  161. package/dist/api/commands/residentCommunication/residentCommunicationMutations.js.map +1 -1
  162. package/dist/api/commands/residentsAndSections/cacheInvalidation.d.ts +20 -0
  163. package/dist/api/commands/residentsAndSections/cacheInvalidation.js +68 -0
  164. package/dist/api/commands/residentsAndSections/cacheInvalidation.js.map +1 -0
  165. package/dist/api/commands/residentsAndSections/companyScope.d.ts +2 -0
  166. package/dist/api/commands/residentsAndSections/companyScope.js +7 -0
  167. package/dist/api/commands/residentsAndSections/companyScope.js.map +1 -0
  168. package/dist/api/commands/section/assignParkingSpaceToSection.d.ts +1 -1
  169. package/dist/api/commands/section/assignParkingSpaceToSection.js +6 -10
  170. package/dist/api/commands/section/assignParkingSpaceToSection.js.map +1 -1
  171. package/dist/api/commands/section/assignStorageRoomToSection.d.ts +1 -1
  172. package/dist/api/commands/section/assignStorageRoomToSection.js +6 -10
  173. package/dist/api/commands/section/assignStorageRoomToSection.js.map +1 -1
  174. package/dist/api/commands/section/createSection.d.ts +2 -2
  175. package/dist/api/commands/section/createSection.js +13 -5
  176. package/dist/api/commands/section/createSection.js.map +1 -1
  177. package/dist/api/commands/section/createSubSection.d.ts +2 -2
  178. package/dist/api/commands/section/createSubSection.js +14 -5
  179. package/dist/api/commands/section/createSubSection.js.map +1 -1
  180. package/dist/api/commands/section/deleteSection.d.ts +1 -1
  181. package/dist/api/commands/section/deleteSection.js +7 -0
  182. package/dist/api/commands/section/deleteSection.js.map +1 -1
  183. package/dist/api/commands/section/massUpdateSection.d.ts +1 -1
  184. package/dist/api/commands/section/massUpdateSection.js +16 -4
  185. package/dist/api/commands/section/massUpdateSection.js.map +1 -1
  186. package/dist/api/commands/section/ownershipChangeMutations.d.ts +12 -0
  187. package/dist/api/commands/section/ownershipChangeMutations.js +46 -0
  188. package/dist/api/commands/section/ownershipChangeMutations.js.map +1 -0
  189. package/dist/api/commands/section/ownershipTransferSection.d.ts +1 -1
  190. package/dist/api/commands/section/ownershipTransferSection.js +5 -0
  191. package/dist/api/commands/section/ownershipTransferSection.js.map +1 -1
  192. package/dist/api/commands/section/sectionMappers.d.ts +4 -0
  193. package/dist/api/commands/section/sectionMappers.js +68 -0
  194. package/dist/api/commands/section/sectionMappers.js.map +1 -0
  195. package/dist/api/commands/section/sectionStructureMutations.d.ts +12 -0
  196. package/dist/api/commands/section/sectionStructureMutations.js +46 -0
  197. package/dist/api/commands/section/sectionStructureMutations.js.map +1 -0
  198. package/dist/api/commands/section/tagOnSection.d.ts +2 -2
  199. package/dist/api/commands/section/tagOnSection.js +6 -0
  200. package/dist/api/commands/section/tagOnSection.js.map +1 -1
  201. package/dist/api/commands/section/unAssignParkingSpaceToSection.d.ts +1 -1
  202. package/dist/api/commands/section/unAssignParkingSpaceToSection.js +6 -10
  203. package/dist/api/commands/section/unAssignParkingSpaceToSection.js.map +1 -1
  204. package/dist/api/commands/section/unAssignStorageRoomToSection.d.ts +1 -1
  205. package/dist/api/commands/section/unAssignStorageRoomToSection.js +6 -10
  206. package/dist/api/commands/section/unAssignStorageRoomToSection.js.map +1 -1
  207. package/dist/api/commands/section/updateSection.d.ts +1 -1
  208. package/dist/api/commands/section/updateSection.js +16 -5
  209. package/dist/api/commands/section/updateSection.js.map +1 -1
  210. package/dist/api/commands/section/updateTagsOnSection.d.ts +1 -1
  211. package/dist/api/commands/section/updateTagsOnSection.js +3 -0
  212. package/dist/api/commands/section/updateTagsOnSection.js.map +1 -1
  213. package/dist/api/commands/settlement/updateSettlementProviderConfiguration.d.ts +1 -1
  214. package/dist/api/commands/settlement/updateSettlementProviderConfiguration.js +9 -4
  215. package/dist/api/commands/settlement/updateSettlementProviderConfiguration.js.map +1 -1
  216. package/dist/api/commands/settlement/upsertSettlementProviderCredentials.d.ts +1 -1
  217. package/dist/api/commands/settlement/upsertSettlementProviderCredentials.js +8 -3
  218. package/dist/api/commands/settlement/upsertSettlementProviderCredentials.js.map +1 -1
  219. package/dist/api/commands/storageRoom/createStorageRoom.d.ts +1 -1
  220. package/dist/api/commands/storageRoom/createStorageRoom.js +4 -3
  221. package/dist/api/commands/storageRoom/createStorageRoom.js.map +1 -1
  222. package/dist/api/commands/storageRoom/deleteStorageRoom.d.ts +1 -1
  223. package/dist/api/commands/storageRoom/deleteStorageRoom.js +5 -14
  224. package/dist/api/commands/storageRoom/deleteStorageRoom.js.map +1 -1
  225. package/dist/api/commands/storageRoom/updateStorageRoom.d.ts +1 -1
  226. package/dist/api/commands/storageRoom/updateStorageRoom.js +4 -3
  227. package/dist/api/commands/storageRoom/updateStorageRoom.js.map +1 -1
  228. package/dist/api/commands/user/deleteProfilePicture.d.ts +1 -1
  229. package/dist/api/commands/user/deleteProfilePicture.js +3 -0
  230. package/dist/api/commands/user/deleteProfilePicture.js.map +1 -1
  231. package/dist/api/commands/user/fCMDevice.d.ts +5 -2
  232. package/dist/api/commands/user/fCMDevice.js +5 -2
  233. package/dist/api/commands/user/fCMDevice.js.map +1 -1
  234. package/dist/api/commands/user/updateUser.d.ts +1 -1
  235. package/dist/api/commands/user/updateUser.js +8 -3
  236. package/dist/api/commands/user/updateUser.js.map +1 -1
  237. package/dist/api/commands/user/uploadProfilePicture.d.ts +1 -1
  238. package/dist/api/commands/user/uploadProfilePicture.js +8 -3
  239. package/dist/api/commands/user/uploadProfilePicture.js.map +1 -1
  240. package/dist/api/queries/document/documents.js +2 -1
  241. package/dist/api/queries/document/documents.js.map +1 -1
  242. package/dist/api/queries/homepage/homepage.js +7 -6
  243. package/dist/api/queries/homepage/homepage.js.map +1 -1
  244. package/dist/api/queries/invoicing/customerInvoices.d.ts +1 -1
  245. package/dist/api/queries/invoicing/customerInvoices.js +1 -1
  246. package/dist/api/queries/invoicing/customerInvoices.js.map +1 -1
  247. package/dist/api/queries/invoicing/customerMetadata.d.ts +1 -1
  248. package/dist/api/queries/invoicing/customerMetadata.js +1 -1
  249. package/dist/api/queries/invoicing/customerMetadata.js.map +1 -1
  250. package/dist/api/queries/invoicing/customerRecipient.d.ts +1 -1
  251. package/dist/api/queries/invoicing/customerRecipient.js +1 -1
  252. package/dist/api/queries/invoicing/customerRecipient.js.map +1 -1
  253. package/dist/api/queries/invoicing/invoicingKeys.js +34 -27
  254. package/dist/api/queries/invoicing/invoicingKeys.js.map +1 -1
  255. package/dist/api/queries/invoicing/sectionInvoices.d.ts +1 -1
  256. package/dist/api/queries/invoicing/sectionInvoices.js +1 -1
  257. package/dist/api/queries/invoicing/sectionInvoices.js.map +1 -1
  258. package/dist/api/queries/organization/organization.d.ts +15 -7
  259. package/dist/api/queries/organization/organization.js +8 -9
  260. package/dist/api/queries/organization/organization.js.map +1 -1
  261. package/dist/api/queries/parkingSpaces/parkingSpaceOperations.d.ts +744 -0
  262. package/dist/api/queries/parkingSpaces/parkingSpaceOperations.js +115 -0
  263. package/dist/api/queries/parkingSpaces/parkingSpaceOperations.js.map +1 -0
  264. package/dist/api/queries/parkingSpaces/parkingSpaces.d.ts +1 -1
  265. package/dist/api/queries/parkingSpaces/parkingSpaces.js +5 -1
  266. package/dist/api/queries/parkingSpaces/parkingSpaces.js.map +1 -1
  267. package/dist/api/queries/person/person.d.ts +19 -7
  268. package/dist/api/queries/person/person.js +9 -10
  269. package/dist/api/queries/person/person.js.map +1 -1
  270. package/dist/api/queries/residentsAndSections/domain.d.ts +24 -1
  271. package/dist/api/queries/residentsAndSections/domain.js +21 -1
  272. package/dist/api/queries/residentsAndSections/domain.js.map +1 -1
  273. package/dist/api/queries/residentsAndSections/queryIdentity.d.ts +11 -0
  274. package/dist/api/queries/residentsAndSections/queryIdentity.js +14 -0
  275. package/dist/api/queries/residentsAndSections/queryIdentity.js.map +1 -0
  276. package/dist/api/queries/residentsAndSections/residents.d.ts +47 -6
  277. package/dist/api/queries/residentsAndSections/residents.js +77 -1
  278. package/dist/api/queries/residentsAndSections/residents.js.map +1 -1
  279. package/dist/api/queries/residentsAndSections/sections.d.ts +19 -6
  280. package/dist/api/queries/residentsAndSections/sections.js +26 -1
  281. package/dist/api/queries/residentsAndSections/sections.js.map +1 -1
  282. package/dist/api/queries/residentsAndSections/sectionsSearch.d.ts +8 -7
  283. package/dist/api/queries/residentsAndSections/sectionsSearch.js +9 -3
  284. package/dist/api/queries/residentsAndSections/sectionsSearch.js.map +1 -1
  285. package/dist/api/queries/storageRoom/storageRoomOperations.d.ts +728 -0
  286. package/dist/api/queries/storageRoom/storageRoomOperations.js +106 -0
  287. package/dist/api/queries/storageRoom/storageRoomOperations.js.map +1 -0
  288. package/dist/api/queries/storageRoom/storageRooms.d.ts +1 -1
  289. package/dist/api/queries/storageRoom/storageRooms.js +5 -1
  290. package/dist/api/queries/storageRoom/storageRooms.js.map +1 -1
  291. package/dist/api/queries/supplier/suppliers.js +3 -2
  292. package/dist/api/queries/supplier/suppliers.js.map +1 -1
  293. package/dist/index.d.ts +8 -0
  294. package/dist/index.js +8 -0
  295. package/dist/index.js.map +1 -1
  296. package/dist/utils/pageUtils.d.ts +2 -2
  297. package/dist/utils/pageUtils.js.map +1 -1
  298. package/dist/utils/queryKeys.d.ts +1 -0
  299. package/dist/utils/queryKeys.js +8 -0
  300. package/dist/utils/queryKeys.js.map +1 -0
  301. package/package.json +2 -2
@@ -0,0 +1,36 @@
1
+ import { type CreateOrganizationResidentCommandProps, type CreatePersonResidentCommandProps, type Id, type Organization, type Person, type SdkInput, type SoliboClient, type UpdateOrganizationResidentCommandProps, type UpdatePersonResidentCommandProps } from "@solibo/solibo-sdk";
2
+ import type { QueryClient } from "@tanstack/query-core";
3
+ export type CreatePersonResidentMutationParams = {
4
+ companyId: Id;
5
+ cmd: SdkInput<CreatePersonResidentCommandProps>;
6
+ };
7
+ export type CreateOrganizationResidentMutationParams = {
8
+ companyId: Id;
9
+ cmd: SdkInput<CreateOrganizationResidentCommandProps>;
10
+ };
11
+ export type UpdatePersonResidentMutationParams = {
12
+ companyId: Id;
13
+ residentId: Id;
14
+ cmd: SdkInput<UpdatePersonResidentCommandProps>;
15
+ };
16
+ export type UpdateOrganizationResidentMutationParams = {
17
+ companyId: Id;
18
+ residentId: Id;
19
+ cmd: SdkInput<UpdateOrganizationResidentCommandProps>;
20
+ };
21
+ export declare function createPersonResidentMutationOptions(sdk: SoliboClient, queryClient: QueryClient): {
22
+ mutationFn: (params: CreatePersonResidentMutationParams) => Promise<Person | null>;
23
+ onSuccess: (resident: Person | null, params: CreatePersonResidentMutationParams) => Promise<void[]>;
24
+ };
25
+ export declare function createOrganizationResidentMutationOptions(sdk: SoliboClient, queryClient: QueryClient): {
26
+ mutationFn: (params: CreateOrganizationResidentMutationParams) => Promise<Organization | null>;
27
+ onSuccess: (resident: Organization | null, params: CreateOrganizationResidentMutationParams) => Promise<void[]>;
28
+ };
29
+ export declare function updatePersonResidentMutationOptions(sdk: SoliboClient, queryClient: QueryClient): {
30
+ mutationFn: (params: UpdatePersonResidentMutationParams) => Promise<Person>;
31
+ onSuccess: (resident: Person, params: UpdatePersonResidentMutationParams) => Promise<void[]>;
32
+ };
33
+ export declare function updateOrganizationResidentMutationOptions(sdk: SoliboClient, queryClient: QueryClient): {
34
+ mutationFn: (params: UpdateOrganizationResidentMutationParams) => Promise<Organization>;
35
+ onSuccess: (resident: Organization, params: UpdateOrganizationResidentMutationParams) => Promise<void[]>;
36
+ };
@@ -0,0 +1,63 @@
1
+ import { ResidentType, } from "@solibo/solibo-sdk";
2
+ import { invalidateResidentSectionCaches } from "../residentsAndSections/cacheInvalidation.js";
3
+ export function createPersonResidentMutationOptions(sdk, queryClient) {
4
+ return {
5
+ mutationFn: (params) => sdk.api.residents.createPersonResident({
6
+ companyId: params.companyId,
7
+ input: params.cmd,
8
+ }),
9
+ onSuccess: (resident, params) => invalidateResidentSectionCaches(queryClient, {
10
+ companyId: params.companyId,
11
+ residentType: ResidentType.Person.name,
12
+ residentId: resident?.id,
13
+ personId: resident?.id,
14
+ sectionId: params.cmd.sectionId ?? undefined,
15
+ }),
16
+ };
17
+ }
18
+ export function createOrganizationResidentMutationOptions(sdk, queryClient) {
19
+ return {
20
+ mutationFn: (params) => sdk.api.residents.createOrganizationResident({
21
+ companyId: params.companyId,
22
+ input: params.cmd,
23
+ }),
24
+ onSuccess: (resident, params) => invalidateResidentSectionCaches(queryClient, {
25
+ companyId: params.companyId,
26
+ residentType: ResidentType.Organization.name,
27
+ residentId: resident?.id,
28
+ organizationId: resident?.id,
29
+ sectionId: params.cmd.sectionId ?? undefined,
30
+ }),
31
+ };
32
+ }
33
+ export function updatePersonResidentMutationOptions(sdk, queryClient) {
34
+ return {
35
+ mutationFn: (params) => sdk.api.residents.updatePersonResident({
36
+ companyId: params.companyId,
37
+ residentId: params.residentId,
38
+ input: params.cmd,
39
+ }),
40
+ onSuccess: (resident, params) => invalidateResidentSectionCaches(queryClient, {
41
+ companyId: params.companyId,
42
+ residentType: ResidentType.Person.name,
43
+ residentId: params.residentId,
44
+ personId: resident.id,
45
+ }),
46
+ };
47
+ }
48
+ export function updateOrganizationResidentMutationOptions(sdk, queryClient) {
49
+ return {
50
+ mutationFn: (params) => sdk.api.residents.updateOrganizationResident({
51
+ companyId: params.companyId,
52
+ residentId: params.residentId,
53
+ input: params.cmd,
54
+ }),
55
+ onSuccess: (resident, params) => invalidateResidentSectionCaches(queryClient, {
56
+ companyId: params.companyId,
57
+ residentType: ResidentType.Organization.name,
58
+ residentId: params.residentId,
59
+ organizationId: resident.id,
60
+ }),
61
+ };
62
+ }
63
+ //# sourceMappingURL=typedResidentMutations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typedResidentMutations.js","sourceRoot":"","sources":["../../../../src/api/commands/resident/typedResidentMutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,YAAY,GAKb,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,+BAA+B,EAAE,MAAM,8CAA8C,CAAC;AAwB/F,MAAM,UAAU,mCAAmC,CACjD,GAAiB,EACjB,WAAwB;IAExB,OAAO;QACL,UAAU,EAAE,CAAC,MAA0C,EAAE,EAAE,CACzD,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,oBAAoB,CAAC;YACrC,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,KAAK,EAAE,MAAM,CAAC,GAAG;SAClB,CAAC;QACJ,SAAS,EAAE,CACT,QAAuB,EACvB,MAA0C,EAC1C,EAAE,CACF,+BAA+B,CAAC,WAAW,EAAE;YAC3C,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,YAAY,EAAE,YAAY,CAAC,MAAM,CAAC,IAAI;YACtC,UAAU,EAAE,QAAQ,EAAE,EAAE;YACxB,QAAQ,EAAE,QAAQ,EAAE,EAAE;YACtB,SAAS,EAAE,MAAM,CAAC,GAAG,CAAC,SAAS,IAAI,SAAS;SAC7C,CAAC;KACL,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,yCAAyC,CACvD,GAAiB,EACjB,WAAwB;IAExB,OAAO;QACL,UAAU,EAAE,CAAC,MAAgD,EAAE,EAAE,CAC/D,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,0BAA0B,CAAC;YAC3C,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,KAAK,EAAE,MAAM,CAAC,GAAG;SAClB,CAAC;QACJ,SAAS,EAAE,CACT,QAA6B,EAC7B,MAA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+B,CAAC,WAAW,EAAE;YAC3C,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,YAAY,EAAE,YAAY,CAAC,YAAY,CAAC,IAAI;YAC5C,UAAU,EAAE,MAAM,CAAC,UAAU;YAC7B,cAAc,EAAE,QAAQ,CAAC,EAAE;SAC5B,CAAC;KACL,CAAC;AACJ,CAAC","sourcesContent":["import {\n type CreateOrganizationResidentCommandProps,\n type CreatePersonResidentCommandProps,\n type Id,\n type Organization,\n type Person,\n ResidentType,\n type SdkInput,\n type SoliboClient,\n type UpdateOrganizationResidentCommandProps,\n type UpdatePersonResidentCommandProps,\n} from \"@solibo/solibo-sdk\";\nimport type { QueryClient } from \"@tanstack/query-core\";\nimport { invalidateResidentSectionCaches } from \"../residentsAndSections/cacheInvalidation.js\";\n\nexport type CreatePersonResidentMutationParams = {\n companyId: Id;\n cmd: SdkInput<CreatePersonResidentCommandProps>;\n};\n\nexport type CreateOrganizationResidentMutationParams = {\n companyId: Id;\n cmd: SdkInput<CreateOrganizationResidentCommandProps>;\n};\n\nexport type UpdatePersonResidentMutationParams = {\n companyId: Id;\n residentId: Id;\n cmd: SdkInput<UpdatePersonResidentCommandProps>;\n};\n\nexport type UpdateOrganizationResidentMutationParams = {\n companyId: Id;\n residentId: Id;\n cmd: SdkInput<UpdateOrganizationResidentCommandProps>;\n};\n\nexport function createPersonResidentMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return {\n mutationFn: (params: CreatePersonResidentMutationParams) =>\n sdk.api.residents.createPersonResident({\n companyId: params.companyId,\n input: params.cmd,\n }),\n onSuccess: (\n resident: Person | null,\n params: CreatePersonResidentMutationParams,\n ) =>\n invalidateResidentSectionCaches(queryClient, {\n companyId: params.companyId,\n residentType: ResidentType.Person.name,\n residentId: resident?.id,\n personId: resident?.id,\n sectionId: params.cmd.sectionId ?? undefined,\n }),\n };\n}\n\nexport function createOrganizationResidentMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return {\n mutationFn: (params: CreateOrganizationResidentMutationParams) =>\n sdk.api.residents.createOrganizationResident({\n companyId: params.companyId,\n input: params.cmd,\n }),\n onSuccess: (\n resident: Organization | null,\n params: CreateOrganizationResidentMutationParams,\n ) =>\n invalidateResidentSectionCaches(queryClient, {\n companyId: params.companyId,\n residentType: ResidentType.Organization.name,\n residentId: resident?.id,\n organizationId: resident?.id,\n sectionId: params.cmd.sectionId ?? undefined,\n }),\n };\n}\n\nexport function updatePersonResidentMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return {\n mutationFn: (params: UpdatePersonResidentMutationParams) =>\n sdk.api.residents.updatePersonResident({\n companyId: params.companyId,\n residentId: params.residentId,\n input: params.cmd,\n }),\n onSuccess: (resident: Person, params: UpdatePersonResidentMutationParams) =>\n invalidateResidentSectionCaches(queryClient, {\n companyId: params.companyId,\n residentType: ResidentType.Person.name,\n residentId: params.residentId,\n personId: resident.id,\n }),\n };\n}\n\nexport function updateOrganizationResidentMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return {\n mutationFn: (params: UpdateOrganizationResidentMutationParams) =>\n sdk.api.residents.updateOrganizationResident({\n companyId: params.companyId,\n residentId: params.residentId,\n input: params.cmd,\n }),\n onSuccess: (\n resident: Organization,\n params: UpdateOrganizationResidentMutationParams,\n ) =>\n invalidateResidentSectionCaches(queryClient, {\n companyId: params.companyId,\n residentType: ResidentType.Organization.name,\n residentId: params.residentId,\n organizationId: resident.id,\n }),\n };\n}\n"]}
@@ -9,5 +9,5 @@ export declare function updateOccupancyRecordMutationOptions(sdk: SoliboClient,
9
9
  occupancyId: Id;
10
10
  cmd: SdkInput<UpdateAttendanceCommandProps>;
11
11
  }) => Promise<void>;
12
- onSuccess: (_: any, params: any) => Promise<[void, void, void]>;
12
+ onSuccess: (_: any, params: any) => Promise<void[]>;
13
13
  };
@@ -1,5 +1,4 @@
1
- import { residentKeys } from "../../queries/residentsAndSections/residents.js";
2
- import { sectionKeys } from "../../queries/residentsAndSections/sections.js";
1
+ import { invalidateResidentSectionCaches } from "../residentsAndSections/cacheInvalidation.js";
3
2
  export function updateOccupancyRecordMutationOptions(sdk, queryClient) {
4
3
  return {
5
4
  mutationFn: (params) => sdk.api.residents.updateResidentAttendance({
@@ -10,19 +9,12 @@ export function updateOccupancyRecordMutationOptions(sdk, queryClient) {
10
9
  attendanceId: params.occupancyId,
11
10
  input: params.cmd,
12
11
  }),
13
- onSuccess: (_, params) => Promise.all([
14
- queryClient.invalidateQueries({
15
- queryKey: [sectionKeys.occupancy(params.companyId, params.sectionId)],
16
- }),
17
- queryClient.invalidateQueries({
18
- queryKey: [
19
- residentKeys.occupancy(params.companyId, params.residentType, params.residentId),
20
- ],
21
- }),
22
- queryClient.invalidateQueries({
23
- queryKey: [residentKeys.list(params.companyId)],
24
- }),
25
- ]),
12
+ onSuccess: (_, params) => invalidateResidentSectionCaches(queryClient, {
13
+ companyId: params.companyId,
14
+ residentType: params.residentType,
15
+ residentId: params.residentId,
16
+ sectionId: params.sectionId,
17
+ }),
26
18
  };
27
19
  }
28
20
  //# sourceMappingURL=updateOccupancyRecord.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"updateOccupancyRecord.js","sourceRoot":"","sources":["../../../../src/api/commands/resident/updateOccupancyRecord.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,MAAM,iDAAiD,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,gDAAgD,CAAC;AAC7E,MAAM,UAAU,oCAAoC,CAClD,GAAiB,EACjB,WAAwB;IAExB,OAAO;QACL,UAAU,EAAE,CAAC,MAOZ,EAAE,EAAE,CACH,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,wBAAwB,CAAC;YACzC,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,YAAY,EAAE,MAAM,CAAC,YAAY;YACjC,UAAU,EAAE,MAAM,CAAC,UAAU;YAC7B,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,YAAY,EAAE,MAAM,CAAC,WAAW;YAChC,KAAK,EAAE,MAAM,CAAC,GAAG;SAClB,CAAC;QACJ,SAAS,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CACvB,OAAO,CAAC,GAAG,CAAC;YACV,WAAW,CAAC,iBAAiB,CAAC;gBAC5B,QAAQ,EAAE,CAAC,WAAW,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;aACtE,CAAC;YACF,WAAW,CAAC,iBAAiB,CAAC;gBAC5B,QAAQ,EAAE;oBACR,YAAY,CAAC,SAAS,CACpB,MAAM,CAAC,SAAS,EAChB,MAAM,CAAC,YAAY,EACnB,MAAM,CAAC,UAAU,CAClB;iBACF;aACF,CAAC;YACF,WAAW,CAAC,iBAAiB,CAAC;gBAC5B,QAAQ,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;aAChD,CAAC;SACH,CAAC;KACL,CAAC;AACJ,CAAC","sourcesContent":["import {\n Id,\n SdkInput,\n SoliboClient,\n UpdateAttendanceCommandProps,\n} from \"@solibo/solibo-sdk\";\nimport type { QueryClient } from \"@tanstack/query-core\";\nimport { residentKeys } from \"../../queries/residentsAndSections/residents.js\";\nimport { sectionKeys } from \"../../queries/residentsAndSections/sections.js\";\nexport function updateOccupancyRecordMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return {\n mutationFn: (params: {\n companyId: Id;\n sectionId: Id;\n residentType: string;\n residentId: Id;\n occupancyId: Id;\n cmd: SdkInput<UpdateAttendanceCommandProps>;\n }) =>\n sdk.api.residents.updateResidentAttendance({\n companyId: params.companyId,\n residentType: params.residentType,\n residentId: params.residentId,\n sectionId: params.sectionId,\n attendanceId: params.occupancyId,\n input: params.cmd,\n }),\n onSuccess: (_, params) =>\n Promise.all([\n queryClient.invalidateQueries({\n queryKey: [sectionKeys.occupancy(params.companyId, params.sectionId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [\n residentKeys.occupancy(\n params.companyId,\n params.residentType,\n params.residentId,\n ),\n ],\n }),\n queryClient.invalidateQueries({\n queryKey: [residentKeys.list(params.companyId)],\n }),\n ]),\n };\n}\n"]}
1
+ {"version":3,"file":"updateOccupancyRecord.js","sourceRoot":"","sources":["../../../../src/api/commands/resident/updateOccupancyRecord.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,+BAA+B,EAAE,MAAM,8CAA8C,CAAC;AAC/F,MAAM,UAAU,oCAAoC,CAClD,GAAiB,EACjB,WAAwB;IAExB,OAAO;QACL,UAAU,EAAE,CAAC,MAOZ,EAAE,EAAE,CACH,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,wBAAwB,CAAC;YACzC,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,YAAY,EAAE,MAAM,CAAC,YAAY;YACjC,UAAU,EAAE,MAAM,CAAC,UAAU;YAC7B,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,YAAY,EAAE,MAAM,CAAC,WAAW;YAChC,KAAK,EAAE,MAAM,CAAC,GAAG;SAClB,CAAC;QACJ,SAAS,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CACvB,+BAA+B,CAAC,WAAW,EAAE;YAC3C,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,YAAY,EAAE,MAAM,CAAC,YAAY;YACjC,UAAU,EAAE,MAAM,CAAC,UAAU;YAC7B,SAAS,EAAE,MAAM,CAAC,SAAS;SAC5B,CAAC;KACL,CAAC;AACJ,CAAC","sourcesContent":["import {\n Id,\n SdkInput,\n SoliboClient,\n UpdateAttendanceCommandProps,\n} from \"@solibo/solibo-sdk\";\nimport type { QueryClient } from \"@tanstack/query-core\";\nimport { invalidateResidentSectionCaches } from \"../residentsAndSections/cacheInvalidation.js\";\nexport function updateOccupancyRecordMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return {\n mutationFn: (params: {\n companyId: Id;\n sectionId: Id;\n residentType: string;\n residentId: Id;\n occupancyId: Id;\n cmd: SdkInput<UpdateAttendanceCommandProps>;\n }) =>\n sdk.api.residents.updateResidentAttendance({\n companyId: params.companyId,\n residentType: params.residentType,\n residentId: params.residentId,\n sectionId: params.sectionId,\n attendanceId: params.occupancyId,\n input: params.cmd,\n }),\n onSuccess: (_, params) =>\n invalidateResidentSectionCaches(queryClient, {\n companyId: params.companyId,\n residentType: params.residentType,\n residentId: params.residentId,\n sectionId: params.sectionId,\n }),\n };\n}\n"]}
@@ -1,11 +1,15 @@
1
1
  import { communicationKeys } from "../../queries/communication/newsletters.js";
2
2
  import { residentKeys } from "../../queries/residentsAndSections/residents.js";
3
+ import { assertMatchingCompanyId } from "../residentsAndSections/companyScope.js";
3
4
  export function updateOrganizationReservationsMutationOptions(sdk, queryClient) {
4
5
  return {
5
- mutationFn: (params) => sdk.api.organization.updateOrganizationReservations({
6
- organizationId: params.organizationId,
7
- input: params.cmd,
8
- }),
6
+ mutationFn: (params) => {
7
+ assertMatchingCompanyId(params.companyId, params.cmd.companyId, "updateOrganizationReservations");
8
+ return sdk.api.organization.updateOrganizationReservations({
9
+ organizationId: params.organizationId,
10
+ input: params.cmd,
11
+ });
12
+ },
9
13
  onSuccess: (_, params) => Promise.all([
10
14
  queryClient.invalidateQueries({
11
15
  queryKey: [residentKeys.list(params.companyId)],
@@ -1 +1 @@
1
- {"version":3,"file":"updateOrganizationReservations.js","sourceRoot":"","sources":["../../../../src/api/commands/resident/updateOrganizationReservations.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,iDAAiD,CAAC;AAC/E,MAAM,UAAU,6CAA6C,CAC3D,GAAiB,EACjB,WAAwB;IAExB,OAAO;QACL,UAAU,EAAE,CAAC,MAIZ,EAAE,EAAE,CACH,GAAG,CAAC,GAAG,CAAC,YAAY,CAAC,8BAA8B,CAAC;YAClD,cAAc,EAAE,MAAM,CAAC,cAAc;YACrC,KAAK,EAAE,MAAM,CAAC,GAAG;SAClB,CAAC;QACJ,SAAS,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CACvB,OAAO,CAAC,GAAG,CAAC;YACV,WAAW,CAAC,iBAAiB,CAAC;gBAC5B,QAAQ,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;aAChD,CAAC;YACF,WAAW,CAAC,iBAAiB,CAAC;gBAC5B,QAAQ,EAAE;oBACR,iBAAiB,CAAC,uBAAuB,CAAC,MAAM,CAAC,SAAS,CAAC;iBAC5D;aACF,CAAC;YACF,WAAW,CAAC,iBAAiB,CAAC;gBAC5B,QAAQ,EAAE,CAAC,iBAAiB,CAAC,qBAAqB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;aACtE,CAAC;SACH,CAAC;KACL,CAAC;AACJ,CAAC","sourcesContent":["import {\n Id,\n SdkInput,\n SoliboClient,\n UpdateOrganizationReservationsCommandProps,\n} from \"@solibo/solibo-sdk\";\nimport type { QueryClient } from \"@tanstack/query-core\";\nimport { communicationKeys } from \"../../queries/communication/newsletters.js\";\nimport { residentKeys } from \"../../queries/residentsAndSections/residents.js\";\nexport function updateOrganizationReservationsMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return {\n mutationFn: (params: {\n companyId: Id;\n organizationId: Id;\n cmd: SdkInput<UpdateOrganizationReservationsCommandProps>;\n }) =>\n sdk.api.organization.updateOrganizationReservations({\n organizationId: params.organizationId,\n input: params.cmd,\n }),\n onSuccess: (_, params) =>\n Promise.all([\n queryClient.invalidateQueries({\n queryKey: [residentKeys.list(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [\n communicationKeys.notificationGroupsEmail(params.companyId),\n ],\n }),\n queryClient.invalidateQueries({\n queryKey: [communicationKeys.notificationGroupsSms(params.companyId)],\n }),\n ]),\n };\n}\n"]}
1
+ {"version":3,"file":"updateOrganizationReservations.js","sourceRoot":"","sources":["../../../../src/api/commands/resident/updateOrganizationReservations.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,iDAAiD,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAClF,MAAM,UAAU,6CAA6C,CAC3D,GAAiB,EACjB,WAAwB;IAExB,OAAO;QACL,UAAU,EAAE,CAAC,MAIZ,EAAE,EAAE;YACH,uBAAuB,CACrB,MAAM,CAAC,SAAS,EAChB,MAAM,CAAC,GAAG,CAAC,SAAS,EACpB,gCAAgC,CACjC,CAAC;YACF,OAAO,GAAG,CAAC,GAAG,CAAC,YAAY,CAAC,8BAA8B,CAAC;gBACzD,cAAc,EAAE,MAAM,CAAC,cAAc;gBACrC,KAAK,EAAE,MAAM,CAAC,GAAG;aAClB,CAAC,CAAC;QACL,CAAC;QACD,SAAS,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CACvB,OAAO,CAAC,GAAG,CAAC;YACV,WAAW,CAAC,iBAAiB,CAAC;gBAC5B,QAAQ,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;aAChD,CAAC;YACF,WAAW,CAAC,iBAAiB,CAAC;gBAC5B,QAAQ,EAAE;oBACR,iBAAiB,CAAC,uBAAuB,CAAC,MAAM,CAAC,SAAS,CAAC;iBAC5D;aACF,CAAC;YACF,WAAW,CAAC,iBAAiB,CAAC;gBAC5B,QAAQ,EAAE,CAAC,iBAAiB,CAAC,qBAAqB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;aACtE,CAAC;SACH,CAAC;KACL,CAAC;AACJ,CAAC","sourcesContent":["import {\n Id,\n SdkInput,\n SoliboClient,\n UpdateOrganizationReservationsCommandProps,\n} from \"@solibo/solibo-sdk\";\nimport type { QueryClient } from \"@tanstack/query-core\";\nimport { communicationKeys } from \"../../queries/communication/newsletters.js\";\nimport { residentKeys } from \"../../queries/residentsAndSections/residents.js\";\nimport { assertMatchingCompanyId } from \"../residentsAndSections/companyScope.js\";\nexport function updateOrganizationReservationsMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return {\n mutationFn: (params: {\n companyId: Id;\n organizationId: Id;\n cmd: SdkInput<UpdateOrganizationReservationsCommandProps>;\n }) => {\n assertMatchingCompanyId(\n params.companyId,\n params.cmd.companyId,\n \"updateOrganizationReservations\",\n );\n return sdk.api.organization.updateOrganizationReservations({\n organizationId: params.organizationId,\n input: params.cmd,\n });\n },\n onSuccess: (_, params) =>\n Promise.all([\n queryClient.invalidateQueries({\n queryKey: [residentKeys.list(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [\n communicationKeys.notificationGroupsEmail(params.companyId),\n ],\n }),\n queryClient.invalidateQueries({\n queryKey: [communicationKeys.notificationGroupsSms(params.companyId)],\n }),\n ]),\n };\n}\n"]}
@@ -1,5 +1,10 @@
1
1
  import { Id, Person, ResidentType, SoliboClient, UpdateResidentCommand } from "@solibo/solibo-sdk";
2
2
  import type { QueryClient } from "@tanstack/query-core";
3
+ /**
4
+ * @deprecated The backend can return either person or organization data while
5
+ * this legacy contract reports Person. Use updatePersonResidentMutationOptions
6
+ * or updateOrganizationResidentMutationOptions for exact result types.
7
+ */
3
8
  export declare function updateResidentMutationOptions(sdk: SoliboClient, queryClient: QueryClient): {
4
9
  mutationFn: (params: {
5
10
  companyId: Id;
@@ -7,5 +12,5 @@ export declare function updateResidentMutationOptions(sdk: SoliboClient, queryCl
7
12
  residentId: Id;
8
13
  cmd: UpdateResidentCommand;
9
14
  }) => Promise<Person>;
10
- onSuccess: (res: Person, params: any) => Promise<[void, void, void, void, void, void, void, void, void, void, void, void, void]>;
15
+ onSuccess: (res: Person, params: any) => Promise<[void[], void, void, void, void, void, void, void, void, void, void, void, void, void]>;
11
16
  };
@@ -5,6 +5,12 @@ import { invoicingKeys } from "../../queries/invoicing/invoicingKeys.js";
5
5
  import { organizationKeys } from "../../queries/organization/organizationsInCompany.js";
6
6
  import { personKeys } from "../../queries/person/persons.js";
7
7
  import { residentKeys } from "../../queries/residentsAndSections/residents.js";
8
+ import { invalidateResidentSectionCaches } from "../residentsAndSections/cacheInvalidation.js";
9
+ /**
10
+ * @deprecated The backend can return either person or organization data while
11
+ * this legacy contract reports Person. Use updatePersonResidentMutationOptions
12
+ * or updateOrganizationResidentMutationOptions for exact result types.
13
+ */
8
14
  export function updateResidentMutationOptions(sdk, queryClient) {
9
15
  return {
10
16
  mutationFn: (params) => sdk.api.residents.updateResident({
@@ -14,6 +20,11 @@ export function updateResidentMutationOptions(sdk, queryClient) {
14
20
  input: params.cmd,
15
21
  }),
16
22
  onSuccess: (res, params) => Promise.all([
23
+ invalidateResidentSectionCaches(queryClient, {
24
+ companyId: params.companyId,
25
+ residentType: params.residentType.name,
26
+ residentId: params.residentId,
27
+ }),
17
28
  queryClient.invalidateQueries({
18
29
  queryKey: [residentKeys.list(params.companyId)],
19
30
  }),
@@ -1 +1 @@
1
- {"version":3,"file":"updateResident.js","sourceRoot":"","sources":["../../../../src/api/commands/resident/updateResident.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sDAAsD,CAAC;AACxF,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,iDAAiD,CAAC;AAC/E,MAAM,UAAU,6BAA6B,CAC3C,GAAiB,EACjB,WAAwB;IAExB,OAAO;QACL,UAAU,EAAE,CAAC,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aACtD,CAAC;YACF,WAAW,CAAC,iBAAiB,CAAC;gBAC5B,QAAQ,EAAE;oBACR,aAAa,CAAC,cAAc,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,UAAU,CAAC;iBAClE;aACF,CAAC;YACF,WAAW,CAAC,iBAAiB,CAAC;gBAC5B,QAAQ,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;aAClD,CAAC;YACF,WAAW,CAAC,iBAAiB,CAAC;gBAC5B,QAAQ,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;aAC7C,CAAC;YACF,WAAW,CAAC,iBAAiB,CAAC;gBAC5B,QAAQ,EAAE,CAAC,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;aACpD,CAAC;YACF,WAAW,CAAC,iBAAiB,CAAC;gBAC5B,QAAQ,EAAE,CAAC,aAAa,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;aACvD,CAAC;YACF,WAAW,CAAC,iBAAiB,CAAC;gBAC5B,QAAQ,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;aACpD,CAAC;SACH,CAAC;KACL,CAAC;AACJ,CAAC","sourcesContent":["import {\n Id,\n Person,\n ResidentType,\n SoliboClient,\n UpdateResidentCommand,\n} from \"@solibo/solibo-sdk\";\nimport type { QueryClient } from \"@tanstack/query-core\";\nimport { boardKeys } from \"../../queries/board/boardMembers.js\";\nimport { communicationKeys } from \"../../queries/communication/newsletters.js\";\nimport { conversationKeys } from \"../../queries/conversation/conversations.js\";\nimport { invoicingKeys } from \"../../queries/invoicing/invoicingKeys.js\";\nimport { organizationKeys } from \"../../queries/organization/organizationsInCompany.js\";\nimport { personKeys } from \"../../queries/person/persons.js\";\nimport { residentKeys } from \"../../queries/residentsAndSections/residents.js\";\nexport function updateResidentMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return {\n mutationFn: (params: {\n companyId: Id;\n residentType: ResidentType;\n residentId: Id;\n cmd: UpdateResidentCommand;\n }) =>\n sdk.api.residents.updateResident({\n companyId: params.companyId,\n residentType: params.residentType.name,\n residentId: params.residentId,\n input: params.cmd,\n }),\n onSuccess: (res: Person, params) =>\n Promise.all([\n queryClient.invalidateQueries({\n queryKey: [residentKeys.list(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [residentKeys.personalId(params.companyId, res.id)],\n }),\n queryClient.invalidateQueries({\n queryKey: [\n communicationKeys.notificationGroupsEmail(params.companyId),\n ],\n }),\n queryClient.invalidateQueries({\n queryKey: [communicationKeys.notificationGroupsSms(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [organizationKeys.list(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [personKeys.list(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [invoicingKeys.customers(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [\n invoicingKeys.customerDetail(params.companyId, params.residentId),\n ],\n }),\n queryClient.invalidateQueries({\n queryKey: [invoicingKeys.plans(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [boardKeys.list(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [invoicingKeys.preview(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [invoicingKeys.previewPdf(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [conversationKeys.list(params.companyId)],\n }),\n ]),\n };\n}\n"]}
1
+ {"version":3,"file":"updateResident.js","sourceRoot":"","sources":["../../../../src/api/commands/resident/updateResident.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAC/E,OAA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Q,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;aACpD,CAAC;SACH,CAAC;KACL,CAAC;AACJ,CAAC","sourcesContent":["import {\n Id,\n Person,\n ResidentType,\n SoliboClient,\n UpdateResidentCommand,\n} from \"@solibo/solibo-sdk\";\nimport type { QueryClient } from \"@tanstack/query-core\";\nimport { boardKeys } from \"../../queries/board/boardMembers.js\";\nimport { communicationKeys } from \"../../queries/communication/newsletters.js\";\nimport { conversationKeys } from \"../../queries/conversation/conversations.js\";\nimport { invoicingKeys } from \"../../queries/invoicing/invoicingKeys.js\";\nimport { organizationKeys } from \"../../queries/organization/organizationsInCompany.js\";\nimport { personKeys } from \"../../queries/person/persons.js\";\nimport { residentKeys } from \"../../queries/residentsAndSections/residents.js\";\nimport { invalidateResidentSectionCaches } from \"../residentsAndSections/cacheInvalidation.js\";\n/**\n * @deprecated The backend can return either person or organization data while\n * this legacy contract reports Person. Use updatePersonResidentMutationOptions\n * or updateOrganizationResidentMutationOptions for exact result types.\n */\nexport function updateResidentMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return {\n mutationFn: (params: {\n companyId: Id;\n residentType: ResidentType;\n residentId: Id;\n cmd: UpdateResidentCommand;\n }) =>\n sdk.api.residents.updateResident({\n companyId: params.companyId,\n residentType: params.residentType.name,\n residentId: params.residentId,\n input: params.cmd,\n }),\n onSuccess: (res: Person, params) =>\n Promise.all([\n invalidateResidentSectionCaches(queryClient, {\n companyId: params.companyId,\n residentType: params.residentType.name,\n residentId: params.residentId,\n }),\n queryClient.invalidateQueries({\n queryKey: [residentKeys.list(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [residentKeys.personalId(params.companyId, res.id)],\n }),\n queryClient.invalidateQueries({\n queryKey: [\n communicationKeys.notificationGroupsEmail(params.companyId),\n ],\n }),\n queryClient.invalidateQueries({\n queryKey: [communicationKeys.notificationGroupsSms(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [organizationKeys.list(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [personKeys.list(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [invoicingKeys.customers(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [\n invoicingKeys.customerDetail(params.companyId, params.residentId),\n ],\n }),\n queryClient.invalidateQueries({\n queryKey: [invoicingKeys.plans(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [boardKeys.list(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [invoicingKeys.preview(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [invoicingKeys.previewPdf(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [conversationKeys.list(params.companyId)],\n }),\n ]),\n };\n}\n"]}
@@ -12,6 +12,15 @@ function mutationOptions(queryClient, mutationFn, homepage) {
12
12
  queryClient.invalidateQueries({
13
13
  queryKey: [homepageKeys.feed(params.companyId)],
14
14
  }),
15
+ ...(params.postId != null
16
+ ? [
17
+ queryClient.invalidateQueries({
18
+ queryKey: [
19
+ homepageKeys.feedPost(params.companyId, params.postId),
20
+ ],
21
+ }),
22
+ ]
23
+ : []),
15
24
  ]
16
25
  : []),
17
26
  ]),
@@ -1 +1 @@
1
- {"version":3,"file":"residentCommunicationMutations.js","sourceRoot":"","sources":["../../../../src/api/commands/residentCommunication/residentCommunicationMutations.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,yBAAyB,EAAE,MAAM,8DAA8D,CAAC;AAKzG,SAAS,eAAe,CACtB,WAAwB,EACxB,UAAqC,EACrC,QAAiB;IAEjB,OAAO;QACL,UAAU;QACV,SAAS,EAAE,CAAC,CAAI,EAAE,MAAS,EAAE,EAAE,CAC7B,OAAO,CAAC,GAAG,CAAC;YACV,WAAW,CAAC,iBAAiB,CAAC;gBAC5B,QAAQ,EAAE,CAAC,yBAAy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N,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,oDAAoD,CAClE,GAAiB,EACjB,WAAwB;IAExB,OAAO,eAAe,CACpB,WAAW,EACX,CAAC,MAAuD,EAAE,EAAE,CAC1D,GAAG,CAAC,GAAG,CAAC,qBAAqB,CAAC,qCAAqC,CACjE,MAAM,CACP,EACH,KAAK,CACN,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,qDAAqD,CACnE,GAAiB,EACjB,WAAwB;IAExB,OAAO,eAAe,CACpB,WAAW,EACX,CAAC,MAAwD,EAAE,EAAE,CAC3D,GAAG,CAAC,GAAG,CAAC,qBAAqB,CAAC,sCAAsC,CAClE,MAAM,CACP,EACH,KAAK,CACN,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,2DAA2D,CACzE,GAAiB,EACjB,WAAwB;IAExB,OAAO,eAAe,CACpB,WAAW,EACX,CAAC,MAA8D,EAAE,EAAE,CACjE,GAAG,CAAC,GAAG,CAAC,qBAAqB,CAAC,4CAA4C,CACxE,MAAM,CACP,EACH,KAAK,CACN,CAAC;AACJ,CAAC","sourcesContent":["import type { Id, SoliboClient } from \"@solibo/solibo-sdk\";\nimport type { QueryClient } from \"@tanstack/query-core\";\nimport { homepageKeys } from \"../../queries/homepage/homepage.js\";\nimport { residentCommunicationKeys } from \"../../queries/residentCommunication/residentCommunication.js\";\n\ntype Api = SoliboClient[\"api\"][\"residentCommunication\"];\ntype Params<K extends keyof Api> = Parameters<Api[K]>[0];\n\nfunction mutationOptions<P extends { companyId: Id }, R>(\n queryClient: QueryClient,\n mutationFn: (params: P) => Promise<R>,\n homepage: boolean,\n) {\n return {\n mutationFn,\n onSuccess: (_: R, params: P) =>\n Promise.all([\n queryClient.invalidateQueries({\n queryKey: [residentCommunicationKeys.all],\n }),\n ...(homepage\n ? [\n queryClient.invalidateQueries({\n queryKey: [homepageKeys.feed(params.companyId)],\n }),\n ]\n : []),\n ]),\n };\n}\n\nexport function createHomepagePostCommentMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"createHomepagePostComment\">) =>\n sdk.api.residentCommunication.createHomepagePostComment(params),\n true,\n );\n}\n\nexport function createNeighborhoodCommonFeedPostMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"createNeighborhoodCommonFeedPost\">) =>\n sdk.api.residentCommunication.createNeighborhoodCommonFeedPost(params),\n false,\n );\n}\n\nexport function createNeighborhoodGroupMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"createNeighborhoodGroup\">) =>\n sdk.api.residentCommunication.createNeighborhoodGroup(params),\n false,\n );\n}\n\nexport function createNeighborhoodGroupPostMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"createNeighborhoodGroupPost\">) =>\n sdk.api.residentCommunication.createNeighborhoodGroupPost(params),\n false,\n );\n}\n\nexport function createNeighborhoodPostCommentMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"createNeighborhoodPostComment\">) =>\n sdk.api.residentCommunication.createNeighborhoodPostComment(params),\n false,\n );\n}\n\nexport function deleteHomepageCommentReactionMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"deleteHomepageCommentReaction\">) =>\n sdk.api.residentCommunication.deleteHomepageCommentReaction(params),\n true,\n );\n}\n\nexport function deleteHomepagePostCommentMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"deleteHomepagePostComment\">) =>\n sdk.api.residentCommunication.deleteHomepagePostComment(params),\n true,\n );\n}\n\nexport function deleteHomepagePostReactionMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"deleteHomepagePostReaction\">) =>\n sdk.api.residentCommunication.deleteHomepagePostReaction(params),\n true,\n );\n}\n\nexport function deleteNeighborhoodCommentReactionMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"deleteNeighborhoodCommentReaction\">) =>\n sdk.api.residentCommunication.deleteNeighborhoodCommentReaction(params),\n false,\n );\n}\n\nexport function deleteNeighborhoodPostMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"deleteNeighborhoodPost\">) =>\n sdk.api.residentCommunication.deleteNeighborhoodPost(params),\n false,\n );\n}\n\nexport function deleteNeighborhoodPostCommentMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"deleteNeighborhoodPostComment\">) =>\n sdk.api.residentCommunication.deleteNeighborhoodPostComment(params),\n false,\n );\n}\n\nexport function deleteNeighborhoodPostReactionMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"deleteNeighborhoodPostReaction\">) =>\n sdk.api.residentCommunication.deleteNeighborhoodPostReaction(params),\n false,\n );\n}\n\nexport function putHomepageCommentReactionMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"putHomepageCommentReaction\">) =>\n sdk.api.residentCommunication.putHomepageCommentReaction(params),\n true,\n );\n}\n\nexport function putHomepagePostReactionMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"putHomepagePostReaction\">) =>\n sdk.api.residentCommunication.putHomepagePostReaction(params),\n true,\n );\n}\n\nexport function putNeighborhoodCommentReactionMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"putNeighborhoodCommentReaction\">) =>\n sdk.api.residentCommunication.putNeighborhoodCommentReaction(params),\n false,\n );\n}\n\nexport function putNeighborhoodPostReactionMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"putNeighborhoodPostReaction\">) =>\n sdk.api.residentCommunication.putNeighborhoodPostReaction(params),\n false,\n );\n}\n\nexport function updateHomepagePostCommentMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"updateHomepagePostComment\">) =>\n sdk.api.residentCommunication.updateHomepagePostComment(params),\n true,\n );\n}\n\nexport function updateHomepagePostCommentModerationStatusMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"updateHomepagePostCommentModerationStatus\">) =>\n sdk.api.residentCommunication.updateHomepagePostCommentModerationStatus(\n params,\n ),\n true,\n );\n}\n\nexport function updateHomepagePostCommentsEnabledMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"updateHomepagePostCommentsEnabled\">) =>\n sdk.api.residentCommunication.updateHomepagePostCommentsEnabled(params),\n true,\n );\n}\n\nexport function updateHomepagePostNotificationPreferenceMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"updateHomepagePostNotificationPreference\">) =>\n sdk.api.residentCommunication.updateHomepagePostNotificationPreference(\n params,\n ),\n true,\n );\n}\n\nexport function updateNeighborhoodCommonFeedFollowMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"updateNeighborhoodCommonFeedFollow\">) =>\n sdk.api.residentCommunication.updateNeighborhoodCommonFeedFollow(params),\n false,\n );\n}\n\nexport function updateNeighborhoodGroupMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"updateNeighborhoodGroup\">) =>\n sdk.api.residentCommunication.updateNeighborhoodGroup(params),\n false,\n );\n}\n\nexport function updateNeighborhoodGroupFollowMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"updateNeighborhoodGroupFollow\">) =>\n sdk.api.residentCommunication.updateNeighborhoodGroupFollow(params),\n false,\n );\n}\n\nexport function updateNeighborhoodGroupModerationStatusMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"updateNeighborhoodGroupModerationStatus\">) =>\n sdk.api.residentCommunication.updateNeighborhoodGroupModerationStatus(\n params,\n ),\n false,\n );\n}\n\nexport function updateNeighborhoodPostMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"updateNeighborhoodPost\">) =>\n sdk.api.residentCommunication.updateNeighborhoodPost(params),\n false,\n );\n}\n\nexport function updateNeighborhoodPostCommentMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"updateNeighborhoodPostComment\">) =>\n sdk.api.residentCommunication.updateNeighborhoodPostComment(params),\n false,\n );\n}\n\nexport function updateNeighborhoodPostCommentModerationStatusMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"updateNeighborhoodPostCommentModerationStatus\">) =>\n sdk.api.residentCommunication.updateNeighborhoodPostCommentModerationStatus(\n params,\n ),\n false,\n );\n}\n\nexport function updateNeighborhoodPostCommentsEnabledMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"updateNeighborhoodPostCommentsEnabled\">) =>\n sdk.api.residentCommunication.updateNeighborhoodPostCommentsEnabled(\n params,\n ),\n false,\n );\n}\n\nexport function updateNeighborhoodPostModerationStatusMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"updateNeighborhoodPostModerationStatus\">) =>\n sdk.api.residentCommunication.updateNeighborhoodPostModerationStatus(\n params,\n ),\n false,\n );\n}\n\nexport function updateNeighborhoodPostNotificationPreferenceMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"updateNeighborhoodPostNotificationPreference\">) =>\n sdk.api.residentCommunication.updateNeighborhoodPostNotificationPreference(\n params,\n ),\n false,\n );\n}\n"]}
1
+ {"version":3,"file":"residentCommunicationMutations.js","sourceRoot":"","sources":["../../../../src/api/commands/residentCommunication/residentCommunicationMutations.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,yBAAyB,EAAE,MAAM,8DAA8D,CAAC;AAKzG,SAAS,eAAe,CACtB,WAAwB,EACxB,UAAqC,EACrC,QAAiB;IAEjB,OAAO;QACL,UAAU;QACV,SAAS,EAAE,CAAC,CAAI,EAAE,MAAS,EAAE,EAAE,CAC7B,OAAO,CAAC,GAAG,CAAC;YACV,WAAW,CAAC,iBAAiB,CAAC;gBAC5B,QAAQ,EAAE,CAAC,yBAAyB,CAAC,GAAG,CAAC;aAC1C,CAAC;YACF,GAAG,CAAC,QAAQ;gBACV,CAAC,CAAC;oBACE,WAAW,CAAC,iBAAiB,CAAC;wBAC5B,QAAQ,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;qBAChD,CAAC;oBACF,GAAG,CAAC,MAAM,CAAC,MAAM,IAAI,IAAI;wBACvB,CAAC,CAAC;4BACE,WAAW,CAAC,iBAAiB,CAAC;gCAC5B,QAAQ,EAAE;oCACR,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC;iCACvD;6BACF,CAAC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AAqB,CAAC,qCAAqC,CACjE,MAAM,CACP,EACH,KAAK,CACN,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,qDAAqD,CACnE,GAAiB,EACjB,WAAwB;IAExB,OAAO,eAAe,CACpB,WAAW,EACX,CAAC,MAAwD,EAAE,EAAE,CAC3D,GAAG,CAAC,GAAG,CAAC,qBAAqB,CAAC,sCAAsC,CAClE,MAAM,CACP,EACH,KAAK,CACN,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,2DAA2D,CACzE,GAAiB,EACjB,WAAwB;IAExB,OAAO,eAAe,CACpB,WAAW,EACX,CAAC,MAA8D,EAAE,EAAE,CACjE,GAAG,CAAC,GAAG,CAAC,qBAAqB,CAAC,4CAA4C,CACxE,MAAM,CACP,EACH,KAAK,CACN,CAAC;AACJ,CAAC","sourcesContent":["import type { Id, SoliboClient } from \"@solibo/solibo-sdk\";\nimport type { QueryClient } from \"@tanstack/query-core\";\nimport { homepageKeys } from \"../../queries/homepage/homepage.js\";\nimport { residentCommunicationKeys } from \"../../queries/residentCommunication/residentCommunication.js\";\n\ntype Api = SoliboClient[\"api\"][\"residentCommunication\"];\ntype Params<K extends keyof Api> = Parameters<Api[K]>[0];\n\nfunction mutationOptions<P extends { companyId: Id; postId?: Id }, R>(\n queryClient: QueryClient,\n mutationFn: (params: P) => Promise<R>,\n homepage: boolean,\n) {\n return {\n mutationFn,\n onSuccess: (_: R, params: P) =>\n Promise.all([\n queryClient.invalidateQueries({\n queryKey: [residentCommunicationKeys.all],\n }),\n ...(homepage\n ? [\n queryClient.invalidateQueries({\n queryKey: [homepageKeys.feed(params.companyId)],\n }),\n ...(params.postId != null\n ? [\n queryClient.invalidateQueries({\n queryKey: [\n homepageKeys.feedPost(params.companyId, params.postId),\n ],\n }),\n ]\n : []),\n ]\n : []),\n ]),\n };\n}\n\nexport function createHomepagePostCommentMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"createHomepagePostComment\">) =>\n sdk.api.residentCommunication.createHomepagePostComment(params),\n true,\n );\n}\n\nexport function createNeighborhoodCommonFeedPostMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"createNeighborhoodCommonFeedPost\">) =>\n sdk.api.residentCommunication.createNeighborhoodCommonFeedPost(params),\n false,\n );\n}\n\nexport function createNeighborhoodGroupMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"createNeighborhoodGroup\">) =>\n sdk.api.residentCommunication.createNeighborhoodGroup(params),\n false,\n );\n}\n\nexport function createNeighborhoodGroupPostMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"createNeighborhoodGroupPost\">) =>\n sdk.api.residentCommunication.createNeighborhoodGroupPost(params),\n false,\n );\n}\n\nexport function createNeighborhoodPostCommentMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"createNeighborhoodPostComment\">) =>\n sdk.api.residentCommunication.createNeighborhoodPostComment(params),\n false,\n );\n}\n\nexport function deleteHomepageCommentReactionMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"deleteHomepageCommentReaction\">) =>\n sdk.api.residentCommunication.deleteHomepageCommentReaction(params),\n true,\n );\n}\n\nexport function deleteHomepagePostCommentMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"deleteHomepagePostComment\">) =>\n sdk.api.residentCommunication.deleteHomepagePostComment(params),\n true,\n );\n}\n\nexport function deleteHomepagePostReactionMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"deleteHomepagePostReaction\">) =>\n sdk.api.residentCommunication.deleteHomepagePostReaction(params),\n true,\n );\n}\n\nexport function deleteNeighborhoodCommentReactionMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"deleteNeighborhoodCommentReaction\">) =>\n sdk.api.residentCommunication.deleteNeighborhoodCommentReaction(params),\n false,\n );\n}\n\nexport function deleteNeighborhoodPostMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"deleteNeighborhoodPost\">) =>\n sdk.api.residentCommunication.deleteNeighborhoodPost(params),\n false,\n );\n}\n\nexport function deleteNeighborhoodPostCommentMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"deleteNeighborhoodPostComment\">) =>\n sdk.api.residentCommunication.deleteNeighborhoodPostComment(params),\n false,\n );\n}\n\nexport function deleteNeighborhoodPostReactionMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"deleteNeighborhoodPostReaction\">) =>\n sdk.api.residentCommunication.deleteNeighborhoodPostReaction(params),\n false,\n );\n}\n\nexport function putHomepageCommentReactionMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"putHomepageCommentReaction\">) =>\n sdk.api.residentCommunication.putHomepageCommentReaction(params),\n true,\n );\n}\n\nexport function putHomepagePostReactionMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"putHomepagePostReaction\">) =>\n sdk.api.residentCommunication.putHomepagePostReaction(params),\n true,\n );\n}\n\nexport function putNeighborhoodCommentReactionMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"putNeighborhoodCommentReaction\">) =>\n sdk.api.residentCommunication.putNeighborhoodCommentReaction(params),\n false,\n );\n}\n\nexport function putNeighborhoodPostReactionMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"putNeighborhoodPostReaction\">) =>\n sdk.api.residentCommunication.putNeighborhoodPostReaction(params),\n false,\n );\n}\n\nexport function updateHomepagePostCommentMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"updateHomepagePostComment\">) =>\n sdk.api.residentCommunication.updateHomepagePostComment(params),\n true,\n );\n}\n\nexport function updateHomepagePostCommentModerationStatusMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"updateHomepagePostCommentModerationStatus\">) =>\n sdk.api.residentCommunication.updateHomepagePostCommentModerationStatus(\n params,\n ),\n true,\n );\n}\n\nexport function updateHomepagePostCommentsEnabledMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"updateHomepagePostCommentsEnabled\">) =>\n sdk.api.residentCommunication.updateHomepagePostCommentsEnabled(params),\n true,\n );\n}\n\nexport function updateHomepagePostNotificationPreferenceMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"updateHomepagePostNotificationPreference\">) =>\n sdk.api.residentCommunication.updateHomepagePostNotificationPreference(\n params,\n ),\n true,\n );\n}\n\nexport function updateNeighborhoodCommonFeedFollowMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"updateNeighborhoodCommonFeedFollow\">) =>\n sdk.api.residentCommunication.updateNeighborhoodCommonFeedFollow(params),\n false,\n );\n}\n\nexport function updateNeighborhoodGroupMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"updateNeighborhoodGroup\">) =>\n sdk.api.residentCommunication.updateNeighborhoodGroup(params),\n false,\n );\n}\n\nexport function updateNeighborhoodGroupFollowMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"updateNeighborhoodGroupFollow\">) =>\n sdk.api.residentCommunication.updateNeighborhoodGroupFollow(params),\n false,\n );\n}\n\nexport function updateNeighborhoodGroupModerationStatusMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"updateNeighborhoodGroupModerationStatus\">) =>\n sdk.api.residentCommunication.updateNeighborhoodGroupModerationStatus(\n params,\n ),\n false,\n );\n}\n\nexport function updateNeighborhoodPostMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"updateNeighborhoodPost\">) =>\n sdk.api.residentCommunication.updateNeighborhoodPost(params),\n false,\n );\n}\n\nexport function updateNeighborhoodPostCommentMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"updateNeighborhoodPostComment\">) =>\n sdk.api.residentCommunication.updateNeighborhoodPostComment(params),\n false,\n );\n}\n\nexport function updateNeighborhoodPostCommentModerationStatusMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"updateNeighborhoodPostCommentModerationStatus\">) =>\n sdk.api.residentCommunication.updateNeighborhoodPostCommentModerationStatus(\n params,\n ),\n false,\n );\n}\n\nexport function updateNeighborhoodPostCommentsEnabledMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"updateNeighborhoodPostCommentsEnabled\">) =>\n sdk.api.residentCommunication.updateNeighborhoodPostCommentsEnabled(\n params,\n ),\n false,\n );\n}\n\nexport function updateNeighborhoodPostModerationStatusMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"updateNeighborhoodPostModerationStatus\">) =>\n sdk.api.residentCommunication.updateNeighborhoodPostModerationStatus(\n params,\n ),\n false,\n );\n}\n\nexport function updateNeighborhoodPostNotificationPreferenceMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return mutationOptions(\n queryClient,\n (params: Params<\"updateNeighborhoodPostNotificationPreference\">) =>\n sdk.api.residentCommunication.updateNeighborhoodPostNotificationPreference(\n params,\n ),\n false,\n );\n}\n"]}
@@ -0,0 +1,20 @@
1
+ import type { Id } from "@solibo/solibo-sdk";
2
+ import type { QueryClient } from "@tanstack/query-core";
3
+ export type ResidentSectionCacheScope = {
4
+ companyId: Id;
5
+ residentType?: string;
6
+ residentId?: Id;
7
+ personId?: Id;
8
+ organizationId?: Id;
9
+ sectionId?: Id;
10
+ parkingSpaceId?: Id;
11
+ storageRoomId?: Id;
12
+ includeParkingSpaces?: boolean;
13
+ includeStorageRooms?: boolean;
14
+ };
15
+ /**
16
+ * Invalidates company-scoped resident/section relationship data after writes.
17
+ * Specific IDs narrow detail and relationship invalidations while list views
18
+ * remain company-wide.
19
+ */
20
+ export declare function invalidateResidentSectionCaches(queryClient: QueryClient, scope: ResidentSectionCacheScope): Promise<void[]>;
@@ -0,0 +1,68 @@
1
+ import { parkingSpaceOperationKeys } from "../../queries/parkingSpaces/parkingSpaceOperations.js";
2
+ import { parkingSpaceKeys } from "../../queries/parkingSpaces/parkingSpaces.js";
3
+ import { organizationKeys } from "../../queries/organization/organizationsInCompany.js";
4
+ import { personKeys } from "../../queries/person/persons.js";
5
+ import { toKeyId } from "../../../utils/kt-bridge.js";
6
+ import { residentKeys } from "../../queries/residentsAndSections/residents.js";
7
+ import { sectionKeys } from "../../queries/residentsAndSections/sections.js";
8
+ import { storageRoomOperationKeys } from "../../queries/storageRoom/storageRoomOperations.js";
9
+ import { storageRoomKeys } from "../../queries/storageRoom/storageRooms.js";
10
+ function residentCompanyPrefix(kind, companyId) {
11
+ return [[...residentKeys.all, kind, toKeyId(companyId)]];
12
+ }
13
+ function sectionCompanyPrefix(kind, companyId) {
14
+ return [[...sectionKeys.all, kind, toKeyId(companyId)]];
15
+ }
16
+ /** Existing public query factories use their domain key as the first tuple item. */
17
+ function queryPrefix(queryKey) {
18
+ return [queryKey];
19
+ }
20
+ /**
21
+ * Invalidates company-scoped resident/section relationship data after writes.
22
+ * Specific IDs narrow detail and relationship invalidations while list views
23
+ * remain company-wide.
24
+ */
25
+ export function invalidateResidentSectionCaches(queryClient, scope) {
26
+ const keys = [
27
+ queryPrefix(residentKeys.list(scope.companyId)),
28
+ queryPrefix(sectionKeys.list(scope.companyId)),
29
+ queryPrefix([...sectionKeys.all, "search"]),
30
+ queryPrefix(sectionKeys.tagsBySection(scope.companyId)),
31
+ ];
32
+ if (scope.residentType != null && scope.residentId != null) {
33
+ keys.push(queryPrefix(residentKeys.detail(scope.companyId, scope.residentType, scope.residentId)), queryPrefix(residentKeys
34
+ .occupancy(scope.companyId, scope.residentType, scope.residentId)
35
+ .slice(0, -1)), queryPrefix(residentKeys.personalId(scope.companyId, scope.residentId)));
36
+ }
37
+ else {
38
+ keys.push(residentCompanyPrefix("detail", scope.companyId), residentCompanyPrefix("occupancy", scope.companyId));
39
+ }
40
+ if (scope.personId != null) {
41
+ keys.push(queryPrefix(personKeys.detail(scope.personId)));
42
+ }
43
+ if (scope.organizationId != null) {
44
+ keys.push(queryPrefix(organizationKeys.detail(scope.organizationId)));
45
+ }
46
+ if (scope.sectionId != null) {
47
+ keys.push(queryPrefix(sectionKeys.detail(scope.companyId, scope.sectionId)), queryPrefix(sectionKeys.occupancy(scope.companyId, scope.sectionId)), queryPrefix(sectionKeys.status(scope.companyId, scope.sectionId)), queryPrefix(sectionKeys.tags(scope.companyId, scope.sectionId)), queryPrefix(sectionKeys.tenants(scope.companyId, scope.sectionId)), queryPrefix(sectionKeys.ownershipChanges(scope.companyId, scope.sectionId)), queryPrefix(residentKeys.history(scope.companyId, scope.sectionId)), queryPrefix(sectionKeys
48
+ .loansByFraction(scope.companyId, scope.sectionId)
49
+ .slice(0, -1)));
50
+ }
51
+ else {
52
+ keys.push(sectionCompanyPrefix("detail", scope.companyId), sectionCompanyPrefix("occupancy", scope.companyId), sectionCompanyPrefix("status", scope.companyId), sectionCompanyPrefix("tags", scope.companyId), sectionCompanyPrefix("tenants", scope.companyId), sectionCompanyPrefix("ownershipChanges", scope.companyId), sectionCompanyPrefix("loansByFraction", scope.companyId), residentCompanyPrefix("history", scope.companyId));
53
+ }
54
+ if (scope.includeParkingSpaces || scope.parkingSpaceId != null) {
55
+ keys.push(queryPrefix(parkingSpaceKeys.list(scope.companyId)), parkingSpaceOperationKeys.company(scope.companyId), parkingSpaceOperationKeys.userInventoryRoot());
56
+ if (scope.parkingSpaceId != null) {
57
+ keys.push(queryPrefix(parkingSpaceKeys.detail(scope.companyId, scope.parkingSpaceId)));
58
+ }
59
+ }
60
+ if (scope.includeStorageRooms || scope.storageRoomId != null) {
61
+ keys.push(queryPrefix(storageRoomKeys.list(scope.companyId)), storageRoomOperationKeys.company(scope.companyId), storageRoomOperationKeys.userInventoryRoot());
62
+ if (scope.storageRoomId != null) {
63
+ keys.push(queryPrefix(storageRoomKeys.detail(scope.companyId, scope.storageRoomId)));
64
+ }
65
+ }
66
+ return Promise.all(keys.map((queryKey) => queryClient.invalidateQueries({ queryKey })));
67
+ }
68
+ //# sourceMappingURL=cacheInvalidation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cacheInvalidation.js","sourceRoot":"","sources":["../../../../src/api/commands/residentsAndSections/cacheInvalidation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,uDAAuD,CAAC;AAClG,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,MAAM,sDAAsD,CAAC;AACxF,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE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AK,CAAC,SAAS,CAAC,CAAC,EACnD,yBAAyB,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,EAClD,yBAAyB,CAAC,iBAAiB,EAAE,CAC9C,CAAC;QACF,IAAI,KAAK,CAAC,cAAc,IAAI,IAAI,EAAE,CAAC;YACjC,IAAI,CAAC,IAAI,CACP,WAAW,CACT,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,cAAc,CAAC,CAC/D,CACF,CAAC;QACJ,CAAC;IACH,CAAC;IAED,IAAI,KAAK,CAAC,mBAAmB,IAAI,KAAK,CAAC,aAAa,IAAI,IAAI,EAAE,CAAC;QAC7D,IAAI,CAAC,IAAI,CACP,WAAW,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,EAClD,wBAAwB,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,EACjD,wBAAwB,CAAC,iBAAiB,EAAE,CAC7C,CAAC;QACF,IAAI,KAAK,CAAC,aAAa,IAAI,IAAI,EAAE,CAAC;YAChC,IAAI,CAAC,IAAI,CACP,WAAW,CACT,eAAe,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,CAC7D,CACF,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC,GAAG,CAChB,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,WAAW,CAAC,iBAAiB,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CACpE,CAAC;AACJ,CAAC","sourcesContent":["import type { Id } from \"@solibo/solibo-sdk\";\nimport type { QueryClient, QueryKey } from \"@tanstack/query-core\";\nimport { parkingSpaceOperationKeys } from \"../../queries/parkingSpaces/parkingSpaceOperations.js\";\nimport { parkingSpaceKeys } from \"../../queries/parkingSpaces/parkingSpaces.js\";\nimport { organizationKeys } from \"../../queries/organization/organizationsInCompany.js\";\nimport { personKeys } from \"../../queries/person/persons.js\";\nimport { toKeyId } from \"../../../utils/kt-bridge.js\";\nimport { residentKeys } from \"../../queries/residentsAndSections/residents.js\";\nimport { sectionKeys } from \"../../queries/residentsAndSections/sections.js\";\nimport { storageRoomOperationKeys } from \"../../queries/storageRoom/storageRoomOperations.js\";\nimport { storageRoomKeys } from \"../../queries/storageRoom/storageRooms.js\";\n\nexport type ResidentSectionCacheScope = {\n companyId: Id;\n residentType?: string;\n residentId?: Id;\n personId?: Id;\n organizationId?: Id;\n sectionId?: Id;\n parkingSpaceId?: Id;\n storageRoomId?: Id;\n includeParkingSpaces?: boolean;\n includeStorageRooms?: boolean;\n};\n\nfunction residentCompanyPrefix(kind: string, companyId: Id): QueryKey {\n return [[...residentKeys.all, kind, toKeyId(companyId)]];\n}\n\nfunction sectionCompanyPrefix(kind: string, companyId: Id): QueryKey {\n return [[...sectionKeys.all, kind, toKeyId(companyId)]];\n}\n\n/** Existing public query factories use their domain key as the first tuple item. */\nfunction queryPrefix(queryKey: QueryKey): QueryKey {\n return [queryKey];\n}\n\n/**\n * Invalidates company-scoped resident/section relationship data after writes.\n * Specific IDs narrow detail and relationship invalidations while list views\n * remain company-wide.\n */\nexport function invalidateResidentSectionCaches(\n queryClient: QueryClient,\n scope: ResidentSectionCacheScope,\n): Promise<void[]> {\n const keys: QueryKey[] = [\n queryPrefix(residentKeys.list(scope.companyId)),\n queryPrefix(sectionKeys.list(scope.companyId)),\n queryPrefix([...sectionKeys.all, \"search\"]),\n queryPrefix(sectionKeys.tagsBySection(scope.companyId)),\n ];\n\n if (scope.residentType != null && scope.residentId != null) {\n keys.push(\n queryPrefix(\n residentKeys.detail(\n scope.companyId,\n scope.residentType,\n scope.residentId,\n ),\n ),\n queryPrefix(\n residentKeys\n .occupancy(scope.companyId, scope.residentType, scope.residentId)\n .slice(0, -1),\n ),\n queryPrefix(residentKeys.personalId(scope.companyId, scope.residentId)),\n );\n } else {\n keys.push(\n residentCompanyPrefix(\"detail\", scope.companyId),\n residentCompanyPrefix(\"occupancy\", scope.companyId),\n );\n }\n\n if (scope.personId != null) {\n keys.push(queryPrefix(personKeys.detail(scope.personId)));\n }\n if (scope.organizationId != null) {\n keys.push(queryPrefix(organizationKeys.detail(scope.organizationId)));\n }\n\n if (scope.sectionId != null) {\n keys.push(\n queryPrefix(sectionKeys.detail(scope.companyId, scope.sectionId)),\n queryPrefix(sectionKeys.occupancy(scope.companyId, scope.sectionId)),\n queryPrefix(sectionKeys.status(scope.companyId, scope.sectionId)),\n queryPrefix(sectionKeys.tags(scope.companyId, scope.sectionId)),\n queryPrefix(sectionKeys.tenants(scope.companyId, scope.sectionId)),\n queryPrefix(\n sectionKeys.ownershipChanges(scope.companyId, scope.sectionId),\n ),\n queryPrefix(residentKeys.history(scope.companyId, scope.sectionId)),\n queryPrefix(\n sectionKeys\n .loansByFraction(scope.companyId, scope.sectionId)\n .slice(0, -1),\n ),\n );\n } else {\n keys.push(\n sectionCompanyPrefix(\"detail\", scope.companyId),\n sectionCompanyPrefix(\"occupancy\", scope.companyId),\n sectionCompanyPrefix(\"status\", scope.companyId),\n sectionCompanyPrefix(\"tags\", scope.companyId),\n sectionCompanyPrefix(\"tenants\", scope.companyId),\n sectionCompanyPrefix(\"ownershipChanges\", scope.companyId),\n sectionCompanyPrefix(\"loansByFraction\", scope.companyId),\n residentCompanyPrefix(\"history\", scope.companyId),\n );\n }\n\n if (scope.includeParkingSpaces || scope.parkingSpaceId != null) {\n keys.push(\n queryPrefix(parkingSpaceKeys.list(scope.companyId)),\n parkingSpaceOperationKeys.company(scope.companyId),\n parkingSpaceOperationKeys.userInventoryRoot(),\n );\n if (scope.parkingSpaceId != null) {\n keys.push(\n queryPrefix(\n parkingSpaceKeys.detail(scope.companyId, scope.parkingSpaceId),\n ),\n );\n }\n }\n\n if (scope.includeStorageRooms || scope.storageRoomId != null) {\n keys.push(\n queryPrefix(storageRoomKeys.list(scope.companyId)),\n storageRoomOperationKeys.company(scope.companyId),\n storageRoomOperationKeys.userInventoryRoot(),\n );\n if (scope.storageRoomId != null) {\n keys.push(\n queryPrefix(\n storageRoomKeys.detail(scope.companyId, scope.storageRoomId),\n ),\n );\n }\n }\n\n return Promise.all(\n keys.map((queryKey) => queryClient.invalidateQueries({ queryKey })),\n );\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import type { Id } from "@solibo/solibo-sdk";
2
+ export declare function assertMatchingCompanyId(routeCompanyId: Id, bodyCompanyId: Id, operation: string): void;
@@ -0,0 +1,7 @@
1
+ import { canonicalQueryId } from "../../queries/residentsAndSections/queryIdentity.js";
2
+ export function assertMatchingCompanyId(routeCompanyId, bodyCompanyId, operation) {
3
+ if (canonicalQueryId(routeCompanyId) !== canonicalQueryId(bodyCompanyId)) {
4
+ throw new TypeError(`${operation} companyId mismatch: route and request body must target the same company`);
5
+ }
6
+ }
7
+ //# sourceMappingURL=companyScope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"companyScope.js","sourceRoot":"","sources":["../../../../src/api/commands/residentsAndSections/companyScope.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AAEvF,MAAM,UAAU,uBAAuB,CACrC,cAAkB,EAClB,aAAiB,EACjB,SAAiB;IAEjB,IAAI,gBAAgB,CAAC,cAAc,CAAC,KAAK,gBAAgB,CAAC,aAAa,CAAC,EAAE,CAAC;QACzE,MAAM,IAAI,SAAS,CACjB,GAAG,SAAS,0EAA0E,CACvF,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["import type { Id } from \"@solibo/solibo-sdk\";\nimport { canonicalQueryId } from \"../../queries/residentsAndSections/queryIdentity.js\";\n\nexport function assertMatchingCompanyId(\n routeCompanyId: Id,\n bodyCompanyId: Id,\n operation: string,\n): void {\n if (canonicalQueryId(routeCompanyId) !== canonicalQueryId(bodyCompanyId)) {\n throw new TypeError(\n `${operation} companyId mismatch: route and request body must target the same company`,\n );\n }\n}\n"]}
@@ -8,5 +8,5 @@ export declare function assignParkingSpaceToSectionMutationOptions(sdk: SoliboCl
8
8
  validFrom?: SoliboInstant | null;
9
9
  validTo?: SoliboInstant | null;
10
10
  }) => Promise<void>;
11
- onSuccess: (_: any, params: any) => Promise<[void, void]>;
11
+ onSuccess: (_: any, params: any) => Promise<void[]>;
12
12
  };
@@ -1,5 +1,4 @@
1
- import { parkingSpaceKeys } from "../../queries/parkingSpaces/parkingSpaces.js";
2
- import { sectionKeys } from "../../queries/residentsAndSections/sections.js";
1
+ import { invalidateResidentSectionCaches } from "../residentsAndSections/cacheInvalidation.js";
3
2
  export function assignParkingSpaceToSectionMutationOptions(sdk, queryClient) {
4
3
  return {
5
4
  mutationFn: (params) => sdk.api.parking.assignParkingSpaceToSection({
@@ -11,14 +10,11 @@ export function assignParkingSpaceToSectionMutationOptions(sdk, queryClient) {
11
10
  validTo: params.validTo ?? null,
12
11
  },
13
12
  }),
14
- onSuccess: (_, params) => Promise.all([
15
- queryClient.invalidateQueries({
16
- queryKey: [sectionKeys.list(params.companyId)],
17
- }),
18
- queryClient.invalidateQueries({
19
- queryKey: [parkingSpaceKeys.list(params.companyId)],
20
- }),
21
- ]),
13
+ onSuccess: (_, params) => invalidateResidentSectionCaches(queryClient, {
14
+ companyId: params.companyId,
15
+ sectionId: params.sectionId,
16
+ parkingSpaceId: params.parkingSpaceId,
17
+ }),
22
18
  };
23
19
  }
24
20
  //# sourceMappingURL=assignParkingSpaceToSection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"assignParkingSpaceToSection.js","sourceRoot":"","sources":["../../../../src/api/commands/section/assignParkingSpaceToSection.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,gDAAgD,CAAC;AAC7E,MAAM,UAAU,0CAA0C,CACxD,GAAiB,EACjB,WAAwB;IAExB,OAAO;QACL,UAAU,EAAE,CAAC,MAMZ,EAAE,EAAE,CACH,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,2BAA2B,CAAC;YAC1C,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,cAAc,EAAE,MAAM,CAAC,cAAc;YACrC,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,KAAK,EAAE;gBACL,SAAS,EAAE,MAAM,CAAC,SAAS,IAAI,IAAI;gBACnC,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,IAAI;aAChC;SACF,CAAC;QACJ,SAAS,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CACvB,OAAO,CAAC,GAAG,CAAC;YACV,WAAW,CAAC,iBAAiB,CAAC;gBAC5B,QAAQ,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;aAC/C,CAAC;YACF,WAAW,CAAC,iBAAiB,CAAC;gBAC5B,QAAQ,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;aACpD,CAAC;SACH,CAAC;KACL,CAAC;AACJ,CAAC","sourcesContent":["import { Id, SoliboClient, SoliboInstant } from \"@solibo/solibo-sdk\";\nimport type { QueryClient } from \"@tanstack/query-core\";\nimport { parkingSpaceKeys } from \"../../queries/parkingSpaces/parkingSpaces.js\";\nimport { sectionKeys } from \"../../queries/residentsAndSections/sections.js\";\nexport function assignParkingSpaceToSectionMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return {\n mutationFn: (params: {\n companyId: Id;\n parkingSpaceId: Id;\n sectionId: Id;\n validFrom?: SoliboInstant | null;\n validTo?: SoliboInstant | null;\n }) =>\n sdk.api.parking.assignParkingSpaceToSection({\n companyId: params.companyId,\n parkingSpaceId: params.parkingSpaceId,\n sectionId: params.sectionId,\n input: {\n validFrom: params.validFrom ?? null,\n validTo: params.validTo ?? null,\n },\n }),\n onSuccess: (_, params) =>\n Promise.all([\n queryClient.invalidateQueries({\n queryKey: [sectionKeys.list(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [parkingSpaceKeys.list(params.companyId)],\n }),\n ]),\n };\n}\n"]}
1
+ {"version":3,"file":"assignParkingSpaceToSection.js","sourceRoot":"","sources":["../../../../src/api/commands/section/assignParkingSpaceToSection.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,+BAA+B,EAAE,MAAM,8CAA8C,CAAC;AAC/F,MAAM,UAAU,0CAA0C,CACxD,GAAiB,EACjB,WAAwB;IAExB,OAAO;QACL,UAAU,EAAE,CAAC,MAMZ,EAAE,EAAE,CACH,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,2BAA2B,CAAC;YAC1C,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,cAAc,EAAE,MAAM,CAAC,cAAc;YACrC,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,KAAK,EAAE;gBACL,SAAS,EAAE,MAAM,CAAC,SAAS,IAAI,IAAI;gBACnC,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,IAAI;aAChC;SACF,CAAC;QACJ,SAAS,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CACvB,+BAA+B,CAAC,WAAW,EAAE;YAC3C,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,cAAc,EAAE,MAAM,CAAC,cAAc;SACtC,CAAC;KACL,CAAC;AACJ,CAAC","sourcesContent":["import { Id, SoliboClient, SoliboInstant } from \"@solibo/solibo-sdk\";\nimport type { QueryClient } from \"@tanstack/query-core\";\nimport { invalidateResidentSectionCaches } from \"../residentsAndSections/cacheInvalidation.js\";\nexport function assignParkingSpaceToSectionMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return {\n mutationFn: (params: {\n companyId: Id;\n parkingSpaceId: Id;\n sectionId: Id;\n validFrom?: SoliboInstant | null;\n validTo?: SoliboInstant | null;\n }) =>\n sdk.api.parking.assignParkingSpaceToSection({\n companyId: params.companyId,\n parkingSpaceId: params.parkingSpaceId,\n sectionId: params.sectionId,\n input: {\n validFrom: params.validFrom ?? null,\n validTo: params.validTo ?? null,\n },\n }),\n onSuccess: (_, params) =>\n invalidateResidentSectionCaches(queryClient, {\n companyId: params.companyId,\n sectionId: params.sectionId,\n parkingSpaceId: params.parkingSpaceId,\n }),\n };\n}\n"]}
@@ -8,5 +8,5 @@ export declare function assignStorageRoomToSectionMutationOptions(sdk: SoliboCli
8
8
  validFrom?: SoliboInstant | null;
9
9
  validTo?: SoliboInstant | null;
10
10
  }) => Promise<void>;
11
- onSuccess: (_: any, params: any) => Promise<[void, void]>;
11
+ onSuccess: (_: any, params: any) => Promise<void[]>;
12
12
  };
@@ -1,5 +1,4 @@
1
- import { sectionKeys } from "../../queries/residentsAndSections/sections.js";
2
- import { storageRoomKeys } from "../../queries/storageRoom/storageRooms.js";
1
+ import { invalidateResidentSectionCaches } from "../residentsAndSections/cacheInvalidation.js";
3
2
  export function assignStorageRoomToSectionMutationOptions(sdk, queryClient) {
4
3
  return {
5
4
  mutationFn: (params) => sdk.api.storage.assignStorageRoomToSection({
@@ -11,14 +10,11 @@ export function assignStorageRoomToSectionMutationOptions(sdk, queryClient) {
11
10
  validTo: params.validTo ?? null,
12
11
  },
13
12
  }),
14
- onSuccess: (_, params) => Promise.all([
15
- queryClient.invalidateQueries({
16
- queryKey: [sectionKeys.list(params.companyId)],
17
- }),
18
- queryClient.invalidateQueries({
19
- queryKey: [storageRoomKeys.list(params.companyId)],
20
- }),
21
- ]),
13
+ onSuccess: (_, params) => invalidateResidentSectionCaches(queryClient, {
14
+ companyId: params.companyId,
15
+ sectionId: params.sectionId,
16
+ storageRoomId: params.storageRoomId,
17
+ }),
22
18
  };
23
19
  }
24
20
  //# sourceMappingURL=assignStorageRoomToSection.js.map