@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.
- package/dist/api/commands/communication/buySMSBundle.d.ts +1 -1
- package/dist/api/commands/communication/buySMSBundle.js +8 -3
- package/dist/api/commands/communication/buySMSBundle.js.map +1 -1
- package/dist/api/commands/company/saveCompanyDetailed.d.ts +1 -1
- package/dist/api/commands/company/saveCompanyDetailed.js +3 -0
- package/dist/api/commands/company/saveCompanyDetailed.js.map +1 -1
- package/dist/api/commands/company/saveImportDraft.d.ts +1 -1
- package/dist/api/commands/company/saveImportDraft.js +3 -0
- package/dist/api/commands/company/saveImportDraft.js.map +1 -1
- package/dist/api/commands/company/updateCompanyDetailed.d.ts +1 -1
- package/dist/api/commands/company/updateCompanyDetailed.js +6 -0
- package/dist/api/commands/company/updateCompanyDetailed.js.map +1 -1
- package/dist/api/commands/conversation/markConversationRead.d.ts +1 -1
- package/dist/api/commands/conversation/markConversationRead.js +15 -0
- package/dist/api/commands/conversation/markConversationRead.js.map +1 -1
- package/dist/api/commands/document/createDocumentReference.js +27 -0
- package/dist/api/commands/document/createDocumentReference.js.map +1 -1
- package/dist/api/commands/document/deleteDocument.d.ts +1 -1
- package/dist/api/commands/document/deleteDocument.js +26 -3
- package/dist/api/commands/document/deleteDocument.js.map +1 -1
- package/dist/api/commands/document/integratedDocumentMutations.d.ts +4 -4
- package/dist/api/commands/document/integratedDocumentMutations.js +23 -8
- package/dist/api/commands/document/integratedDocumentMutations.js.map +1 -1
- package/dist/api/commands/document/uploadDocument.js +45 -18
- package/dist/api/commands/document/uploadDocument.js.map +1 -1
- package/dist/api/commands/expense/approveExpense.d.ts +1 -1
- package/dist/api/commands/expense/approveExpense.js +12 -3
- package/dist/api/commands/expense/approveExpense.js.map +1 -1
- package/dist/api/commands/expense/createExpense.d.ts +1 -1
- package/dist/api/commands/expense/createExpense.js +4 -0
- package/dist/api/commands/expense/createExpense.js.map +1 -1
- package/dist/api/commands/expense/deleteExpense.d.ts +1 -1
- package/dist/api/commands/expense/deleteExpense.js +12 -3
- package/dist/api/commands/expense/deleteExpense.js.map +1 -1
- package/dist/api/commands/expense/rejectExpense.d.ts +1 -1
- package/dist/api/commands/expense/rejectExpense.js +12 -3
- package/dist/api/commands/expense/rejectExpense.js.map +1 -1
- package/dist/api/commands/homepage/createPost.d.ts +1 -1
- package/dist/api/commands/homepage/createPost.js +6 -0
- package/dist/api/commands/homepage/createPost.js.map +1 -1
- package/dist/api/commands/homepage/createPracticalInfo.d.ts +1 -1
- package/dist/api/commands/homepage/createPracticalInfo.js +11 -3
- package/dist/api/commands/homepage/createPracticalInfo.js.map +1 -1
- package/dist/api/commands/homepage/deletePost.d.ts +1 -1
- package/dist/api/commands/homepage/deletePost.js +14 -0
- package/dist/api/commands/homepage/deletePost.js.map +1 -1
- package/dist/api/commands/homepage/deletePracticalInfo.d.ts +1 -1
- package/dist/api/commands/homepage/deletePracticalInfo.js +16 -3
- package/dist/api/commands/homepage/deletePracticalInfo.js.map +1 -1
- package/dist/api/commands/homepage/updateFeedWeighting.d.ts +1 -1
- package/dist/api/commands/homepage/updateFeedWeighting.js +20 -3
- package/dist/api/commands/homepage/updateFeedWeighting.js.map +1 -1
- package/dist/api/commands/homepage/updatePost.d.ts +1 -1
- package/dist/api/commands/homepage/updatePost.js +9 -0
- package/dist/api/commands/homepage/updatePost.js.map +1 -1
- package/dist/api/commands/homepage/updatePracticalInfo.d.ts +1 -1
- package/dist/api/commands/homepage/updatePracticalInfo.js +16 -3
- package/dist/api/commands/homepage/updatePracticalInfo.js.map +1 -1
- package/dist/api/commands/invoicing/directSendInvoice.d.ts +9 -0
- package/dist/api/commands/invoicing/directSendInvoice.js +11 -0
- package/dist/api/commands/invoicing/directSendInvoice.js.map +1 -0
- package/dist/api/commands/issue/changeResponsible.d.ts +2 -2
- package/dist/api/commands/issue/changeResponsible.js +2 -0
- package/dist/api/commands/issue/changeResponsible.js.map +1 -1
- package/dist/api/commands/issue/closeIssue.d.ts +1 -1
- package/dist/api/commands/issue/closeIssue.js +1 -0
- package/dist/api/commands/issue/closeIssue.js.map +1 -1
- package/dist/api/commands/issue/createConversationToIssue.d.ts +1 -1
- package/dist/api/commands/issue/createConversationToIssue.js +1 -0
- package/dist/api/commands/issue/createConversationToIssue.js.map +1 -1
- package/dist/api/commands/issue/createIssue.d.ts +1 -1
- package/dist/api/commands/issue/createIssue.js +1 -0
- package/dist/api/commands/issue/createIssue.js.map +1 -1
- package/dist/api/commands/issue/createIssueToMeeting.d.ts +2 -2
- package/dist/api/commands/issue/createIssueToMeeting.js +2 -0
- package/dist/api/commands/issue/createIssueToMeeting.js.map +1 -1
- package/dist/api/commands/issue/createSectionToIssue.d.ts +1 -1
- package/dist/api/commands/issue/createSectionToIssue.js +1 -0
- package/dist/api/commands/issue/createSectionToIssue.js.map +1 -1
- package/dist/api/commands/issue/deleteSectionFromIssue.d.ts +1 -1
- package/dist/api/commands/issue/deleteSectionFromIssue.js +1 -0
- package/dist/api/commands/issue/deleteSectionFromIssue.js.map +1 -1
- package/dist/api/commands/issue/reOpenIssue.d.ts +1 -1
- package/dist/api/commands/issue/reOpenIssue.js +1 -0
- package/dist/api/commands/issue/reOpenIssue.js.map +1 -1
- package/dist/api/commands/issue/removeConversationFromIssue.d.ts +1 -1
- package/dist/api/commands/issue/removeConversationFromIssue.js +1 -0
- package/dist/api/commands/issue/removeConversationFromIssue.js.map +1 -1
- package/dist/api/commands/issue/removeIssueFromMeeting.d.ts +2 -2
- package/dist/api/commands/issue/removeIssueFromMeeting.js +2 -0
- package/dist/api/commands/issue/removeIssueFromMeeting.js.map +1 -1
- package/dist/api/commands/issue/updateIssue.d.ts +2 -2
- package/dist/api/commands/issue/updateIssue.js +2 -0
- package/dist/api/commands/issue/updateIssue.js.map +1 -1
- package/dist/api/commands/loan/deleteLoan.d.ts +1 -1
- package/dist/api/commands/loan/deleteLoan.js +16 -3
- package/dist/api/commands/loan/deleteLoan.js.map +1 -1
- package/dist/api/commands/loan/setMainDocumentId.d.ts +1 -1
- package/dist/api/commands/loan/setMainDocumentId.js +11 -3
- package/dist/api/commands/loan/setMainDocumentId.js.map +1 -1
- package/dist/api/commands/loan/updateLoan.d.ts +5 -5
- package/dist/api/commands/loan/updateLoan.js +55 -11
- package/dist/api/commands/loan/updateLoan.js.map +1 -1
- package/dist/api/commands/organization/assignParkingSpaceToOrganization.d.ts +1 -1
- package/dist/api/commands/organization/assignParkingSpaceToOrganization.js +9 -10
- package/dist/api/commands/organization/assignParkingSpaceToOrganization.js.map +1 -1
- package/dist/api/commands/organization/assignStorageRoomToOrganization.d.ts +1 -1
- package/dist/api/commands/organization/assignStorageRoomToOrganization.js +9 -10
- package/dist/api/commands/organization/assignStorageRoomToOrganization.js.map +1 -1
- package/dist/api/commands/organization/unAssignParkingSpaceToOrganization.d.ts +1 -1
- package/dist/api/commands/organization/unAssignParkingSpaceToOrganization.js +9 -10
- package/dist/api/commands/organization/unAssignParkingSpaceToOrganization.js.map +1 -1
- package/dist/api/commands/organization/unAssignStorageRoomToOrganization.d.ts +1 -1
- package/dist/api/commands/organization/unAssignStorageRoomToOrganization.js +9 -10
- package/dist/api/commands/organization/unAssignStorageRoomToOrganization.js.map +1 -1
- package/dist/api/commands/parkingSpaces/createParkingSpace.d.ts +1 -1
- package/dist/api/commands/parkingSpaces/createParkingSpace.js +4 -3
- package/dist/api/commands/parkingSpaces/createParkingSpace.js.map +1 -1
- package/dist/api/commands/parkingSpaces/deleteParkingSpace.d.ts +1 -1
- package/dist/api/commands/parkingSpaces/deleteParkingSpace.js +5 -14
- package/dist/api/commands/parkingSpaces/deleteParkingSpace.js.map +1 -1
- package/dist/api/commands/parkingSpaces/updateParkingSpace.d.ts +1 -1
- package/dist/api/commands/parkingSpaces/updateParkingSpace.js +4 -3
- package/dist/api/commands/parkingSpaces/updateParkingSpace.js.map +1 -1
- package/dist/api/commands/person/assignParkingSpaceToPerson.d.ts +1 -1
- package/dist/api/commands/person/assignParkingSpaceToPerson.js +9 -10
- package/dist/api/commands/person/assignParkingSpaceToPerson.js.map +1 -1
- package/dist/api/commands/person/assignStorageRoomToPerson.d.ts +1 -1
- package/dist/api/commands/person/assignStorageRoomToPerson.js +9 -10
- package/dist/api/commands/person/assignStorageRoomToPerson.js.map +1 -1
- package/dist/api/commands/person/unAssignParkingSpaceToPerson.d.ts +1 -1
- package/dist/api/commands/person/unAssignParkingSpaceToPerson.js +9 -10
- package/dist/api/commands/person/unAssignParkingSpaceToPerson.js.map +1 -1
- package/dist/api/commands/person/unAssignStorageRoomToPerson.d.ts +1 -1
- package/dist/api/commands/person/unAssignStorageRoomToPerson.js +9 -10
- package/dist/api/commands/person/unAssignStorageRoomToPerson.js.map +1 -1
- package/dist/api/commands/resident/createOccupancyRecord.d.ts +1 -1
- package/dist/api/commands/resident/createOccupancyRecord.js +7 -15
- package/dist/api/commands/resident/createOccupancyRecord.js.map +1 -1
- package/dist/api/commands/resident/createResident.d.ts +6 -1
- package/dist/api/commands/resident/createResident.js +11 -0
- package/dist/api/commands/resident/createResident.js.map +1 -1
- package/dist/api/commands/resident/deleteOccupancyRecord.d.ts +1 -1
- package/dist/api/commands/resident/deleteOccupancyRecord.js +7 -15
- package/dist/api/commands/resident/deleteOccupancyRecord.js.map +1 -1
- package/dist/api/commands/resident/residentActions.d.ts +18 -2
- package/dist/api/commands/resident/residentActions.js +17 -3
- package/dist/api/commands/resident/residentActions.js.map +1 -1
- package/dist/api/commands/resident/typedResidentMutations.d.ts +36 -0
- package/dist/api/commands/resident/typedResidentMutations.js +63 -0
- package/dist/api/commands/resident/typedResidentMutations.js.map +1 -0
- package/dist/api/commands/resident/updateOccupancyRecord.d.ts +1 -1
- package/dist/api/commands/resident/updateOccupancyRecord.js +7 -15
- package/dist/api/commands/resident/updateOccupancyRecord.js.map +1 -1
- package/dist/api/commands/resident/updateOrganizationReservations.js +8 -4
- package/dist/api/commands/resident/updateOrganizationReservations.js.map +1 -1
- package/dist/api/commands/resident/updateResident.d.ts +6 -1
- package/dist/api/commands/resident/updateResident.js +11 -0
- package/dist/api/commands/resident/updateResident.js.map +1 -1
- package/dist/api/commands/residentCommunication/residentCommunicationMutations.js +9 -0
- package/dist/api/commands/residentCommunication/residentCommunicationMutations.js.map +1 -1
- package/dist/api/commands/residentsAndSections/cacheInvalidation.d.ts +20 -0
- package/dist/api/commands/residentsAndSections/cacheInvalidation.js +68 -0
- package/dist/api/commands/residentsAndSections/cacheInvalidation.js.map +1 -0
- package/dist/api/commands/residentsAndSections/companyScope.d.ts +2 -0
- package/dist/api/commands/residentsAndSections/companyScope.js +7 -0
- package/dist/api/commands/residentsAndSections/companyScope.js.map +1 -0
- package/dist/api/commands/section/assignParkingSpaceToSection.d.ts +1 -1
- package/dist/api/commands/section/assignParkingSpaceToSection.js +6 -10
- package/dist/api/commands/section/assignParkingSpaceToSection.js.map +1 -1
- package/dist/api/commands/section/assignStorageRoomToSection.d.ts +1 -1
- package/dist/api/commands/section/assignStorageRoomToSection.js +6 -10
- package/dist/api/commands/section/assignStorageRoomToSection.js.map +1 -1
- package/dist/api/commands/section/createSection.d.ts +2 -2
- package/dist/api/commands/section/createSection.js +13 -5
- package/dist/api/commands/section/createSection.js.map +1 -1
- package/dist/api/commands/section/createSubSection.d.ts +2 -2
- package/dist/api/commands/section/createSubSection.js +14 -5
- package/dist/api/commands/section/createSubSection.js.map +1 -1
- package/dist/api/commands/section/deleteSection.d.ts +1 -1
- package/dist/api/commands/section/deleteSection.js +7 -0
- package/dist/api/commands/section/deleteSection.js.map +1 -1
- package/dist/api/commands/section/massUpdateSection.d.ts +1 -1
- package/dist/api/commands/section/massUpdateSection.js +16 -4
- package/dist/api/commands/section/massUpdateSection.js.map +1 -1
- package/dist/api/commands/section/ownershipChangeMutations.d.ts +12 -0
- package/dist/api/commands/section/ownershipChangeMutations.js +46 -0
- package/dist/api/commands/section/ownershipChangeMutations.js.map +1 -0
- package/dist/api/commands/section/ownershipTransferSection.d.ts +1 -1
- package/dist/api/commands/section/ownershipTransferSection.js +5 -0
- package/dist/api/commands/section/ownershipTransferSection.js.map +1 -1
- package/dist/api/commands/section/sectionMappers.d.ts +4 -0
- package/dist/api/commands/section/sectionMappers.js +68 -0
- package/dist/api/commands/section/sectionMappers.js.map +1 -0
- package/dist/api/commands/section/sectionStructureMutations.d.ts +12 -0
- package/dist/api/commands/section/sectionStructureMutations.js +46 -0
- package/dist/api/commands/section/sectionStructureMutations.js.map +1 -0
- package/dist/api/commands/section/tagOnSection.d.ts +2 -2
- package/dist/api/commands/section/tagOnSection.js +6 -0
- package/dist/api/commands/section/tagOnSection.js.map +1 -1
- package/dist/api/commands/section/unAssignParkingSpaceToSection.d.ts +1 -1
- package/dist/api/commands/section/unAssignParkingSpaceToSection.js +6 -10
- package/dist/api/commands/section/unAssignParkingSpaceToSection.js.map +1 -1
- package/dist/api/commands/section/unAssignStorageRoomToSection.d.ts +1 -1
- package/dist/api/commands/section/unAssignStorageRoomToSection.js +6 -10
- package/dist/api/commands/section/unAssignStorageRoomToSection.js.map +1 -1
- package/dist/api/commands/section/updateSection.d.ts +1 -1
- package/dist/api/commands/section/updateSection.js +16 -5
- package/dist/api/commands/section/updateSection.js.map +1 -1
- package/dist/api/commands/section/updateTagsOnSection.d.ts +1 -1
- package/dist/api/commands/section/updateTagsOnSection.js +3 -0
- package/dist/api/commands/section/updateTagsOnSection.js.map +1 -1
- package/dist/api/commands/settlement/updateSettlementProviderConfiguration.d.ts +1 -1
- package/dist/api/commands/settlement/updateSettlementProviderConfiguration.js +9 -4
- package/dist/api/commands/settlement/updateSettlementProviderConfiguration.js.map +1 -1
- package/dist/api/commands/settlement/upsertSettlementProviderCredentials.d.ts +1 -1
- package/dist/api/commands/settlement/upsertSettlementProviderCredentials.js +8 -3
- package/dist/api/commands/settlement/upsertSettlementProviderCredentials.js.map +1 -1
- package/dist/api/commands/storageRoom/createStorageRoom.d.ts +1 -1
- package/dist/api/commands/storageRoom/createStorageRoom.js +4 -3
- package/dist/api/commands/storageRoom/createStorageRoom.js.map +1 -1
- package/dist/api/commands/storageRoom/deleteStorageRoom.d.ts +1 -1
- package/dist/api/commands/storageRoom/deleteStorageRoom.js +5 -14
- package/dist/api/commands/storageRoom/deleteStorageRoom.js.map +1 -1
- package/dist/api/commands/storageRoom/updateStorageRoom.d.ts +1 -1
- package/dist/api/commands/storageRoom/updateStorageRoom.js +4 -3
- package/dist/api/commands/storageRoom/updateStorageRoom.js.map +1 -1
- package/dist/api/commands/user/deleteProfilePicture.d.ts +1 -1
- package/dist/api/commands/user/deleteProfilePicture.js +3 -0
- package/dist/api/commands/user/deleteProfilePicture.js.map +1 -1
- package/dist/api/commands/user/fCMDevice.d.ts +5 -2
- package/dist/api/commands/user/fCMDevice.js +5 -2
- package/dist/api/commands/user/fCMDevice.js.map +1 -1
- package/dist/api/commands/user/updateUser.d.ts +1 -1
- package/dist/api/commands/user/updateUser.js +8 -3
- package/dist/api/commands/user/updateUser.js.map +1 -1
- package/dist/api/commands/user/uploadProfilePicture.d.ts +1 -1
- package/dist/api/commands/user/uploadProfilePicture.js +8 -3
- package/dist/api/commands/user/uploadProfilePicture.js.map +1 -1
- package/dist/api/queries/document/documents.js +2 -1
- package/dist/api/queries/document/documents.js.map +1 -1
- package/dist/api/queries/homepage/homepage.js +7 -6
- package/dist/api/queries/homepage/homepage.js.map +1 -1
- package/dist/api/queries/invoicing/customerInvoices.d.ts +1 -1
- package/dist/api/queries/invoicing/customerInvoices.js +1 -1
- package/dist/api/queries/invoicing/customerInvoices.js.map +1 -1
- package/dist/api/queries/invoicing/customerMetadata.d.ts +1 -1
- package/dist/api/queries/invoicing/customerMetadata.js +1 -1
- package/dist/api/queries/invoicing/customerMetadata.js.map +1 -1
- package/dist/api/queries/invoicing/customerRecipient.d.ts +1 -1
- package/dist/api/queries/invoicing/customerRecipient.js +1 -1
- package/dist/api/queries/invoicing/customerRecipient.js.map +1 -1
- package/dist/api/queries/invoicing/invoicingKeys.js +34 -27
- package/dist/api/queries/invoicing/invoicingKeys.js.map +1 -1
- package/dist/api/queries/invoicing/sectionInvoices.d.ts +1 -1
- package/dist/api/queries/invoicing/sectionInvoices.js +1 -1
- package/dist/api/queries/invoicing/sectionInvoices.js.map +1 -1
- package/dist/api/queries/organization/organization.d.ts +15 -7
- package/dist/api/queries/organization/organization.js +8 -9
- package/dist/api/queries/organization/organization.js.map +1 -1
- package/dist/api/queries/parkingSpaces/parkingSpaceOperations.d.ts +744 -0
- package/dist/api/queries/parkingSpaces/parkingSpaceOperations.js +115 -0
- package/dist/api/queries/parkingSpaces/parkingSpaceOperations.js.map +1 -0
- package/dist/api/queries/parkingSpaces/parkingSpaces.d.ts +1 -1
- package/dist/api/queries/parkingSpaces/parkingSpaces.js +5 -1
- package/dist/api/queries/parkingSpaces/parkingSpaces.js.map +1 -1
- package/dist/api/queries/person/person.d.ts +19 -7
- package/dist/api/queries/person/person.js +9 -10
- package/dist/api/queries/person/person.js.map +1 -1
- package/dist/api/queries/residentsAndSections/domain.d.ts +24 -1
- package/dist/api/queries/residentsAndSections/domain.js +21 -1
- package/dist/api/queries/residentsAndSections/domain.js.map +1 -1
- package/dist/api/queries/residentsAndSections/queryIdentity.d.ts +11 -0
- package/dist/api/queries/residentsAndSections/queryIdentity.js +14 -0
- package/dist/api/queries/residentsAndSections/queryIdentity.js.map +1 -0
- package/dist/api/queries/residentsAndSections/residents.d.ts +47 -6
- package/dist/api/queries/residentsAndSections/residents.js +77 -1
- package/dist/api/queries/residentsAndSections/residents.js.map +1 -1
- package/dist/api/queries/residentsAndSections/sections.d.ts +19 -6
- package/dist/api/queries/residentsAndSections/sections.js +26 -1
- package/dist/api/queries/residentsAndSections/sections.js.map +1 -1
- package/dist/api/queries/residentsAndSections/sectionsSearch.d.ts +8 -7
- package/dist/api/queries/residentsAndSections/sectionsSearch.js +9 -3
- package/dist/api/queries/residentsAndSections/sectionsSearch.js.map +1 -1
- package/dist/api/queries/storageRoom/storageRoomOperations.d.ts +728 -0
- package/dist/api/queries/storageRoom/storageRoomOperations.js +106 -0
- package/dist/api/queries/storageRoom/storageRoomOperations.js.map +1 -0
- package/dist/api/queries/storageRoom/storageRooms.d.ts +1 -1
- package/dist/api/queries/storageRoom/storageRooms.js +5 -1
- package/dist/api/queries/storageRoom/storageRooms.js.map +1 -1
- package/dist/api/queries/supplier/suppliers.js +3 -2
- package/dist/api/queries/supplier/suppliers.js.map +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/pageUtils.d.ts +2 -2
- package/dist/utils/pageUtils.js.map +1 -1
- package/dist/utils/queryKeys.d.ts +1 -0
- package/dist/utils/queryKeys.js +8 -0
- package/dist/utils/queryKeys.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { minutes } from "../../../utils/dateTime.js";
|
|
2
|
+
import { nextPageParam, prevPageParam } from "../../../utils/pageUtils.js";
|
|
3
|
+
import { canonicalQueryId, canonicalQueryIds, paginationIdentity, } from "../residentsAndSections/queryIdentity.js";
|
|
4
|
+
function enumIdentity(value) {
|
|
5
|
+
if (typeof value === "string")
|
|
6
|
+
return value;
|
|
7
|
+
return value.value;
|
|
8
|
+
}
|
|
9
|
+
function hasId(value) {
|
|
10
|
+
return value != null && String(value).length > 0;
|
|
11
|
+
}
|
|
12
|
+
export const parkingSpaceOperationKeys = {
|
|
13
|
+
all: ["parkingSpace", "operations"],
|
|
14
|
+
userInventoryRoot: () => [...parkingSpaceOperationKeys.all, "userInventory"],
|
|
15
|
+
userInventory: (params = {}) => {
|
|
16
|
+
const pagination = paginationIdentity(params);
|
|
17
|
+
return [
|
|
18
|
+
...parkingSpaceOperationKeys.userInventoryRoot(),
|
|
19
|
+
{
|
|
20
|
+
companyIds: canonicalQueryIds(params.companyIds),
|
|
21
|
+
search: params.search,
|
|
22
|
+
type: params.type?.map(enumIdentity),
|
|
23
|
+
charger: params.charger,
|
|
24
|
+
assigned: params.assigned,
|
|
25
|
+
fields: params.fields ?? undefined,
|
|
26
|
+
count: params.count,
|
|
27
|
+
pageToken: pagination.pageToken,
|
|
28
|
+
autoPaginate: pagination.autoPaginate,
|
|
29
|
+
},
|
|
30
|
+
];
|
|
31
|
+
},
|
|
32
|
+
company: (companyId) => [
|
|
33
|
+
...parkingSpaceOperationKeys.all,
|
|
34
|
+
"company",
|
|
35
|
+
canonicalQueryId(companyId),
|
|
36
|
+
],
|
|
37
|
+
vacancy: (companyId, parkingSpaceId, searchDate, fields) => [
|
|
38
|
+
...parkingSpaceOperationKeys.company(companyId),
|
|
39
|
+
"vacancy",
|
|
40
|
+
canonicalQueryId(parkingSpaceId),
|
|
41
|
+
canonicalQueryId(searchDate),
|
|
42
|
+
fields ?? undefined,
|
|
43
|
+
],
|
|
44
|
+
allocationOverview: (companyId, searchDate, fields) => [
|
|
45
|
+
...parkingSpaceOperationKeys.company(companyId),
|
|
46
|
+
"allocationOverview",
|
|
47
|
+
canonicalQueryId(searchDate),
|
|
48
|
+
fields ?? undefined,
|
|
49
|
+
],
|
|
50
|
+
vacant: (companyId, searchDate, fields) => [
|
|
51
|
+
...parkingSpaceOperationKeys.company(companyId),
|
|
52
|
+
"vacant",
|
|
53
|
+
canonicalQueryId(searchDate),
|
|
54
|
+
fields ?? undefined,
|
|
55
|
+
],
|
|
56
|
+
};
|
|
57
|
+
export function userParkingSpacesQueryOptions(sdk, params = {}) {
|
|
58
|
+
const pagination = paginationIdentity(params);
|
|
59
|
+
return {
|
|
60
|
+
initialPageParam: pagination.pageToken,
|
|
61
|
+
queryKey: parkingSpaceOperationKeys.userInventory(params),
|
|
62
|
+
queryFn: ({ pageParam }) => sdk.api.parking.indexParkingSpacesUser({
|
|
63
|
+
companyIds: params.companyIds,
|
|
64
|
+
search: params.search,
|
|
65
|
+
type: params.type,
|
|
66
|
+
charger: params.charger,
|
|
67
|
+
assigned: params.assigned,
|
|
68
|
+
fields: params.fields ?? undefined,
|
|
69
|
+
pageToken: pageParam,
|
|
70
|
+
autoPaginate: pagination.autoPaginate,
|
|
71
|
+
count: params.count,
|
|
72
|
+
}),
|
|
73
|
+
staleTime: minutes(20),
|
|
74
|
+
getNextPageParam: nextPageParam,
|
|
75
|
+
getPreviousPageParam: prevPageParam,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
export function parkingSpaceVacancyQueryOptions(sdk, params) {
|
|
79
|
+
return {
|
|
80
|
+
queryKey: parkingSpaceOperationKeys.vacancy(params.companyId, params.parkingSpaceId, params.searchDate, params.fields),
|
|
81
|
+
queryFn: () => sdk.api.parking.parkingSpaceVacancy({
|
|
82
|
+
companyId: params.companyId,
|
|
83
|
+
parkingSpaceId: params.parkingSpaceId,
|
|
84
|
+
searchDate: params.searchDate,
|
|
85
|
+
fields: params.fields ?? undefined,
|
|
86
|
+
}),
|
|
87
|
+
enabled: hasId(params.companyId) && hasId(params.parkingSpaceId),
|
|
88
|
+
staleTime: params.searchDate == null ? 0 : minutes(20),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
export function parkingSpaceAllocationOverviewQueryOptions(sdk, params) {
|
|
92
|
+
return {
|
|
93
|
+
queryKey: parkingSpaceOperationKeys.allocationOverview(params.companyId, params.searchDate, params.fields),
|
|
94
|
+
queryFn: () => sdk.api.parking.parkingSpaceAllocationOverview({
|
|
95
|
+
companyId: params.companyId,
|
|
96
|
+
searchDate: params.searchDate,
|
|
97
|
+
fields: params.fields,
|
|
98
|
+
}),
|
|
99
|
+
enabled: hasId(params.companyId),
|
|
100
|
+
staleTime: params.searchDate == null ? 0 : minutes(20),
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
export function vacantParkingSpacesQueryOptions(sdk, params) {
|
|
104
|
+
return {
|
|
105
|
+
queryKey: parkingSpaceOperationKeys.vacant(params.companyId, params.searchDate, params.fields),
|
|
106
|
+
queryFn: () => sdk.api.parking.listVacantParkingSpaces({
|
|
107
|
+
companyId: params.companyId,
|
|
108
|
+
searchDate: params.searchDate,
|
|
109
|
+
fields: params.fields,
|
|
110
|
+
}),
|
|
111
|
+
enabled: hasId(params.companyId),
|
|
112
|
+
staleTime: params.searchDate == null ? 0 : minutes(20),
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=parkingSpaceOperations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parkingSpaceOperations.js","sourceRoot":"","sources":["../../../../src/api/queries/parkingSpaces/parkingSpaceOperations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,0CAA0C,CAAC;AAoBlD,SAAS,YAAY,CAAC,KAA4B;IAChD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,OAAO,KAAK,CAAC,KAAK,CAAC;AACrB,CAAC;AAED,SAAS,KAAK,CAAC,KAA4B;IACzC,OAAO,KAAK,IAAI,IAAI,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;AACnD,CAAC;AAED,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,GAAG,EAAE,CAAC,cAAc,EAAE,YAAY,CAAU;IAC5C,iBAAiB,EAAE,GAAG,EAAE,CACtB,CAAC,GAAG,yBAAyB,CAAC,GAAG,EAAE,eAAe,CAAU;IAC9D,aAAa,EAAE,CAAC,SAAuC,EAAE,EAAE,EAAE;QAC3D,MAAM,UAAU,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC;QAC9C,OAAO;YACL,GAAG,yBAAyB,CAAC,iBAAiB,EAAE;YAChD;gBACE,UAAU,EAAE,iBAAiB,CAAC,MAAM,CAAC,UAAU,CAAC;gBAChD,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,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AC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;KACvD,CAAC;AACJ,CAAC","sourcesContent":["import { type Id, type SoliboClient } from \"@solibo/solibo-sdk\";\nimport { minutes } from \"../../../utils/dateTime.js\";\nimport { nextPageParam, prevPageParam } from \"../../../utils/pageUtils.js\";\nimport {\n canonicalQueryId,\n canonicalQueryIds,\n paginationIdentity,\n} from \"../residentsAndSections/queryIdentity.js\";\n\nexport type UserParkingSpacesQueryParams = Parameters<\n SoliboClient[\"api\"][\"parking\"][\"indexParkingSpacesUser\"]\n>[0];\n\nexport type ParkingSpaceTemporalQueryParams = Partial<\n Parameters<\n SoliboClient[\"api\"][\"parking\"][\"parkingSpaceAllocationOverview\"]\n >[0]\n>;\n\nexport type ParkingSpaceVacancyQueryParams = Partial<\n Parameters<SoliboClient[\"api\"][\"parking\"][\"parkingSpaceVacancy\"]>[0]\n>;\n\ntype ParkingSpaceTypeInput = NonNullable<\n UserParkingSpacesQueryParams[\"type\"]\n>[number];\n\nfunction enumIdentity(value: ParkingSpaceTypeInput): string {\n if (typeof value === \"string\") return value;\n return value.value;\n}\n\nfunction hasId(value: Id | null | undefined): value is Id {\n return value != null && String(value).length > 0;\n}\n\nexport const parkingSpaceOperationKeys = {\n all: [\"parkingSpace\", \"operations\"] as const,\n userInventoryRoot: () =>\n [...parkingSpaceOperationKeys.all, \"userInventory\"] as const,\n userInventory: (params: UserParkingSpacesQueryParams = {}) => {\n const pagination = paginationIdentity(params);\n return [\n ...parkingSpaceOperationKeys.userInventoryRoot(),\n {\n companyIds: canonicalQueryIds(params.companyIds),\n search: params.search,\n type: params.type?.map(enumIdentity),\n charger: params.charger,\n assigned: params.assigned,\n fields: params.fields ?? undefined,\n count: params.count,\n pageToken: pagination.pageToken,\n autoPaginate: pagination.autoPaginate,\n },\n ] as const;\n },\n company: (companyId?: Id | null) =>\n [\n ...parkingSpaceOperationKeys.all,\n \"company\",\n canonicalQueryId(companyId),\n ] as const,\n vacancy: (\n companyId?: Id | null,\n parkingSpaceId?: Id | null,\n searchDate?: Id | null,\n fields?: string | null,\n ) =>\n [\n ...parkingSpaceOperationKeys.company(companyId),\n \"vacancy\",\n canonicalQueryId(parkingSpaceId),\n canonicalQueryId(searchDate),\n fields ?? undefined,\n ] as const,\n allocationOverview: (\n companyId?: Id | null,\n searchDate?: Id | null,\n fields?: string | null,\n ) =>\n [\n ...parkingSpaceOperationKeys.company(companyId),\n \"allocationOverview\",\n canonicalQueryId(searchDate),\n fields ?? undefined,\n ] as const,\n vacant: (\n companyId?: Id | null,\n searchDate?: Id | null,\n fields?: string | null,\n ) =>\n [\n ...parkingSpaceOperationKeys.company(companyId),\n \"vacant\",\n canonicalQueryId(searchDate),\n fields ?? undefined,\n ] as const,\n};\n\nexport function userParkingSpacesQueryOptions(\n sdk: SoliboClient,\n params: UserParkingSpacesQueryParams = {},\n) {\n const pagination = paginationIdentity(params);\n return {\n initialPageParam: pagination.pageToken,\n queryKey: parkingSpaceOperationKeys.userInventory(params),\n queryFn: ({ pageParam }: { pageParam: string | undefined }) =>\n sdk.api.parking.indexParkingSpacesUser({\n companyIds: params.companyIds,\n search: params.search,\n type: params.type,\n charger: params.charger,\n assigned: params.assigned,\n fields: params.fields ?? undefined,\n pageToken: pageParam,\n autoPaginate: pagination.autoPaginate,\n count: params.count,\n }),\n staleTime: minutes(20),\n getNextPageParam: nextPageParam,\n getPreviousPageParam: prevPageParam,\n };\n}\n\nexport function parkingSpaceVacancyQueryOptions(\n sdk: SoliboClient,\n params: ParkingSpaceVacancyQueryParams,\n) {\n return {\n queryKey: parkingSpaceOperationKeys.vacancy(\n params.companyId,\n params.parkingSpaceId,\n params.searchDate,\n params.fields,\n ),\n queryFn: () =>\n sdk.api.parking.parkingSpaceVacancy({\n companyId: params.companyId!,\n parkingSpaceId: params.parkingSpaceId!,\n searchDate: params.searchDate,\n fields: params.fields ?? undefined,\n }),\n enabled: hasId(params.companyId) && hasId(params.parkingSpaceId),\n staleTime: params.searchDate == null ? 0 : minutes(20),\n };\n}\n\nexport function parkingSpaceAllocationOverviewQueryOptions(\n sdk: SoliboClient,\n params: ParkingSpaceTemporalQueryParams,\n) {\n return {\n queryKey: parkingSpaceOperationKeys.allocationOverview(\n params.companyId,\n params.searchDate,\n params.fields,\n ),\n queryFn: () =>\n sdk.api.parking.parkingSpaceAllocationOverview({\n companyId: params.companyId!,\n searchDate: params.searchDate,\n fields: params.fields,\n }),\n enabled: hasId(params.companyId),\n staleTime: params.searchDate == null ? 0 : minutes(20),\n };\n}\n\nexport function vacantParkingSpacesQueryOptions(\n sdk: SoliboClient,\n params: ParkingSpaceTemporalQueryParams,\n) {\n return {\n queryKey: parkingSpaceOperationKeys.vacant(\n params.companyId,\n params.searchDate,\n params.fields,\n ),\n queryFn: () =>\n sdk.api.parking.listVacantParkingSpaces({\n companyId: params.companyId!,\n searchDate: params.searchDate,\n fields: params.fields,\n }),\n enabled: hasId(params.companyId),\n staleTime: params.searchDate == null ? 0 : minutes(20),\n };\n}\n"]}
|
|
@@ -19,7 +19,7 @@ export declare function parkingSpacesQueryOptions(sdk: SoliboClient, params: {
|
|
|
19
19
|
initialPageParam: string | undefined;
|
|
20
20
|
queryKey: (string | number | boolean | ParkingSpaceType[] | readonly ["parkingSpace", "list", string | number | null | undefined] | null | undefined)[];
|
|
21
21
|
queryFn: ({ pageParam }: {
|
|
22
|
-
pageParam:
|
|
22
|
+
pageParam: string | undefined;
|
|
23
23
|
}) => Promise<import("@solibo/solibo-sdk").PagedListParkingSpace>;
|
|
24
24
|
staleTime: number;
|
|
25
25
|
enabled: boolean;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { toKeyId } from "../../../utils/kt-bridge.js";
|
|
2
2
|
import { nextPageParam, prevPageParam } from "../../../utils/pageUtils.js";
|
|
3
|
+
import { paginationIdentity } from "../residentsAndSections/queryIdentity.js";
|
|
3
4
|
export const parkingSpaceKeys = {
|
|
4
5
|
all: ["parkingSpace"],
|
|
5
6
|
list: (companyId) => [...parkingSpaceKeys.all, "list", toKeyId(companyId)],
|
|
@@ -11,6 +12,7 @@ export const parkingSpaceKeys = {
|
|
|
11
12
|
],
|
|
12
13
|
};
|
|
13
14
|
export function parkingSpacesQueryOptions(sdk, params) {
|
|
15
|
+
const pagination = paginationIdentity(params);
|
|
14
16
|
return {
|
|
15
17
|
initialPageParam: params.pageToken,
|
|
16
18
|
queryKey: [
|
|
@@ -21,6 +23,8 @@ export function parkingSpacesQueryOptions(sdk, params) {
|
|
|
21
23
|
params.assigned,
|
|
22
24
|
params.fields,
|
|
23
25
|
params.count,
|
|
26
|
+
pagination.pageToken,
|
|
27
|
+
pagination.autoPaginate,
|
|
24
28
|
],
|
|
25
29
|
queryFn: ({ pageParam }) => sdk.api.parking.indexParkingSpace({
|
|
26
30
|
companyId: params.companyId,
|
|
@@ -30,7 +34,7 @@ export function parkingSpacesQueryOptions(sdk, params) {
|
|
|
30
34
|
assigned: params.assigned,
|
|
31
35
|
fields: params.fields,
|
|
32
36
|
pageToken: pageParam,
|
|
33
|
-
autoPaginate:
|
|
37
|
+
autoPaginate: pagination.autoPaginate,
|
|
34
38
|
count: params.count,
|
|
35
39
|
}),
|
|
36
40
|
staleTime: 20 * 60 * 1000,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parkingSpaces.js","sourceRoot":"","sources":["../../../../src/api/queries/parkingSpaces/parkingSpaces.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC3E,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,GAAG,EAAE,CAAC,cAAc,CAAU;IAC9B,IAAI,EAAE,CAAC,SAAiC,EAAE,EAAE,CAC1C,CAAC,GAAG,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,SAAS,CAAC,CAAU;IAChE,MAAM,EAAE,CACN,SAAiC,EACjC,cAAsC,EACtC,EAAE,CACF;QACE,GAAG,gBAAgB,CAAC,GAAG;QACvB,QAAQ;QACR,OAAO,CAAC,SAAS,CAAC;QAClB,OAAO,CAAC,cAAc,CAAC;KACf;CACb,CAAC;AACF,MAAM,UAAU,yBAAyB,CACvC,GAAiB,EACjB,MAUC;IAED,OAAO;QACL,gBAAgB,EAAE,MAAM,CAAC,SAAS;QAClC,QAAQ,EAAE;YACR,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;YACvC,MAAM,CAAC,MAAM;YACb,MAAM,CAAC,IAAI;YACX,MAAM,CAAC,OAAO;YACd,MAAM,CAAC,QAAQ;YACf,MAAM,CAAC,MAAM;YACb,MAAM,CAAC,KAAK;
|
|
1
|
+
{"version":3,"file":"parkingSpaces.js","sourceRoot":"","sources":["../../../../src/api/queries/parkingSpaces/parkingSpaces.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AAC9E,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,GAAG,EAAE,CAAC,cAAc,CAAU;IAC9B,IAAI,EAAE,CAAC,SAAiC,EAAE,EAAE,CAC1C,CAAC,GAAG,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,SAAS,CAAC,CAAU;IAChE,MAAM,EAAE,CACN,SAAiC,EACjC,cAAsC,EACtC,EAAE,CACF;QACE,GAAG,gBAAgB,CAAC,GAAG;QACvB,QAAQ;QACR,OAAO,CAAC,SAAS,CAAC;QAClB,OAAO,CAAC,cAAc,CAAC;KACf;CACb,CAAC;AACF,MAAM,UAAU,yBAAyB,CACvC,GAAiB,EACjB,MAUC;IAED,MAAM,UAAU,GAAG,kBAAkB,CAAC,MAAM,CAAC,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AAC,GAAG,CAAC,OAAO,CAAC,gBAAgB,CAAC;YAC/B,SAAS,EAAE,MAAM,CAAC,SAAU;YAC5B,cAAc,EAAE,MAAM,CAAC,cAAe;YACtC,MAAM,EAAE,MAAM,CAAC,MAAM;SACtB,CAAC;QACJ,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,SAAS,IAAI,CAAC,CAAC,MAAM,CAAC,cAAc;KACvD,CAAC;AACJ,CAAC","sourcesContent":["import { Id, ParkingSpaceType, SoliboClient } from \"@solibo/solibo-sdk\";\nimport { toKeyId } from \"../../../utils/kt-bridge.js\";\nimport { nextPageParam, prevPageParam } from \"../../../utils/pageUtils.js\";\nimport { paginationIdentity } from \"../residentsAndSections/queryIdentity.js\";\nexport const parkingSpaceKeys = {\n all: [\"parkingSpace\"] as const,\n list: (companyId?: Id | null | undefined) =>\n [...parkingSpaceKeys.all, \"list\", toKeyId(companyId)] as const,\n detail: (\n companyId?: Id | null | undefined,\n parkingSpaceId?: Id | null | undefined,\n ) =>\n [\n ...parkingSpaceKeys.all,\n \"detail\",\n toKeyId(companyId),\n toKeyId(parkingSpaceId),\n ] as const,\n};\nexport function parkingSpacesQueryOptions(\n sdk: SoliboClient,\n params: {\n companyId?: Id | null | undefined;\n search?: string | null | undefined;\n type?: ParkingSpaceType[] | null | undefined;\n charger?: boolean | null | undefined;\n assigned?: boolean | null | undefined;\n fields?: string;\n pageToken?: string;\n autoPaginate?: boolean | null;\n count?: number;\n },\n) {\n const pagination = paginationIdentity(params);\n return {\n initialPageParam: params.pageToken,\n queryKey: [\n parkingSpaceKeys.list(params.companyId),\n params.search,\n params.type,\n params.charger,\n params.assigned,\n params.fields,\n params.count,\n pagination.pageToken,\n pagination.autoPaginate,\n ],\n queryFn: ({ pageParam }: { pageParam: string | undefined }) =>\n sdk.api.parking.indexParkingSpace({\n companyId: params.companyId!,\n search: params.search,\n type: params.type ? params.type : undefined,\n charger: params.charger,\n assigned: params.assigned,\n fields: params.fields,\n pageToken: pageParam,\n autoPaginate: pagination.autoPaginate,\n count: params.count,\n }),\n staleTime: 20 * 60 * 1000,\n enabled: !!params.companyId,\n getNextPageParam: nextPageParam,\n getPreviousPageParam: prevPageParam,\n };\n}\nexport function parkingSpaceQueryOptions(\n sdk: SoliboClient,\n params: {\n companyId?: Id | null | undefined;\n parkingSpaceId?: Id | null | undefined;\n fields?: string;\n },\n) {\n return {\n queryKey: [\n parkingSpaceKeys.detail(params.companyId!, params.parkingSpaceId!),\n params.fields,\n ],\n queryFn: () =>\n sdk.api.parking.showParkingSpace({\n companyId: params.companyId!,\n parkingSpaceId: params.parkingSpaceId!,\n fields: params.fields,\n }),\n enabled: !!params.companyId && !!params.parkingSpaceId,\n };\n}\n"]}
|
|
@@ -1,10 +1,22 @@
|
|
|
1
|
-
import { Id, SoliboClient } from "@solibo/solibo-sdk";
|
|
2
|
-
|
|
1
|
+
import { type FieldProjectionResult, Id, Person, Role, SoliboClient } from "@solibo/solibo-sdk";
|
|
2
|
+
import type { Projected } from "../residentsAndSections/domain.js";
|
|
3
|
+
export type CompanyNameSource = {
|
|
4
|
+
id: Id;
|
|
5
|
+
name?: string | null;
|
|
6
|
+
};
|
|
7
|
+
export type ProjectedRoleWithCompanyName = Projected<Role> & {
|
|
8
|
+
companyName?: string;
|
|
9
|
+
};
|
|
10
|
+
export type PersonWithCompanyNames<T extends Projected<Person> = Person> = Omit<T, "roles"> & {
|
|
11
|
+
roles?: readonly ProjectedRoleWithCompanyName[] | null;
|
|
12
|
+
};
|
|
13
|
+
export type PersonQueryResult<Fields extends string | undefined> = PersonWithCompanyNames<FieldProjectionResult<Fields, Person>>;
|
|
14
|
+
export declare function personQueryOptions<Fields extends string | undefined = undefined>(sdk: SoliboClient, params: {
|
|
3
15
|
personId?: Id | null | undefined;
|
|
4
|
-
fields?:
|
|
5
|
-
}, companies?:
|
|
6
|
-
queryKey: (
|
|
7
|
-
queryFn: () => Promise<
|
|
16
|
+
fields?: Fields;
|
|
17
|
+
}, companies?: readonly CompanyNameSource[]): {
|
|
18
|
+
queryKey: (readonly ["person", "detail", string | number | null | undefined] | Fields | undefined)[];
|
|
19
|
+
queryFn: () => Promise<FieldProjectionResult<Fields, Person>>;
|
|
8
20
|
enabled: boolean;
|
|
9
|
-
select: (data:
|
|
21
|
+
select: (data: Awaited<ReturnType<() => Promise<FieldProjectionResult<Fields, Person>>>>) => PersonQueryResult<Fields>;
|
|
10
22
|
};
|
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
import { personKeys } from "./persons.js";
|
|
2
|
-
function
|
|
3
|
-
if (!person?.roles)
|
|
4
|
-
return person;
|
|
2
|
+
function decoratePersonRoles(person, companies) {
|
|
5
3
|
return {
|
|
6
4
|
...person,
|
|
7
|
-
roles: person.roles
|
|
5
|
+
roles: person.roles?.map((role) => ({
|
|
8
6
|
...role,
|
|
9
|
-
companyName: companies.find((
|
|
7
|
+
companyName: companies.find((company) => String(company.id) === String(role.companyId))?.name,
|
|
10
8
|
})),
|
|
11
9
|
};
|
|
12
10
|
}
|
|
13
11
|
export function personQueryOptions(sdk, params, companies) {
|
|
12
|
+
const queryFn = () => sdk.api.person.showPerson({
|
|
13
|
+
personId: params.personId,
|
|
14
|
+
fields: params.fields,
|
|
15
|
+
});
|
|
14
16
|
return {
|
|
15
17
|
queryKey: [personKeys.detail(params.personId), params.fields],
|
|
16
|
-
queryFn
|
|
17
|
-
personId: params.personId,
|
|
18
|
-
fields: params.fields,
|
|
19
|
-
}),
|
|
18
|
+
queryFn,
|
|
20
19
|
enabled: !!params.personId,
|
|
21
|
-
select: (data) =>
|
|
20
|
+
select: (data) => decoratePersonRoles(data, companies ?? []),
|
|
22
21
|
};
|
|
23
22
|
}
|
|
24
23
|
//# sourceMappingURL=person.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"person.js","sourceRoot":"","sources":["../../../../src/api/queries/person/person.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"person.js","sourceRoot":"","sources":["../../../../src/api/queries/person/person.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAqB1C,SAAS,mBAAmB,CAC1B,MAAS,EACT,SAAuC;IAEvC,OAAO;QACL,GAAG,MAAM;QACT,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YAClC,GAAG,IAAI;YACP,WAAW,EAAE,SAAS,CAAC,IAAI,CACzB,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAC3D,EAAE,IAAI;SACR,CAAC,CAAC;KACJ,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,kBAAkB,CAGhC,GAAiB,EACjB,MAGC,EACD,SAAwC;IAExC,MAAM,OAAO,GAAG,GAAG,EAAE,CACnB,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC;QACxB,QAAQ,EAAE,MAAM,CAAC,QAAS;QAC1B,MAAM,EAAE,MAAM,CAAC,MAAM;KACtB,CAAC,CAAC;IACL,OAAO;QACL,QAAQ,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,QAAS,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC;QAC9D,OAAO;QACP,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ;QAC1B,MAAM,EAAE,CACN,IAAyC,EACd,EAAE,CAAC,mBAAmB,CAAC,IAAI,EAAE,SAAS,IAAI,EAAE,CAAC;KAC3E,CAAC;AACJ,CAAC","sourcesContent":["import {\n type FieldProjectionResult,\n Id,\n Person,\n Role,\n SoliboClient,\n} from \"@solibo/solibo-sdk\";\nimport type { Projected } from \"../residentsAndSections/domain.js\";\nimport { personKeys } from \"./persons.js\";\n\nexport type CompanyNameSource = {\n id: Id;\n name?: string | null;\n};\n\nexport type ProjectedRoleWithCompanyName = Projected<Role> & {\n companyName?: string;\n};\n\nexport type PersonWithCompanyNames<T extends Projected<Person> = Person> = Omit<\n T,\n \"roles\"\n> & {\n roles?: readonly ProjectedRoleWithCompanyName[] | null;\n};\n\nexport type PersonQueryResult<Fields extends string | undefined> =\n PersonWithCompanyNames<FieldProjectionResult<Fields, Person>>;\n\nfunction decoratePersonRoles<T extends Projected<Person>>(\n person: T,\n companies: readonly CompanyNameSource[],\n): PersonWithCompanyNames<T> {\n return {\n ...person,\n roles: person.roles?.map((role) => ({\n ...role,\n companyName: companies.find(\n (company) => String(company.id) === String(role.companyId),\n )?.name,\n })),\n };\n}\n\nexport function personQueryOptions<\n Fields extends string | undefined = undefined,\n>(\n sdk: SoliboClient,\n params: {\n personId?: Id | null | undefined;\n fields?: Fields;\n },\n companies?: readonly CompanyNameSource[],\n) {\n const queryFn = () =>\n sdk.api.person.showPerson({\n personId: params.personId!,\n fields: params.fields,\n });\n return {\n queryKey: [personKeys.detail(params.personId!), params.fields],\n queryFn,\n enabled: !!params.personId,\n select: (\n data: Awaited<ReturnType<typeof queryFn>>,\n ): PersonQueryResult<Fields> => decoratePersonRoles(data, companies ?? []),\n };\n}\n"]}
|
|
@@ -1,8 +1,31 @@
|
|
|
1
|
-
import { Resident, Role, Section } from "@solibo/solibo-sdk";
|
|
1
|
+
import { Resident, Role, Section, type KnownSectionCapability, type SectionCapability } from "@solibo/solibo-sdk";
|
|
2
|
+
import type { PagedPage } from "../../../utils/pageUtils.js";
|
|
3
|
+
export type { KnownSectionCapability, SectionCapability, } from "@solibo/solibo-sdk";
|
|
4
|
+
/**
|
|
5
|
+
* Capability values currently emitted by the backend. They describe the
|
|
6
|
+
* section's data shape and relationships; they are not authorization grants.
|
|
7
|
+
*/
|
|
8
|
+
export declare const knownSectionCapabilities: readonly ["Identifier", "Matrikkel", "Andel", "Seksjon", "Residence", "Business", "Apartment", "Sectioned", "InLoan", "Formue", "Address"];
|
|
9
|
+
export declare function isKnownSectionCapability(capability: SectionCapability): capability is KnownSectionCapability;
|
|
10
|
+
/** Recursively optional response shape for server-side field projections. */
|
|
11
|
+
export type Projected<T> = T extends Date ? T : T extends readonly (infer Item)[] ? readonly Projected<Item>[] : T extends object ? {
|
|
12
|
+
[Key in keyof T]?: Projected<T[Key]>;
|
|
13
|
+
} : T;
|
|
14
|
+
export type ProjectedPage<T> = Omit<PagedPage<T>, "items"> & {
|
|
15
|
+
items: Projected<T>[];
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated Client-composed convenience shape. No authoritative API returns
|
|
19
|
+
* a section with this `residents` field.
|
|
20
|
+
*/
|
|
2
21
|
export type SectionWithResidents = Section & {
|
|
3
22
|
searchField: string;
|
|
4
23
|
residents: Resident[];
|
|
5
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated Client-composed convenience shape. No authoritative API returns
|
|
27
|
+
* a resident with this `sections` field.
|
|
28
|
+
*/
|
|
6
29
|
export type ResidentWithSections = Resident & {
|
|
7
30
|
sections: (Section & {
|
|
8
31
|
role: Role;
|
|
@@ -1,2 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Capability values currently emitted by the backend. They describe the
|
|
3
|
+
* section's data shape and relationships; they are not authorization grants.
|
|
4
|
+
*/
|
|
5
|
+
export const knownSectionCapabilities = [
|
|
6
|
+
"Identifier",
|
|
7
|
+
"Matrikkel",
|
|
8
|
+
"Andel",
|
|
9
|
+
"Seksjon",
|
|
10
|
+
"Residence",
|
|
11
|
+
"Business",
|
|
12
|
+
"Apartment",
|
|
13
|
+
"Sectioned",
|
|
14
|
+
"InLoan",
|
|
15
|
+
"Formue",
|
|
16
|
+
"Address",
|
|
17
|
+
];
|
|
18
|
+
const knownSectionCapabilitySet = new Set(knownSectionCapabilities);
|
|
19
|
+
export function isKnownSectionCapability(capability) {
|
|
20
|
+
return knownSectionCapabilitySet.has(capability);
|
|
21
|
+
}
|
|
2
22
|
//# sourceMappingURL=domain.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domain.js","sourceRoot":"","sources":["../../../../src/api/queries/residentsAndSections/domain.ts"],"names":[],"mappings":"","sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"domain.js","sourceRoot":"","sources":["../../../../src/api/queries/residentsAndSections/domain.ts"],"names":[],"mappings":"AAcA;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,YAAY;IACZ,WAAW;IACX,OAAO;IACP,SAAS;IACT,WAAW;IACX,UAAU;IACV,WAAW;IACX,WAAW;IACX,QAAQ;IACR,QAAQ;IACR,SAAS;CAC2C,CAAC;AAEvD,MAAM,yBAAyB,GAAwB,IAAI,GAAG,CAC5D,wBAAwB,CACzB,CAAC;AAEF,MAAM,UAAU,wBAAwB,CACtC,UAA6B;IAE7B,OAAO,yBAAyB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AACnD,CAAC","sourcesContent":["import {\n Resident,\n Role,\n Section,\n type KnownSectionCapability,\n type SectionCapability,\n} from \"@solibo/solibo-sdk\";\nimport type { PagedPage } from \"../../../utils/pageUtils.js\";\n\nexport type {\n KnownSectionCapability,\n SectionCapability,\n} from \"@solibo/solibo-sdk\";\n\n/**\n * Capability values currently emitted by the backend. They describe the\n * section's data shape and relationships; they are not authorization grants.\n */\nexport const knownSectionCapabilities = [\n \"Identifier\",\n \"Matrikkel\",\n \"Andel\",\n \"Seksjon\",\n \"Residence\",\n \"Business\",\n \"Apartment\",\n \"Sectioned\",\n \"InLoan\",\n \"Formue\",\n \"Address\",\n] as const satisfies readonly KnownSectionCapability[];\n\nconst knownSectionCapabilitySet: ReadonlySet<string> = new Set(\n knownSectionCapabilities,\n);\n\nexport function isKnownSectionCapability(\n capability: SectionCapability,\n): capability is KnownSectionCapability {\n return knownSectionCapabilitySet.has(capability);\n}\n\n/** Recursively optional response shape for server-side field projections. */\nexport type Projected<T> = T extends Date\n ? T\n : T extends readonly (infer Item)[]\n ? readonly Projected<Item>[]\n : T extends object\n ? { [Key in keyof T]?: Projected<T[Key]> }\n : T;\n\nexport type ProjectedPage<T> = Omit<PagedPage<T>, \"items\"> & {\n items: Projected<T>[];\n};\n\n/**\n * @deprecated Client-composed convenience shape. No authoritative API returns\n * a section with this `residents` field.\n */\nexport type SectionWithResidents = Section & {\n searchField: string;\n residents: Resident[];\n};\n\n/**\n * @deprecated Client-composed convenience shape. No authoritative API returns\n * a resident with this `sections` field.\n */\nexport type ResidentWithSections = Resident & {\n sections: (Section & {\n role: Role;\n validFrom: Date | null;\n searchField: string;\n })[];\n};\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Id } from "@solibo/solibo-sdk";
|
|
2
|
+
/** Canonical ID comparison for route/body guards and new additive key spaces. */
|
|
3
|
+
export declare function canonicalQueryId(id?: Id | null): string | null | undefined;
|
|
4
|
+
export declare function canonicalQueryIds(ids?: readonly Id[] | null): readonly string[] | null | undefined;
|
|
5
|
+
export declare function paginationIdentity(params: {
|
|
6
|
+
pageToken?: string | null;
|
|
7
|
+
autoPaginate?: boolean | null;
|
|
8
|
+
}): {
|
|
9
|
+
readonly pageToken: string | undefined;
|
|
10
|
+
readonly autoPaginate: boolean;
|
|
11
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Canonical ID comparison for route/body guards and new additive key spaces. */
|
|
2
|
+
export function canonicalQueryId(id) {
|
|
3
|
+
return id == null ? id : String(id);
|
|
4
|
+
}
|
|
5
|
+
export function canonicalQueryIds(ids) {
|
|
6
|
+
return ids == null ? ids : ids.map((id) => String(id));
|
|
7
|
+
}
|
|
8
|
+
export function paginationIdentity(params) {
|
|
9
|
+
return {
|
|
10
|
+
pageToken: params.pageToken ?? undefined,
|
|
11
|
+
autoPaginate: params.autoPaginate ?? false,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=queryIdentity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queryIdentity.js","sourceRoot":"","sources":["../../../../src/api/queries/residentsAndSections/queryIdentity.ts"],"names":[],"mappings":"AAEA,iFAAiF;AACjF,MAAM,UAAU,gBAAgB,CAAC,EAAc;IAC7C,OAAO,EAAE,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/B,GAA0B;IAE1B,OAAO,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;AACzD,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,MAGlC;IACC,OAAO;QACL,SAAS,EAAE,MAAM,CAAC,SAAS,IAAI,SAAS;QACxC,YAAY,EAAE,MAAM,CAAC,YAAY,IAAI,KAAK;KAClC,CAAC;AACb,CAAC","sourcesContent":["import type { Id } from \"@solibo/solibo-sdk\";\n\n/** Canonical ID comparison for route/body guards and new additive key spaces. */\nexport function canonicalQueryId(id?: Id | null): string | null | undefined {\n return id == null ? id : String(id);\n}\n\nexport function canonicalQueryIds(\n ids?: readonly Id[] | null,\n): readonly string[] | null | undefined {\n return ids == null ? ids : ids.map((id) => String(id));\n}\n\nexport function paginationIdentity(params: {\n pageToken?: string | null;\n autoPaginate?: boolean | null;\n}) {\n return {\n pageToken: params.pageToken ?? undefined,\n autoPaginate: params.autoPaginate ?? false,\n } as const;\n}\n"]}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { Id, SoliboClient } from "@solibo/solibo-sdk";
|
|
1
|
+
import { Id, type ResidentType, SoliboClient } from "@solibo/solibo-sdk";
|
|
2
2
|
import { nextPageParam, prevPageParam } from "../../../utils/pageUtils.js";
|
|
3
3
|
export declare const residentKeys: {
|
|
4
4
|
all: readonly ["residents"];
|
|
5
5
|
list: (companyId?: Id | null | undefined) => readonly ["residents", "list", string | number | null | undefined];
|
|
6
|
+
future: (companyId?: Id | null | undefined) => readonly ["residents", "list", string | number | null | undefined, "future"];
|
|
7
|
+
historic: (companyId?: Id | null | undefined) => readonly ["residents", "list", string | number | null | undefined, "historic"];
|
|
8
|
+
detail: (companyId?: Id | null | undefined, residentType?: string, residentId?: Id | null | undefined) => readonly ["residents", "detail", string | null | undefined, string | undefined, string | null | undefined];
|
|
6
9
|
history: (companyId?: Id | null | undefined, sectionId?: Id | null | undefined) => readonly ["residents", "history", string | number | null | undefined, string | number | null | undefined];
|
|
7
10
|
byOrgnr: (companyId?: Id | null | undefined, orgNr?: string) => readonly ["residents", "byOrgnr", string | number | null | undefined, string | undefined];
|
|
8
11
|
byPersonalIdentityNumber: (companyId?: Id | null | undefined, personalIdentityNumber?: string) => readonly ["residents", "byPersonalIdentityNumber", string | number | null | undefined, string | undefined];
|
|
@@ -10,19 +13,57 @@ export declare const residentKeys: {
|
|
|
10
13
|
types: (companyId?: Id | null | undefined) => readonly ["residents", "types", string | number | null | undefined];
|
|
11
14
|
personalId: (companyId?: Id | null | undefined, residentId?: Id | null | undefined) => readonly ["residents", "personalId", string | number | null | undefined, string | number | null | undefined];
|
|
12
15
|
};
|
|
13
|
-
export
|
|
16
|
+
export type ResidentDetailQueryParams<Fields extends string | undefined = undefined> = {
|
|
17
|
+
companyId?: Id | null | undefined;
|
|
18
|
+
residentType?: ResidentType["name"];
|
|
19
|
+
residentId?: Id | null | undefined;
|
|
20
|
+
fields?: Fields;
|
|
21
|
+
};
|
|
22
|
+
export type ResidentPeriodQueryParams<Fields extends string | undefined = undefined> = {
|
|
23
|
+
companyId?: Id | null | undefined;
|
|
24
|
+
fields?: Fields;
|
|
25
|
+
pageToken?: string;
|
|
26
|
+
count?: number;
|
|
27
|
+
autoPaginate?: boolean;
|
|
28
|
+
};
|
|
29
|
+
export declare function residentsQueryOptions<Fields extends string | undefined = undefined>(sdk: SoliboClient, params: {
|
|
14
30
|
companyId?: Id | null | undefined;
|
|
15
31
|
query?: string;
|
|
16
|
-
fields?:
|
|
32
|
+
fields?: Fields;
|
|
17
33
|
pageToken?: string;
|
|
18
34
|
count?: number;
|
|
19
35
|
autoPaginate?: boolean;
|
|
20
36
|
}): {
|
|
21
37
|
initialPageParam: string | undefined;
|
|
22
|
-
queryKey: (string | number | readonly ["residents", "list", string | number | null | undefined] | undefined)[];
|
|
38
|
+
queryKey: (string | number | boolean | readonly ["residents", "list", string | number | null | undefined] | undefined)[];
|
|
39
|
+
queryFn: ({ pageParam }: {
|
|
40
|
+
pageParam: string | undefined;
|
|
41
|
+
}) => Promise<import("@solibo/solibo-sdk").ResidentListResult<Fields>>;
|
|
42
|
+
enabled: boolean;
|
|
43
|
+
getNextPageParam: typeof nextPageParam;
|
|
44
|
+
getPreviousPageParam: typeof prevPageParam;
|
|
45
|
+
};
|
|
46
|
+
export declare function residentQueryOptions<Fields extends string | undefined = undefined>(sdk: SoliboClient, params: ResidentDetailQueryParams<Fields>): {
|
|
47
|
+
queryKey: (Fields | readonly ["residents", "detail", string | null | undefined, string | undefined, string | null | undefined] | undefined)[];
|
|
48
|
+
queryFn: () => Promise<import("@solibo/solibo-sdk").ResidentDetailResult<Fields>>;
|
|
49
|
+
enabled: boolean;
|
|
50
|
+
};
|
|
51
|
+
export declare function futureResidentsQueryOptions<Fields extends string | undefined = undefined>(sdk: SoliboClient, params: ResidentPeriodQueryParams<Fields>): {
|
|
52
|
+
initialPageParam: string | undefined;
|
|
53
|
+
queryKey: (string | number | boolean | readonly ["residents", "list", string | number | null | undefined, "future"] | undefined)[];
|
|
54
|
+
queryFn: ({ pageParam }: {
|
|
55
|
+
pageParam: string | undefined;
|
|
56
|
+
}) => Promise<import("@solibo/solibo-sdk").ResidentListResult<Fields>>;
|
|
57
|
+
enabled: boolean;
|
|
58
|
+
getNextPageParam: typeof nextPageParam;
|
|
59
|
+
getPreviousPageParam: typeof prevPageParam;
|
|
60
|
+
};
|
|
61
|
+
export declare function historicResidentsQueryOptions<Fields extends string | undefined = undefined>(sdk: SoliboClient, params: ResidentPeriodQueryParams<Fields>): {
|
|
62
|
+
initialPageParam: string | undefined;
|
|
63
|
+
queryKey: (string | number | boolean | readonly ["residents", "list", string | number | null | undefined, "historic"] | undefined)[];
|
|
23
64
|
queryFn: ({ pageParam }: {
|
|
24
|
-
pageParam:
|
|
25
|
-
}) => Promise<import("@solibo/solibo-sdk").
|
|
65
|
+
pageParam: string | undefined;
|
|
66
|
+
}) => Promise<import("@solibo/solibo-sdk").ResidentListResult<Fields>>;
|
|
26
67
|
enabled: boolean;
|
|
27
68
|
getNextPageParam: typeof nextPageParam;
|
|
28
69
|
getPreviousPageParam: typeof prevPageParam;
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
import { toKeyId } from "../../../utils/kt-bridge.js";
|
|
2
2
|
import { nextPageParam, prevPageParam } from "../../../utils/pageUtils.js";
|
|
3
|
+
import { canonicalQueryId, paginationIdentity } from "./queryIdentity.js";
|
|
3
4
|
export const residentKeys = {
|
|
4
5
|
all: ["residents"],
|
|
5
6
|
list: (companyId) => [...residentKeys.all, "list", toKeyId(companyId)],
|
|
7
|
+
future: (companyId) => [...residentKeys.list(companyId), "future"],
|
|
8
|
+
historic: (companyId) => [...residentKeys.list(companyId), "historic"],
|
|
9
|
+
detail: (companyId, residentType, residentId) => [
|
|
10
|
+
...residentKeys.all,
|
|
11
|
+
"detail",
|
|
12
|
+
canonicalQueryId(companyId),
|
|
13
|
+
residentType,
|
|
14
|
+
canonicalQueryId(residentId),
|
|
15
|
+
],
|
|
6
16
|
history: (companyId, sectionId) => [
|
|
7
17
|
...residentKeys.all,
|
|
8
18
|
"history",
|
|
@@ -33,6 +43,7 @@ export const residentKeys = {
|
|
|
33
43
|
],
|
|
34
44
|
};
|
|
35
45
|
export function residentsQueryOptions(sdk, params) {
|
|
46
|
+
const pagination = paginationIdentity(params);
|
|
36
47
|
return {
|
|
37
48
|
initialPageParam: params.pageToken,
|
|
38
49
|
queryKey: [
|
|
@@ -40,13 +51,15 @@ export function residentsQueryOptions(sdk, params) {
|
|
|
40
51
|
params.query,
|
|
41
52
|
params.fields,
|
|
42
53
|
params.count,
|
|
54
|
+
pagination.pageToken,
|
|
55
|
+
pagination.autoPaginate,
|
|
43
56
|
],
|
|
44
57
|
queryFn: ({ pageParam }) => sdk.api.residents.indexResident({
|
|
45
58
|
companyId: params.companyId,
|
|
46
59
|
query: params.query,
|
|
47
60
|
fields: params.fields,
|
|
48
61
|
pageToken: pageParam,
|
|
49
|
-
autoPaginate:
|
|
62
|
+
autoPaginate: pagination.autoPaginate,
|
|
50
63
|
count: params.count,
|
|
51
64
|
}),
|
|
52
65
|
enabled: !!params.companyId,
|
|
@@ -54,4 +67,67 @@ export function residentsQueryOptions(sdk, params) {
|
|
|
54
67
|
getPreviousPageParam: prevPageParam,
|
|
55
68
|
};
|
|
56
69
|
}
|
|
70
|
+
export function residentQueryOptions(sdk, params) {
|
|
71
|
+
return {
|
|
72
|
+
queryKey: [
|
|
73
|
+
residentKeys.detail(params.companyId, params.residentType, params.residentId),
|
|
74
|
+
params.fields,
|
|
75
|
+
],
|
|
76
|
+
queryFn: () => sdk.api.residents.showResident({
|
|
77
|
+
companyId: params.companyId,
|
|
78
|
+
residentType: params.residentType,
|
|
79
|
+
residentId: params.residentId,
|
|
80
|
+
fields: params.fields,
|
|
81
|
+
}),
|
|
82
|
+
enabled: params.companyId != null &&
|
|
83
|
+
params.residentType != null &&
|
|
84
|
+
params.residentId != null,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
export function futureResidentsQueryOptions(sdk, params) {
|
|
88
|
+
const pagination = paginationIdentity(params);
|
|
89
|
+
return {
|
|
90
|
+
initialPageParam: pagination.pageToken,
|
|
91
|
+
queryKey: [
|
|
92
|
+
residentKeys.future(params.companyId),
|
|
93
|
+
params.fields,
|
|
94
|
+
params.count,
|
|
95
|
+
pagination.pageToken,
|
|
96
|
+
pagination.autoPaginate,
|
|
97
|
+
],
|
|
98
|
+
queryFn: ({ pageParam }) => sdk.api.residents.indexFutureResidents({
|
|
99
|
+
companyId: params.companyId,
|
|
100
|
+
fields: params.fields,
|
|
101
|
+
pageToken: pageParam,
|
|
102
|
+
autoPaginate: pagination.autoPaginate,
|
|
103
|
+
count: params.count,
|
|
104
|
+
}),
|
|
105
|
+
enabled: params.companyId != null,
|
|
106
|
+
getNextPageParam: nextPageParam,
|
|
107
|
+
getPreviousPageParam: prevPageParam,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
export function historicResidentsQueryOptions(sdk, params) {
|
|
111
|
+
const pagination = paginationIdentity(params);
|
|
112
|
+
return {
|
|
113
|
+
initialPageParam: pagination.pageToken,
|
|
114
|
+
queryKey: [
|
|
115
|
+
residentKeys.historic(params.companyId),
|
|
116
|
+
params.fields,
|
|
117
|
+
params.count,
|
|
118
|
+
pagination.pageToken,
|
|
119
|
+
pagination.autoPaginate,
|
|
120
|
+
],
|
|
121
|
+
queryFn: ({ pageParam }) => sdk.api.residents.indexHistoricResidents({
|
|
122
|
+
companyId: params.companyId,
|
|
123
|
+
fields: params.fields,
|
|
124
|
+
pageToken: pageParam,
|
|
125
|
+
autoPaginate: pagination.autoPaginate,
|
|
126
|
+
count: params.count,
|
|
127
|
+
}),
|
|
128
|
+
enabled: params.companyId != null,
|
|
129
|
+
getNextPageParam: nextPageParam,
|
|
130
|
+
getPreviousPageParam: prevPageParam,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
57
133
|
//# sourceMappingURL=residents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"residents.js","sourceRoot":"","sources":["../../../../src/api/queries/residentsAndSections/residents.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC3E,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,GAAG,EAAE,CAAC,WAA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,EAAE,MAAM,CAAC,SAAS;QAClC,QAAQ,EAAE;YACR,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;YACnC,MAAM,CAAC,KAAK;YACZ,MAAM,CAAC,MAAM;YACb,MAAM,CAAC,KAAK;SACb;QACD,OAAO,EAAE,CAAC,EAAE,SAAS,EAAsB,EAAE,EAAE,CAC7C,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,aAAa,CAAC;YAC9B,SAAS,EAAE,MAAM,CAAC,SAAU;YAC5B,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,SAAS,EAAE,SAAS;YACpB,YAAY,EAAE,MAAM,CAAC,YAAY;YACjC,KAAK,EAAE,MAAM,CAAC,KAAK;SACpB,CAAC;QACJ,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,SAAS;QAC3B,gBAAgB,EAAE,aAAa;QAC/B,oBAAoB,EAAE,aAAa;KACpC,CAAC;AACJ,CAAC","sourcesContent":["import { Id, SoliboClient } from \"@solibo/solibo-sdk\";\nimport { toKeyId } from \"../../../utils/kt-bridge.js\";\nimport { nextPageParam, prevPageParam } from \"../../../utils/pageUtils.js\";\nexport const residentKeys = {\n all: [\"residents\"] as const,\n list: (companyId?: Id | null | undefined) =>\n [...residentKeys.all, \"list\", toKeyId(companyId)] as const,\n history: (\n companyId?: Id | null | undefined,\n sectionId?: Id | null | undefined,\n ) =>\n [\n ...residentKeys.all,\n \"history\",\n toKeyId(companyId),\n toKeyId(sectionId),\n ] as const,\n byOrgnr: (companyId?: Id | null | undefined, orgNr?: string) =>\n [...residentKeys.all, \"byOrgnr\", toKeyId(companyId), orgNr] as const,\n byPersonalIdentityNumber: (\n companyId?: Id | null | undefined,\n personalIdentityNumber?: string,\n ) =>\n [\n ...residentKeys.all,\n \"byPersonalIdentityNumber\",\n toKeyId(companyId),\n personalIdentityNumber,\n ] as const,\n occupancy: (\n companyId?: Id | null | undefined,\n residentType?: string,\n residentId?: Id | null | undefined,\n at?: Id | null | undefined,\n ) =>\n [\n ...residentKeys.all,\n \"occupancy\",\n toKeyId(companyId),\n residentType,\n toKeyId(residentId),\n toKeyId(at),\n ] as const,\n types: (companyId?: Id | null | undefined) =>\n [...residentKeys.all, \"types\", toKeyId(companyId)] as const,\n personalId: (\n companyId?: Id | null | undefined,\n residentId?: Id | null | undefined,\n ) =>\n [\n ...residentKeys.all,\n \"personalId\",\n toKeyId(companyId),\n toKeyId(residentId),\n ] as const,\n};\nexport function residentsQueryOptions(\n sdk: SoliboClient,\n params: {\n companyId?: Id | null | undefined;\n query?: string;\n fields?: string;\n pageToken?: string;\n count?: number;\n autoPaginate?: boolean;\n },\n) {\n return {\n initialPageParam: params.pageToken,\n queryKey: [\n residentKeys.list(params.companyId),\n params.query,\n params.fields,\n params.count,\n ],\n queryFn: ({ pageParam }: { pageParam: any }) =>\n sdk.api.residents.indexResident({\n companyId: params.companyId!,\n query: params.query,\n fields: params.fields,\n pageToken: pageParam,\n autoPaginate: params.autoPaginate,\n count: params.count,\n }),\n enabled: !!params.companyId,\n getNextPageParam: nextPageParam,\n getPreviousPageParam: prevPageParam,\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"residents.js","sourceRoot":"","sources":["../../../../src/api/queries/residentsAndSections/residents.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC1E,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,GAAG,EAAE,CAAC,WAAW,CAAU;IAC3B,IAAI,EAAE,CAAC,SAAiC,EAAE,EAAE,CAC1C,CAAC,GAAG,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,SAAS,CAAC,CAAU;IAC5D,MAAM,EAAE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,MAAM,CAAC,CAAC;IAC9C,OAAO;QACL,gBAAgB,EAAE,UAAU,CAAC,SAAS;QACtC,QAAQ,EAAE;YACR,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC;YACvC,MAAM,CAAC,MAAM;YACb,MAAM,CAAC,KAAK;YACZ,UAAU,CAAC,SAAS;YACpB,UAAU,CAAC,YAAY;SACxB;QACD,OAAO,EAAE,CAAC,EAAE,SAAS,EAAqC,EAAE,EAAE,CAC5D,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,sBAAsB,CAAC;YACvC,SAAS,EAAE,MAAM,CAAC,SAAU;YAC5B,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,SAAS,EAAE,SAAS;YACpB,YAAY,EAAE,UAAU,CAAC,YAAY;YACrC,KAAK,EAAE,MAAM,CAAC,KAAK;SACpB,CAAC;QACJ,OAAO,EAAE,MAAM,CAAC,SAAS,IAAI,IAAI;QACjC,gBAAgB,EAAE,aAAa;QAC/B,oBAAoB,EAAE,aAAa;KACpC,CAAC;AACJ,CAAC","sourcesContent":["import { Id, type ResidentType, SoliboClient } from \"@solibo/solibo-sdk\";\nimport { toKeyId } from \"../../../utils/kt-bridge.js\";\nimport { nextPageParam, prevPageParam } from \"../../../utils/pageUtils.js\";\nimport { canonicalQueryId, paginationIdentity } from \"./queryIdentity.js\";\nexport const residentKeys = {\n all: [\"residents\"] as const,\n list: (companyId?: Id | null | undefined) =>\n [...residentKeys.all, \"list\", toKeyId(companyId)] as const,\n future: (companyId?: Id | null | undefined) =>\n [...residentKeys.list(companyId), \"future\"] as const,\n historic: (companyId?: Id | null | undefined) =>\n [...residentKeys.list(companyId), \"historic\"] as const,\n detail: (\n companyId?: Id | null | undefined,\n residentType?: string,\n residentId?: Id | null | undefined,\n ) =>\n [\n ...residentKeys.all,\n \"detail\",\n canonicalQueryId(companyId),\n residentType,\n canonicalQueryId(residentId),\n ] as const,\n history: (\n companyId?: Id | null | undefined,\n sectionId?: Id | null | undefined,\n ) =>\n [\n ...residentKeys.all,\n \"history\",\n toKeyId(companyId),\n toKeyId(sectionId),\n ] as const,\n byOrgnr: (companyId?: Id | null | undefined, orgNr?: string) =>\n [...residentKeys.all, \"byOrgnr\", toKeyId(companyId), orgNr] as const,\n byPersonalIdentityNumber: (\n companyId?: Id | null | undefined,\n personalIdentityNumber?: string,\n ) =>\n [\n ...residentKeys.all,\n \"byPersonalIdentityNumber\",\n toKeyId(companyId),\n personalIdentityNumber,\n ] as const,\n occupancy: (\n companyId?: Id | null | undefined,\n residentType?: string,\n residentId?: Id | null | undefined,\n at?: Id | null | undefined,\n ) =>\n [\n ...residentKeys.all,\n \"occupancy\",\n toKeyId(companyId),\n residentType,\n toKeyId(residentId),\n toKeyId(at),\n ] as const,\n types: (companyId?: Id | null | undefined) =>\n [...residentKeys.all, \"types\", toKeyId(companyId)] as const,\n personalId: (\n companyId?: Id | null | undefined,\n residentId?: Id | null | undefined,\n ) =>\n [\n ...residentKeys.all,\n \"personalId\",\n toKeyId(companyId),\n toKeyId(residentId),\n ] as const,\n};\n\nexport type ResidentDetailQueryParams<\n Fields extends string | undefined = undefined,\n> = {\n companyId?: Id | null | undefined;\n residentType?: ResidentType[\"name\"];\n residentId?: Id | null | undefined;\n fields?: Fields;\n};\n\nexport type ResidentPeriodQueryParams<\n Fields extends string | undefined = undefined,\n> = {\n companyId?: Id | null | undefined;\n fields?: Fields;\n pageToken?: string;\n count?: number;\n autoPaginate?: boolean;\n};\n\nexport function residentsQueryOptions<\n Fields extends string | undefined = undefined,\n>(\n sdk: SoliboClient,\n params: {\n companyId?: Id | null | undefined;\n query?: string;\n fields?: Fields;\n pageToken?: string;\n count?: number;\n autoPaginate?: boolean;\n },\n) {\n const pagination = paginationIdentity(params);\n return {\n initialPageParam: params.pageToken,\n queryKey: [\n residentKeys.list(params.companyId),\n params.query,\n params.fields,\n params.count,\n pagination.pageToken,\n pagination.autoPaginate,\n ],\n queryFn: ({ pageParam }: { pageParam: string | undefined }) =>\n sdk.api.residents.indexResident({\n companyId: params.companyId!,\n query: params.query,\n fields: params.fields,\n pageToken: pageParam,\n autoPaginate: pagination.autoPaginate,\n count: params.count,\n }),\n enabled: !!params.companyId,\n getNextPageParam: nextPageParam,\n getPreviousPageParam: prevPageParam,\n };\n}\n\nexport function residentQueryOptions<\n Fields extends string | undefined = undefined,\n>(sdk: SoliboClient, params: ResidentDetailQueryParams<Fields>) {\n return {\n queryKey: [\n residentKeys.detail(\n params.companyId,\n params.residentType,\n params.residentId,\n ),\n params.fields,\n ],\n queryFn: () =>\n sdk.api.residents.showResident({\n companyId: params.companyId!,\n residentType: params.residentType!,\n residentId: params.residentId!,\n fields: params.fields,\n }),\n enabled:\n params.companyId != null &&\n params.residentType != null &&\n params.residentId != null,\n };\n}\n\nexport function futureResidentsQueryOptions<\n Fields extends string | undefined = undefined,\n>(sdk: SoliboClient, params: ResidentPeriodQueryParams<Fields>) {\n const pagination = paginationIdentity(params);\n return {\n initialPageParam: pagination.pageToken,\n queryKey: [\n residentKeys.future(params.companyId),\n params.fields,\n params.count,\n pagination.pageToken,\n pagination.autoPaginate,\n ],\n queryFn: ({ pageParam }: { pageParam: string | undefined }) =>\n sdk.api.residents.indexFutureResidents({\n companyId: params.companyId!,\n fields: params.fields,\n pageToken: pageParam,\n autoPaginate: pagination.autoPaginate,\n count: params.count,\n }),\n enabled: params.companyId != null,\n getNextPageParam: nextPageParam,\n getPreviousPageParam: prevPageParam,\n };\n}\n\nexport function historicResidentsQueryOptions<\n Fields extends string | undefined = undefined,\n>(sdk: SoliboClient, params: ResidentPeriodQueryParams<Fields>) {\n const pagination = paginationIdentity(params);\n return {\n initialPageParam: pagination.pageToken,\n queryKey: [\n residentKeys.historic(params.companyId),\n params.fields,\n params.count,\n pagination.pageToken,\n pagination.autoPaginate,\n ],\n queryFn: ({ pageParam }: { pageParam: string | undefined }) =>\n sdk.api.residents.indexHistoricResidents({\n companyId: params.companyId!,\n fields: params.fields,\n pageToken: pageParam,\n autoPaginate: pagination.autoPaginate,\n count: params.count,\n }),\n enabled: params.companyId != null,\n getNextPageParam: nextPageParam,\n getPreviousPageParam: prevPageParam,\n };\n}\n"]}
|