@osise/api-client 0.0.1 → 0.0.2

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 (160) hide show
  1. package/README.md +82 -0
  2. package/dist/cjs/api/admin-b2b.js +260 -0
  3. package/dist/cjs/api/admin-b2b.js.map +1 -0
  4. package/dist/cjs/api/admin-finance.js +78 -0
  5. package/dist/cjs/api/admin-finance.js.map +1 -0
  6. package/dist/cjs/api/admin-payouts.js +54 -0
  7. package/dist/cjs/api/admin-payouts.js.map +1 -0
  8. package/dist/cjs/api/admin-qc.js +237 -0
  9. package/dist/cjs/api/admin-qc.js.map +1 -0
  10. package/dist/cjs/api/admin.js +280 -24
  11. package/dist/cjs/api/admin.js.map +1 -1
  12. package/dist/cjs/api/b2b.js +124 -0
  13. package/dist/cjs/api/b2b.js.map +1 -0
  14. package/dist/cjs/api/communication.js +283 -0
  15. package/dist/cjs/api/communication.js.map +1 -0
  16. package/dist/cjs/api/index.js +33 -1
  17. package/dist/cjs/api/index.js.map +1 -1
  18. package/dist/cjs/api/jobs.js +304 -43
  19. package/dist/cjs/api/jobs.js.map +1 -1
  20. package/dist/cjs/api/location.js +91 -0
  21. package/dist/cjs/api/location.js.map +1 -0
  22. package/dist/cjs/api/payments.js +129 -0
  23. package/dist/cjs/api/payments.js.map +1 -0
  24. package/dist/cjs/api/support.js +148 -0
  25. package/dist/cjs/api/support.js.map +1 -0
  26. package/dist/cjs/hooks/index.js +1738 -4
  27. package/dist/cjs/hooks/index.js.map +1 -1
  28. package/dist/cjs/index.js +35 -1
  29. package/dist/cjs/index.js.map +1 -1
  30. package/dist/cjs/types/admin-finance.js +7 -0
  31. package/dist/cjs/types/admin-finance.js.map +1 -0
  32. package/dist/cjs/types/admin-invoice.js +7 -0
  33. package/dist/cjs/types/admin-invoice.js.map +1 -0
  34. package/dist/cjs/types/admin-payout.js +7 -0
  35. package/dist/cjs/types/admin-payout.js.map +1 -0
  36. package/dist/cjs/types/b2b.js +7 -0
  37. package/dist/cjs/types/b2b.js.map +1 -0
  38. package/dist/cjs/types/communication.js +90 -0
  39. package/dist/cjs/types/communication.js.map +1 -0
  40. package/dist/cjs/types/enums.js +343 -1
  41. package/dist/cjs/types/enums.js.map +1 -1
  42. package/dist/cjs/types/index.js +18 -2
  43. package/dist/cjs/types/index.js.map +1 -1
  44. package/dist/cjs/types/job.js +1 -0
  45. package/dist/cjs/types/job.js.map +1 -1
  46. package/dist/cjs/types/location.js +7 -0
  47. package/dist/cjs/types/location.js.map +1 -0
  48. package/dist/cjs/types/payment.js +7 -0
  49. package/dist/cjs/types/payment.js.map +1 -0
  50. package/dist/cjs/types/qc.js +8 -0
  51. package/dist/cjs/types/qc.js.map +1 -0
  52. package/dist/cjs/types/support.js +7 -0
  53. package/dist/cjs/types/support.js.map +1 -0
  54. package/dist/esm/api/admin-b2b.js +255 -0
  55. package/dist/esm/api/admin-b2b.js.map +1 -0
  56. package/dist/esm/api/admin-finance.js +74 -0
  57. package/dist/esm/api/admin-finance.js.map +1 -0
  58. package/dist/esm/api/admin-payouts.js +50 -0
  59. package/dist/esm/api/admin-payouts.js.map +1 -0
  60. package/dist/esm/api/admin-qc.js +233 -0
  61. package/dist/esm/api/admin-qc.js.map +1 -0
  62. package/dist/esm/api/admin.js +275 -22
  63. package/dist/esm/api/admin.js.map +1 -1
  64. package/dist/esm/api/b2b.js +120 -0
  65. package/dist/esm/api/b2b.js.map +1 -0
  66. package/dist/esm/api/communication.js +275 -0
  67. package/dist/esm/api/communication.js.map +1 -0
  68. package/dist/esm/api/index.js +10 -1
  69. package/dist/esm/api/index.js.map +1 -1
  70. package/dist/esm/api/jobs.js +304 -43
  71. package/dist/esm/api/jobs.js.map +1 -1
  72. package/dist/esm/api/location.js +87 -0
  73. package/dist/esm/api/location.js.map +1 -0
  74. package/dist/esm/api/payments.js +124 -0
  75. package/dist/esm/api/payments.js.map +1 -0
  76. package/dist/esm/api/support.js +143 -0
  77. package/dist/esm/api/support.js.map +1 -0
  78. package/dist/esm/hooks/index.js +1552 -3
  79. package/dist/esm/hooks/index.js.map +1 -1
  80. package/dist/esm/index.js +36 -2
  81. package/dist/esm/index.js.map +1 -1
  82. package/dist/esm/types/admin-finance.js +6 -0
  83. package/dist/esm/types/admin-finance.js.map +1 -0
  84. package/dist/esm/types/admin-invoice.js +6 -0
  85. package/dist/esm/types/admin-invoice.js.map +1 -0
  86. package/dist/esm/types/admin-payout.js +6 -0
  87. package/dist/esm/types/admin-payout.js.map +1 -0
  88. package/dist/esm/types/b2b.js +6 -0
  89. package/dist/esm/types/b2b.js.map +1 -0
  90. package/dist/esm/types/communication.js +87 -0
  91. package/dist/esm/types/communication.js.map +1 -0
  92. package/dist/esm/types/enums.js +341 -0
  93. package/dist/esm/types/enums.js.map +1 -1
  94. package/dist/esm/types/index.js +18 -2
  95. package/dist/esm/types/index.js.map +1 -1
  96. package/dist/esm/types/job.js +1 -0
  97. package/dist/esm/types/job.js.map +1 -1
  98. package/dist/esm/types/location.js +6 -0
  99. package/dist/esm/types/location.js.map +1 -0
  100. package/dist/esm/types/payment.js +6 -0
  101. package/dist/esm/types/payment.js.map +1 -0
  102. package/dist/esm/types/qc.js +7 -0
  103. package/dist/esm/types/qc.js.map +1 -0
  104. package/dist/esm/types/support.js +6 -0
  105. package/dist/esm/types/support.js.map +1 -0
  106. package/dist/types/api/admin-b2b.d.ts +225 -0
  107. package/dist/types/api/admin-b2b.d.ts.map +1 -0
  108. package/dist/types/api/admin-finance.d.ts +52 -0
  109. package/dist/types/api/admin-finance.d.ts.map +1 -0
  110. package/dist/types/api/admin-payouts.d.ts +37 -0
  111. package/dist/types/api/admin-payouts.d.ts.map +1 -0
  112. package/dist/types/api/admin-qc.d.ts +157 -0
  113. package/dist/types/api/admin-qc.d.ts.map +1 -0
  114. package/dist/types/api/admin.d.ts +184 -17
  115. package/dist/types/api/admin.d.ts.map +1 -1
  116. package/dist/types/api/b2b.d.ts +77 -0
  117. package/dist/types/api/b2b.d.ts.map +1 -0
  118. package/dist/types/api/communication.d.ts +201 -0
  119. package/dist/types/api/communication.d.ts.map +1 -0
  120. package/dist/types/api/index.d.ts +10 -1
  121. package/dist/types/api/index.d.ts.map +1 -1
  122. package/dist/types/api/jobs.d.ts +197 -38
  123. package/dist/types/api/jobs.d.ts.map +1 -1
  124. package/dist/types/api/location.d.ts +76 -0
  125. package/dist/types/api/location.d.ts.map +1 -0
  126. package/dist/types/api/payments.d.ts +81 -0
  127. package/dist/types/api/payments.d.ts.map +1 -0
  128. package/dist/types/api/support.d.ts +101 -0
  129. package/dist/types/api/support.d.ts.map +1 -0
  130. package/dist/types/hooks/index.d.ts +965 -6
  131. package/dist/types/hooks/index.d.ts.map +1 -1
  132. package/dist/types/index.d.ts +32 -2
  133. package/dist/types/index.d.ts.map +1 -1
  134. package/dist/types/types/admin-finance.d.ts +265 -0
  135. package/dist/types/types/admin-finance.d.ts.map +1 -0
  136. package/dist/types/types/admin-invoice.d.ts +262 -0
  137. package/dist/types/types/admin-invoice.d.ts.map +1 -0
  138. package/dist/types/types/admin-payout.d.ts +180 -0
  139. package/dist/types/types/admin-payout.d.ts.map +1 -0
  140. package/dist/types/types/admin.d.ts +1341 -0
  141. package/dist/types/types/admin.d.ts.map +1 -1
  142. package/dist/types/types/b2b.d.ts +687 -0
  143. package/dist/types/types/b2b.d.ts.map +1 -0
  144. package/dist/types/types/communication.d.ts +670 -0
  145. package/dist/types/types/communication.d.ts.map +1 -0
  146. package/dist/types/types/enums.d.ts +311 -0
  147. package/dist/types/types/enums.d.ts.map +1 -1
  148. package/dist/types/types/index.d.ts +10 -1
  149. package/dist/types/types/index.d.ts.map +1 -1
  150. package/dist/types/types/job.d.ts +576 -55
  151. package/dist/types/types/job.d.ts.map +1 -1
  152. package/dist/types/types/location.d.ts +74 -0
  153. package/dist/types/types/location.d.ts.map +1 -0
  154. package/dist/types/types/payment.d.ts +281 -0
  155. package/dist/types/types/payment.d.ts.map +1 -0
  156. package/dist/types/types/qc.d.ts +589 -0
  157. package/dist/types/types/qc.d.ts.map +1 -0
  158. package/dist/types/types/support.d.ts +194 -0
  159. package/dist/types/types/support.d.ts.map +1 -0
  160. package/package.json +1 -1
@@ -18,13 +18,198 @@ exports.useArtisanDocuments = useArtisanDocuments;
18
18
  exports.useArtisanAvailability = useArtisanAvailability;
19
19
  exports.useArtisanEarnings = useArtisanEarnings;
20
20
  exports.useArtisanPerformance = useArtisanPerformance;
21
+ exports.useServiceCategories = useServiceCategories;
22
+ exports.useServiceCategory = useServiceCategory;
23
+ exports.useEstimate = useEstimate;
21
24
  exports.useConsumerJobs = useConsumerJobs;
22
- exports.useArtisanJobs = useArtisanJobs;
25
+ exports.useJobs = useJobs;
23
26
  exports.useJob = useJob;
27
+ exports.useJobStatus = useJobStatus;
28
+ exports.useJobUpdates = useJobUpdates;
29
+ exports.useJobArtisan = useJobArtisan;
30
+ exports.useJobEta = useJobEta;
31
+ exports.useJobLocation = useJobLocation;
32
+ exports.useCreateJob = useCreateJob;
33
+ exports.useCancelJob = useCancelJob;
34
+ exports.useRescheduleJob = useRescheduleJob;
35
+ exports.useEscalateJob = useEscalateJob;
36
+ exports.useJobQuote = useJobQuote;
37
+ exports.useApproveQuote = useApproveQuote;
38
+ exports.useRejectQuote = useRejectQuote;
39
+ exports.useNegotiateQuote = useNegotiateQuote;
40
+ exports.useJobRating = useJobRating;
41
+ exports.useSubmitRating = useSubmitRating;
42
+ exports.useAddTip = useAddTip;
43
+ exports.useConfirmCompletion = useConfirmCompletion;
44
+ exports.useReportIssue = useReportIssue;
45
+ exports.useRequestRedo = useRequestRedo;
46
+ exports.useAvailableJobs = useAvailableJobs;
47
+ exports.useArtisanJobs = useArtisanJobs;
48
+ exports.useArtisanJobHistory = useArtisanJobHistory;
49
+ exports.useAcceptJob = useAcceptJob;
50
+ exports.useDeclineJob = useDeclineJob;
51
+ exports.useAcknowledgeJob = useAcknowledgeJob;
52
+ exports.useMarkEnRoute = useMarkEnRoute;
53
+ exports.useMarkArrived = useMarkArrived;
54
+ exports.useUpdateArtisanLocation = useUpdateArtisanLocation;
55
+ exports.useSendJobUpdate = useSendJobUpdate;
56
+ exports.useMarkComplete = useMarkComplete;
57
+ exports.useSubmitQuote = useSubmitQuote;
58
+ exports.useReviseQuote = useReviseQuote;
59
+ exports.useRequestMaterials = useRequestMaterials;
60
+ exports.useConfirmCashReceived = useConfirmCashReceived;
61
+ exports.useJobQueue = useJobQueue;
62
+ exports.useActiveJobs = useActiveJobs;
63
+ exports.useAdminJob = useAdminJob;
64
+ exports.useAvailableArtisans = useAvailableArtisans;
65
+ exports.useSuggestedArtisans = useSuggestedArtisans;
66
+ exports.useAssignArtisan = useAssignArtisan;
67
+ exports.useBroadcastJob = useBroadcastJob;
68
+ exports.useReassignJob = useReassignJob;
69
+ exports.useUpdateJobPriority = useUpdateJobPriority;
70
+ exports.useAddJobNote = useAddJobNote;
71
+ exports.useUpdateJobEta = useUpdateJobEta;
72
+ exports.useLogCustomerContact = useLogCustomerContact;
73
+ exports.useLogArtisanContact = useLogArtisanContact;
24
74
  exports.useDashboardStats = useDashboardStats;
25
75
  exports.useAdminArtisans = useAdminArtisans;
26
76
  exports.useAdminConsumers = useAdminConsumers;
27
77
  exports.usePendingApplications = usePendingApplications;
78
+ exports.usePaymentMethods = usePaymentMethods;
79
+ exports.useAddPaymentMethod = useAddPaymentMethod;
80
+ exports.useUpdatePaymentMethod = useUpdatePaymentMethod;
81
+ exports.useDeletePaymentMethod = useDeletePaymentMethod;
82
+ exports.useSetDefaultPaymentMethod = useSetDefaultPaymentMethod;
83
+ exports.usePaymentStatus = usePaymentStatus;
84
+ exports.usePayment = usePayment;
85
+ exports.useInitiatePayment = useInitiatePayment;
86
+ exports.usePayWithCard = usePayWithCard;
87
+ exports.usePayWithTransfer = usePayWithTransfer;
88
+ exports.useConfirmCashPayment = useConfirmCashPayment;
89
+ exports.useReceipt = useReceipt;
90
+ exports.useInvoice = useInvoice;
91
+ exports.usePaymentHistory = usePaymentHistory;
92
+ exports.useCompanyInvoices = useCompanyInvoices;
93
+ exports.useAdminInvoice = useAdminInvoice;
94
+ exports.useCreateInvoice = useCreateInvoice;
95
+ exports.useUpdateInvoice = useUpdateInvoice;
96
+ exports.useSendInvoice = useSendInvoice;
97
+ exports.useRecordInvoicePayment = useRecordInvoicePayment;
98
+ exports.useCancelInvoice = useCancelInvoice;
99
+ exports.useCompanyStatement = useCompanyStatement;
100
+ exports.useInvoiceableJobs = useInvoiceableJobs;
101
+ exports.usePendingPayouts = usePendingPayouts;
102
+ exports.useProcessWeeklyPayouts = useProcessWeeklyPayouts;
103
+ exports.usePayoutHistory = usePayoutHistory;
104
+ exports.useAdminPayout = useAdminPayout;
105
+ exports.useRetryPayout = useRetryPayout;
106
+ exports.useAdminTransactions = useAdminTransactions;
107
+ exports.useAdminTransaction = useAdminTransaction;
108
+ exports.useFlagTransaction = useFlagTransaction;
109
+ exports.useUnflagTransaction = useUnflagTransaction;
110
+ exports.useMarkTransactionReconciled = useMarkTransactionReconciled;
111
+ exports.useReconciliationReport = useReconciliationReport;
112
+ exports.useRevenueSummary = useRevenueSummary;
113
+ exports.useCommissionSummary = useCommissionSummary;
114
+ exports.useOutstandingBalances = useOutstandingBalances;
115
+ exports.useMyCompany = useMyCompany;
116
+ exports.useLinkToCompany = useLinkToCompany;
117
+ exports.useUnlinkFromCompany = useUnlinkFromCompany;
118
+ exports.useTeamMembers = useTeamMembers;
119
+ exports.useInviteTeamMember = useInviteTeamMember;
120
+ exports.useUpdateTeamMemberRole = useUpdateTeamMemberRole;
121
+ exports.useRemoveTeamMember = useRemoveTeamMember;
122
+ exports.useB2BMonthlyReport = useB2BMonthlyReport;
123
+ exports.useB2BProperties = useB2BProperties;
124
+ exports.useB2BProperty = useB2BProperty;
125
+ exports.useCreateB2BProperty = useCreateB2BProperty;
126
+ exports.useUpdateB2BProperty = useUpdateB2BProperty;
127
+ exports.useDeleteB2BProperty = useDeleteB2BProperty;
128
+ exports.useAdminCompanies = useAdminCompanies;
129
+ exports.useAdminCompany = useAdminCompany;
130
+ exports.useCreateCompany = useCreateCompany;
131
+ exports.useUpdateCompany = useUpdateCompany;
132
+ exports.useDeleteCompany = useDeleteCompany;
133
+ exports.useRegenerateCompanyCode = useRegenerateCompanyCode;
134
+ exports.useAssignAccountManager = useAssignAccountManager;
135
+ exports.useCompanyUsageReport = useCompanyUsageReport;
136
+ exports.useAdminCompanyUsers = useAdminCompanyUsers;
137
+ exports.useAddCompanyUser = useAddCompanyUser;
138
+ exports.useUpdateCompanyUser = useUpdateCompanyUser;
139
+ exports.useRemoveCompanyUser = useRemoveCompanyUser;
140
+ exports.useAdminCompanyContracts = useAdminCompanyContracts;
141
+ exports.useAdminContract = useAdminContract;
142
+ exports.useCreateContract = useCreateContract;
143
+ exports.useUpdateContract = useUpdateContract;
144
+ exports.useTerminateContract = useTerminateContract;
145
+ exports.useAdminCompanyProperties = useAdminCompanyProperties;
146
+ exports.useAdminProperty = useAdminProperty;
147
+ exports.useCreateAdminProperty = useCreateAdminProperty;
148
+ exports.useUpdateAdminProperty = useUpdateAdminProperty;
149
+ exports.useDeleteAdminProperty = useDeleteAdminProperty;
150
+ exports.useAdminMeetingNotes = useAdminMeetingNotes;
151
+ exports.useAdminMeetingNote = useAdminMeetingNote;
152
+ exports.useCreateMeetingNote = useCreateMeetingNote;
153
+ exports.useUpdateMeetingNote = useUpdateMeetingNote;
154
+ exports.useDeleteMeetingNote = useDeleteMeetingNote;
155
+ exports.useDashboardKpis = useDashboardKpis;
156
+ exports.useJobAnalytics = useJobAnalytics;
157
+ exports.useArtisanAnalytics = useArtisanAnalytics;
158
+ exports.useCustomerAnalytics = useCustomerAnalytics;
159
+ exports.useRevenueAnalytics = useRevenueAnalytics;
160
+ exports.useSlaAnalytics = useSlaAnalytics;
161
+ exports.useComplaintAnalytics = useComplaintAnalytics;
162
+ exports.useGenerateJobsReport = useGenerateJobsReport;
163
+ exports.useGenerateArtisansReport = useGenerateArtisansReport;
164
+ exports.useGenerateCustomersReport = useGenerateCustomersReport;
165
+ exports.useGenerateRevenueReport = useGenerateRevenueReport;
166
+ exports.useReportsList = useReportsList;
167
+ exports.useReport = useReport;
168
+ exports.useExportReport = useExportReport;
169
+ exports.useScheduledReports = useScheduledReports;
170
+ exports.useCreateScheduledReport = useCreateScheduledReport;
171
+ exports.useScheduledReport = useScheduledReport;
172
+ exports.useUpdateScheduledReport = useUpdateScheduledReport;
173
+ exports.useDeleteScheduledReport = useDeleteScheduledReport;
174
+ exports.useAvailableReportTypes = useAvailableReportTypes;
175
+ exports.useAdminUsers = useAdminUsers;
176
+ exports.useAdminUser = useAdminUser;
177
+ exports.useCreateAdminUser = useCreateAdminUser;
178
+ exports.useUpdateAdminUser = useUpdateAdminUser;
179
+ exports.useDeactivateAdminUser = useDeactivateAdminUser;
180
+ exports.useUpdateAdminUserRoles = useUpdateAdminUserRoles;
181
+ exports.useServiceAreas = useServiceAreas;
182
+ exports.useServiceArea = useServiceArea;
183
+ exports.useCreateServiceArea = useCreateServiceArea;
184
+ exports.useUpdateServiceArea = useUpdateServiceArea;
185
+ exports.useDeleteServiceArea = useDeleteServiceArea;
186
+ exports.usePricingConfig = usePricingConfig;
187
+ exports.useUpdatePricingConfig = useUpdatePricingConfig;
188
+ exports.useCommissionConfig = useCommissionConfig;
189
+ exports.useUpdateCommissionConfig = useUpdateCommissionConfig;
190
+ exports.useSystemSettings = useSystemSettings;
191
+ exports.useUpdateSystemSettings = useUpdateSystemSettings;
192
+ exports.useActivityLogs = useActivityLogs;
193
+ exports.useActivityLog = useActivityLog;
194
+ exports.useErrorLogs = useErrorLogs;
195
+ exports.useTickets = useTickets;
196
+ exports.useTicket = useTicket;
197
+ exports.useCreateTicket = useCreateTicket;
198
+ exports.useSendTicketMessage = useSendTicketMessage;
199
+ exports.useCloseTicket = useCloseTicket;
200
+ exports.useRateTicket = useRateTicket;
201
+ exports.useMarkTicketMessagesAsRead = useMarkTicketMessagesAsRead;
202
+ exports.useFaq = useFaq;
203
+ exports.useSearchFaq = useSearchFaq;
204
+ exports.useFaqArticle = useFaqArticle;
205
+ exports.useRecordFaqFeedback = useRecordFaqFeedback;
206
+ exports.useReportEmergency = useReportEmergency;
207
+ exports.useArtisanTickets = useArtisanTickets;
208
+ exports.useArtisanTicket = useArtisanTicket;
209
+ exports.useCreateArtisanTicket = useCreateArtisanTicket;
210
+ exports.useSendArtisanTicketMessage = useSendArtisanTicketMessage;
211
+ exports.useCloseArtisanTicket = useCloseArtisanTicket;
212
+ exports.useRateArtisanTicket = useRateArtisanTicket;
28
213
  const jsx_runtime_1 = require("react/jsx-runtime");
29
214
  const react_1 = require("react");
30
215
  const index_1 = require("../index");
@@ -271,6 +456,7 @@ function useCurrentUser() {
271
456
  enabled: isAuthenticated,
272
457
  });
273
458
  }
459
+ // ==================== Consumer Hooks ====================
274
460
  /**
275
461
  * Hook for consumer profile
276
462
  */
@@ -362,6 +548,33 @@ function useArtisanPerformance() {
362
548
  enabled: isAuthenticated,
363
549
  });
364
550
  }
551
+ // ==================== Job Hooks ====================
552
+ // ==================== Service Categories Hooks ====================
553
+ /**
554
+ * Hook for service categories
555
+ */
556
+ function useServiceCategories() {
557
+ const client = useOsiseClient();
558
+ return useQuery(() => client.serviceCategories.list());
559
+ }
560
+ /**
561
+ * Hook for a specific service category
562
+ */
563
+ function useServiceCategory(categoryId) {
564
+ const client = useOsiseClient();
565
+ return useQuery(() => client.serviceCategories.get(categoryId), {
566
+ enabled: !!categoryId,
567
+ });
568
+ }
569
+ // ==================== Job Estimate Hooks ====================
570
+ /**
571
+ * Hook for getting a job estimate
572
+ */
573
+ function useEstimate() {
574
+ const client = useOsiseClient();
575
+ return useMutation((data) => client.jobs.getEstimate(data));
576
+ }
577
+ // ==================== Consumer Job Hooks ====================
365
578
  /**
366
579
  * Hook for consumer jobs
367
580
  */
@@ -372,6 +585,190 @@ function useConsumerJobs(params) {
372
585
  enabled: isAuthenticated,
373
586
  });
374
587
  }
588
+ /**
589
+ * Alias for useConsumerJobs
590
+ */
591
+ function useJobs(params) {
592
+ return useConsumerJobs(params);
593
+ }
594
+ /**
595
+ * Hook for a specific job
596
+ */
597
+ function useJob(jobId) {
598
+ const client = useOsiseClient();
599
+ const isAuthenticated = useIsAuthenticated();
600
+ return useQuery(() => client.jobs.get(jobId), {
601
+ enabled: isAuthenticated && !!jobId,
602
+ });
603
+ }
604
+ /**
605
+ * Hook for job status
606
+ */
607
+ function useJobStatus(jobId) {
608
+ const client = useOsiseClient();
609
+ const isAuthenticated = useIsAuthenticated();
610
+ return useQuery(() => client.jobs.getStatus(jobId), {
611
+ enabled: isAuthenticated && !!jobId,
612
+ });
613
+ }
614
+ /**
615
+ * Hook for job updates/timeline
616
+ */
617
+ function useJobUpdates(jobId) {
618
+ const client = useOsiseClient();
619
+ const isAuthenticated = useIsAuthenticated();
620
+ return useQuery(() => client.jobs.getUpdates(jobId), {
621
+ enabled: isAuthenticated && !!jobId,
622
+ });
623
+ }
624
+ /**
625
+ * Hook for job artisan info
626
+ */
627
+ function useJobArtisan(jobId) {
628
+ const client = useOsiseClient();
629
+ const isAuthenticated = useIsAuthenticated();
630
+ return useQuery(() => client.jobs.getArtisan(jobId), {
631
+ enabled: isAuthenticated && !!jobId,
632
+ });
633
+ }
634
+ /**
635
+ * Hook for job ETA
636
+ */
637
+ function useJobEta(jobId) {
638
+ const client = useOsiseClient();
639
+ const isAuthenticated = useIsAuthenticated();
640
+ return useQuery(() => client.jobs.getEta(jobId), {
641
+ enabled: isAuthenticated && !!jobId,
642
+ });
643
+ }
644
+ /**
645
+ * Hook for artisan location
646
+ */
647
+ function useJobLocation(jobId) {
648
+ const client = useOsiseClient();
649
+ const isAuthenticated = useIsAuthenticated();
650
+ return useQuery(() => client.jobs.getLocation(jobId), {
651
+ enabled: isAuthenticated && !!jobId,
652
+ });
653
+ }
654
+ /**
655
+ * Hook for creating a job
656
+ */
657
+ function useCreateJob() {
658
+ const client = useOsiseClient();
659
+ return useMutation((data) => client.jobs.create(data));
660
+ }
661
+ /**
662
+ * Hook for cancelling a job
663
+ */
664
+ function useCancelJob() {
665
+ const client = useOsiseClient();
666
+ return useMutation(({ jobId, reason }) => client.jobs.cancel(jobId, { reason }));
667
+ }
668
+ /**
669
+ * Hook for rescheduling a job
670
+ */
671
+ function useRescheduleJob() {
672
+ const client = useOsiseClient();
673
+ return useMutation(({ jobId, data }) => client.jobs.reschedule(jobId, data));
674
+ }
675
+ /**
676
+ * Hook for escalating a job
677
+ */
678
+ function useEscalateJob() {
679
+ const client = useOsiseClient();
680
+ return useMutation(({ jobId, data }) => client.jobs.escalate(jobId, data));
681
+ }
682
+ // ==================== Quote Hooks ====================
683
+ /**
684
+ * Hook for job quote
685
+ */
686
+ function useJobQuote(jobId) {
687
+ const client = useOsiseClient();
688
+ const isAuthenticated = useIsAuthenticated();
689
+ return useQuery(() => client.jobs.getQuote(jobId), {
690
+ enabled: isAuthenticated && !!jobId,
691
+ });
692
+ }
693
+ /**
694
+ * Hook for approving a quote
695
+ */
696
+ function useApproveQuote() {
697
+ const client = useOsiseClient();
698
+ return useMutation((jobId) => client.jobs.approveQuote(jobId));
699
+ }
700
+ /**
701
+ * Hook for rejecting a quote
702
+ */
703
+ function useRejectQuote() {
704
+ const client = useOsiseClient();
705
+ return useMutation(({ jobId, reason }) => client.jobs.rejectQuote(jobId, { reason }));
706
+ }
707
+ /**
708
+ * Hook for negotiating a quote
709
+ */
710
+ function useNegotiateQuote() {
711
+ const client = useOsiseClient();
712
+ return useMutation(({ jobId, data }) => client.jobs.negotiateQuote(jobId, data));
713
+ }
714
+ // ==================== Rating Hooks ====================
715
+ /**
716
+ * Hook for job rating
717
+ */
718
+ function useJobRating(jobId) {
719
+ const client = useOsiseClient();
720
+ const isAuthenticated = useIsAuthenticated();
721
+ return useQuery(() => client.jobs.getRating(jobId), {
722
+ enabled: isAuthenticated && !!jobId,
723
+ });
724
+ }
725
+ /**
726
+ * Hook for submitting a rating
727
+ */
728
+ function useSubmitRating() {
729
+ const client = useOsiseClient();
730
+ return useMutation(({ jobId, data }) => client.jobs.submitRating(jobId, data));
731
+ }
732
+ /**
733
+ * Hook for adding a tip
734
+ */
735
+ function useAddTip() {
736
+ const client = useOsiseClient();
737
+ return useMutation(({ jobId, data }) => client.jobs.addTip(jobId, data));
738
+ }
739
+ // ==================== Job Completion & Issues Hooks ====================
740
+ /**
741
+ * Hook for confirming job completion
742
+ */
743
+ function useConfirmCompletion() {
744
+ const client = useOsiseClient();
745
+ return useMutation(({ jobId, notes }) => client.jobs.confirmCompletion(jobId, notes ? { notes } : undefined));
746
+ }
747
+ /**
748
+ * Hook for reporting an issue
749
+ */
750
+ function useReportIssue() {
751
+ const client = useOsiseClient();
752
+ return useMutation(({ jobId, data }) => client.jobs.reportIssue(jobId, data));
753
+ }
754
+ /**
755
+ * Hook for requesting a redo
756
+ */
757
+ function useRequestRedo() {
758
+ const client = useOsiseClient();
759
+ return useMutation(({ jobId, data }) => client.jobs.requestRedo(jobId, data));
760
+ }
761
+ // ==================== Artisan Job Hooks ====================
762
+ /**
763
+ * Hook for available jobs (artisan)
764
+ */
765
+ function useAvailableJobs() {
766
+ const client = useOsiseClient();
767
+ const isAuthenticated = useIsAuthenticated();
768
+ return useQuery(() => client.artisanJobs.getAvailable(), {
769
+ enabled: isAuthenticated,
770
+ });
771
+ }
375
772
  /**
376
773
  * Hook for artisan jobs
377
774
  */
@@ -383,15 +780,207 @@ function useArtisanJobs(params) {
383
780
  });
384
781
  }
385
782
  /**
386
- * Hook for a specific job
783
+ * Hook for artisan job history
387
784
  */
388
- function useJob(jobId) {
785
+ function useArtisanJobHistory(params) {
389
786
  const client = useOsiseClient();
390
787
  const isAuthenticated = useIsAuthenticated();
391
- return useQuery(() => client.jobs.get(jobId), {
788
+ return useQuery(() => client.artisanJobs.getHistory(params), {
789
+ enabled: isAuthenticated,
790
+ });
791
+ }
792
+ /**
793
+ * Hook for accepting a job
794
+ */
795
+ function useAcceptJob() {
796
+ const client = useOsiseClient();
797
+ return useMutation(({ jobId, data }) => client.artisanJobs.accept(jobId, data));
798
+ }
799
+ /**
800
+ * Hook for declining a job
801
+ */
802
+ function useDeclineJob() {
803
+ const client = useOsiseClient();
804
+ return useMutation(({ jobId, data }) => client.artisanJobs.decline(jobId, data));
805
+ }
806
+ /**
807
+ * Hook for acknowledging assignment
808
+ */
809
+ function useAcknowledgeJob() {
810
+ const client = useOsiseClient();
811
+ return useMutation(({ jobId, data }) => client.artisanJobs.acknowledge(jobId, data));
812
+ }
813
+ /**
814
+ * Hook for marking en route
815
+ */
816
+ function useMarkEnRoute() {
817
+ const client = useOsiseClient();
818
+ return useMutation(({ jobId, data }) => client.artisanJobs.markEnRoute(jobId, data));
819
+ }
820
+ /**
821
+ * Hook for marking arrived
822
+ */
823
+ function useMarkArrived() {
824
+ const client = useOsiseClient();
825
+ return useMutation(({ jobId, data }) => client.artisanJobs.markArrived(jobId, data));
826
+ }
827
+ /**
828
+ * Hook for updating artisan location
829
+ */
830
+ function useUpdateArtisanLocation() {
831
+ const client = useOsiseClient();
832
+ return useMutation(({ jobId, data }) => client.artisanJobs.updateLocation(jobId, data));
833
+ }
834
+ /**
835
+ * Hook for sending job update
836
+ */
837
+ function useSendJobUpdate() {
838
+ const client = useOsiseClient();
839
+ return useMutation(({ jobId, data }) => client.artisanJobs.sendUpdate(jobId, data));
840
+ }
841
+ /**
842
+ * Hook for marking job complete
843
+ */
844
+ function useMarkComplete() {
845
+ const client = useOsiseClient();
846
+ return useMutation(({ jobId, data }) => client.artisanJobs.markComplete(jobId, data));
847
+ }
848
+ /**
849
+ * Hook for submitting a quote (artisan)
850
+ */
851
+ function useSubmitQuote() {
852
+ const client = useOsiseClient();
853
+ return useMutation(({ jobId, data }) => client.artisanJobs.submitQuote(jobId, data));
854
+ }
855
+ /**
856
+ * Hook for revising a quote (artisan)
857
+ */
858
+ function useReviseQuote() {
859
+ const client = useOsiseClient();
860
+ return useMutation(({ jobId, data }) => client.artisanJobs.reviseQuote(jobId, data));
861
+ }
862
+ /**
863
+ * Hook for requesting materials
864
+ */
865
+ function useRequestMaterials() {
866
+ const client = useOsiseClient();
867
+ return useMutation(({ jobId, data }) => client.artisanJobs.requestMaterials(jobId, data));
868
+ }
869
+ /**
870
+ * Hook for confirming cash received
871
+ */
872
+ function useConfirmCashReceived() {
873
+ const client = useOsiseClient();
874
+ return useMutation(({ jobId, data }) => client.artisanJobs.confirmCashReceived(jobId, data));
875
+ }
876
+ // ==================== Admin Job Hooks ====================
877
+ /**
878
+ * Hook for job queue (admin/dispatcher)
879
+ */
880
+ function useJobQueue(params) {
881
+ const client = useOsiseClient();
882
+ const isAuthenticated = useIsAuthenticated();
883
+ return useQuery(() => client.adminJobs.getQueue(params), {
884
+ enabled: isAuthenticated,
885
+ });
886
+ }
887
+ /**
888
+ * Hook for active jobs (admin)
889
+ */
890
+ function useActiveJobs() {
891
+ const client = useOsiseClient();
892
+ const isAuthenticated = useIsAuthenticated();
893
+ return useQuery(() => client.adminJobs.getActive(), {
894
+ enabled: isAuthenticated,
895
+ });
896
+ }
897
+ /**
898
+ * Hook for admin job detail
899
+ */
900
+ function useAdminJob(jobId) {
901
+ const client = useOsiseClient();
902
+ const isAuthenticated = useIsAuthenticated();
903
+ return useQuery(() => client.adminJobs.get(jobId), {
904
+ enabled: isAuthenticated && !!jobId,
905
+ });
906
+ }
907
+ /**
908
+ * Hook for available artisans for a job
909
+ */
910
+ function useAvailableArtisans(jobId) {
911
+ const client = useOsiseClient();
912
+ const isAuthenticated = useIsAuthenticated();
913
+ return useQuery(() => client.adminJobs.getAvailableArtisans(jobId), {
914
+ enabled: isAuthenticated && !!jobId,
915
+ });
916
+ }
917
+ /**
918
+ * Hook for suggested artisans for a job
919
+ */
920
+ function useSuggestedArtisans(jobId) {
921
+ const client = useOsiseClient();
922
+ const isAuthenticated = useIsAuthenticated();
923
+ return useQuery(() => client.adminJobs.getSuggestedArtisans(jobId), {
392
924
  enabled: isAuthenticated && !!jobId,
393
925
  });
394
926
  }
927
+ /**
928
+ * Hook for assigning artisan to job
929
+ */
930
+ function useAssignArtisan() {
931
+ const client = useOsiseClient();
932
+ return useMutation(({ jobId, data }) => client.adminJobs.assignArtisan(jobId, data));
933
+ }
934
+ /**
935
+ * Hook for broadcasting job to artisans
936
+ */
937
+ function useBroadcastJob() {
938
+ const client = useOsiseClient();
939
+ return useMutation(({ jobId, data }) => client.adminJobs.broadcast(jobId, data));
940
+ }
941
+ /**
942
+ * Hook for reassigning job
943
+ */
944
+ function useReassignJob() {
945
+ const client = useOsiseClient();
946
+ return useMutation(({ jobId, data }) => client.adminJobs.reassign(jobId, data));
947
+ }
948
+ /**
949
+ * Hook for updating job priority
950
+ */
951
+ function useUpdateJobPriority() {
952
+ const client = useOsiseClient();
953
+ return useMutation(({ jobId, data }) => client.adminJobs.updatePriority(jobId, data));
954
+ }
955
+ /**
956
+ * Hook for adding job note
957
+ */
958
+ function useAddJobNote() {
959
+ const client = useOsiseClient();
960
+ return useMutation(({ jobId, data }) => client.adminJobs.addNote(jobId, data));
961
+ }
962
+ /**
963
+ * Hook for updating job ETA
964
+ */
965
+ function useUpdateJobEta() {
966
+ const client = useOsiseClient();
967
+ return useMutation(({ jobId, data }) => client.adminJobs.updateEta(jobId, data));
968
+ }
969
+ /**
970
+ * Hook for logging customer contact
971
+ */
972
+ function useLogCustomerContact() {
973
+ const client = useOsiseClient();
974
+ return useMutation(({ jobId, data }) => client.adminJobs.logCustomerContact(jobId, data));
975
+ }
976
+ /**
977
+ * Hook for logging artisan contact
978
+ */
979
+ function useLogArtisanContact() {
980
+ const client = useOsiseClient();
981
+ return useMutation(({ jobId, data }) => client.adminJobs.logArtisanContact(jobId, data));
982
+ }
983
+ // ==================== Admin Hooks ====================
395
984
  /**
396
985
  * Hook for admin dashboard stats
397
986
  */
@@ -432,4 +1021,1149 @@ function usePendingApplications(params) {
432
1021
  enabled: isAuthenticated,
433
1022
  });
434
1023
  }
1024
+ // ==================== Payment Hooks ====================
1025
+ /**
1026
+ * Hook for getting saved payment methods
1027
+ */
1028
+ function usePaymentMethods() {
1029
+ const client = useOsiseClient();
1030
+ const isAuthenticated = useIsAuthenticated();
1031
+ return useQuery(() => client.payments.getPaymentMethods(), {
1032
+ enabled: isAuthenticated,
1033
+ });
1034
+ }
1035
+ /**
1036
+ * Hook for adding a payment method
1037
+ */
1038
+ function useAddPaymentMethod() {
1039
+ const client = useOsiseClient();
1040
+ return useMutation((data) => client.payments.addPaymentMethod(data));
1041
+ }
1042
+ /**
1043
+ * Hook for updating a payment method
1044
+ */
1045
+ function useUpdatePaymentMethod() {
1046
+ const client = useOsiseClient();
1047
+ return useMutation(({ methodId, data }) => client.payments.updatePaymentMethod(methodId, data));
1048
+ }
1049
+ /**
1050
+ * Hook for deleting a payment method
1051
+ */
1052
+ function useDeletePaymentMethod() {
1053
+ const client = useOsiseClient();
1054
+ return useMutation((methodId) => client.payments.deletePaymentMethod(methodId));
1055
+ }
1056
+ /**
1057
+ * Hook for setting default payment method
1058
+ */
1059
+ function useSetDefaultPaymentMethod() {
1060
+ const client = useOsiseClient();
1061
+ return useMutation((methodId) => client.payments.setDefaultPaymentMethod(methodId));
1062
+ }
1063
+ /**
1064
+ * Hook for getting payment status
1065
+ */
1066
+ function usePaymentStatus(jobId) {
1067
+ const client = useOsiseClient();
1068
+ const isAuthenticated = useIsAuthenticated();
1069
+ return useQuery(() => client.payments.getPaymentStatus(jobId), {
1070
+ enabled: isAuthenticated && !!jobId,
1071
+ });
1072
+ }
1073
+ /**
1074
+ * Hook for getting payment details
1075
+ */
1076
+ function usePayment(jobId) {
1077
+ const client = useOsiseClient();
1078
+ const isAuthenticated = useIsAuthenticated();
1079
+ return useQuery(() => client.payments.getPayment(jobId), {
1080
+ enabled: isAuthenticated && !!jobId,
1081
+ });
1082
+ }
1083
+ /**
1084
+ * Hook for initiating a payment
1085
+ */
1086
+ function useInitiatePayment() {
1087
+ const client = useOsiseClient();
1088
+ return useMutation(({ jobId, data }) => client.payments.initiatePayment(jobId, data));
1089
+ }
1090
+ /**
1091
+ * Hook for completing a card payment
1092
+ */
1093
+ function usePayWithCard() {
1094
+ const client = useOsiseClient();
1095
+ return useMutation(({ jobId, paymentReference, saveCard }) => client.payments.payWithCard(jobId, paymentReference, saveCard));
1096
+ }
1097
+ /**
1098
+ * Hook for recording a bank transfer payment
1099
+ */
1100
+ function usePayWithTransfer() {
1101
+ const client = useOsiseClient();
1102
+ return useMutation(({ jobId, data }) => client.payments.payWithTransfer(jobId, data));
1103
+ }
1104
+ /**
1105
+ * Hook for confirming cash payment (artisan)
1106
+ */
1107
+ function useConfirmCashPayment() {
1108
+ const client = useOsiseClient();
1109
+ return useMutation(({ jobId, data }) => client.payments.confirmCashPayment(jobId, data));
1110
+ }
1111
+ /**
1112
+ * Hook for getting a receipt
1113
+ */
1114
+ function useReceipt(jobId) {
1115
+ const client = useOsiseClient();
1116
+ const isAuthenticated = useIsAuthenticated();
1117
+ return useQuery(() => client.payments.getReceipt(jobId), {
1118
+ enabled: isAuthenticated && !!jobId,
1119
+ });
1120
+ }
1121
+ /**
1122
+ * Hook for getting an invoice (B2B)
1123
+ */
1124
+ function useInvoice(jobId) {
1125
+ const client = useOsiseClient();
1126
+ const isAuthenticated = useIsAuthenticated();
1127
+ return useQuery(() => client.payments.getInvoice(jobId), {
1128
+ enabled: isAuthenticated && !!jobId,
1129
+ });
1130
+ }
1131
+ /**
1132
+ * Hook for payment history
1133
+ */
1134
+ function usePaymentHistory(params) {
1135
+ const client = useOsiseClient();
1136
+ const isAuthenticated = useIsAuthenticated();
1137
+ return useQuery(() => client.payments.getPaymentHistory(params), {
1138
+ enabled: isAuthenticated,
1139
+ });
1140
+ }
1141
+ // ==================== Admin B2B Invoice Hooks ====================
1142
+ /**
1143
+ * Hook for company invoices (admin)
1144
+ */
1145
+ function useCompanyInvoices(companyId, params) {
1146
+ const client = useOsiseClient();
1147
+ const isAuthenticated = useIsAuthenticated();
1148
+ return useQuery(() => client.adminB2BInvoices.listInvoices(companyId, params), {
1149
+ enabled: isAuthenticated && !!companyId,
1150
+ });
1151
+ }
1152
+ /**
1153
+ * Hook for invoice detail (admin)
1154
+ */
1155
+ function useAdminInvoice(companyId, invoiceId) {
1156
+ const client = useOsiseClient();
1157
+ const isAuthenticated = useIsAuthenticated();
1158
+ return useQuery(() => client.adminB2BInvoices.getInvoice(companyId, invoiceId), {
1159
+ enabled: isAuthenticated && !!companyId && !!invoiceId,
1160
+ });
1161
+ }
1162
+ /**
1163
+ * Hook for creating an invoice
1164
+ */
1165
+ function useCreateInvoice() {
1166
+ const client = useOsiseClient();
1167
+ return useMutation(({ companyId, data }) => client.adminB2BInvoices.createInvoice(companyId, data));
1168
+ }
1169
+ /**
1170
+ * Hook for updating a draft invoice
1171
+ */
1172
+ function useUpdateInvoice() {
1173
+ const client = useOsiseClient();
1174
+ return useMutation(({ companyId, invoiceId, data }) => client.adminB2BInvoices.updateInvoice(companyId, invoiceId, data));
1175
+ }
1176
+ /**
1177
+ * Hook for sending an invoice
1178
+ */
1179
+ function useSendInvoice() {
1180
+ const client = useOsiseClient();
1181
+ return useMutation(({ companyId, invoiceId, data }) => client.adminB2BInvoices.sendInvoice(companyId, invoiceId, data));
1182
+ }
1183
+ /**
1184
+ * Hook for recording invoice payment
1185
+ */
1186
+ function useRecordInvoicePayment() {
1187
+ const client = useOsiseClient();
1188
+ return useMutation(({ companyId, invoiceId, data }) => client.adminB2BInvoices.recordPayment(companyId, invoiceId, data));
1189
+ }
1190
+ /**
1191
+ * Hook for cancelling an invoice
1192
+ */
1193
+ function useCancelInvoice() {
1194
+ const client = useOsiseClient();
1195
+ return useMutation(({ companyId, invoiceId, data }) => client.adminB2BInvoices.cancelInvoice(companyId, invoiceId, data));
1196
+ }
1197
+ /**
1198
+ * Hook for company statement
1199
+ */
1200
+ function useCompanyStatement(companyId, params) {
1201
+ const client = useOsiseClient();
1202
+ const isAuthenticated = useIsAuthenticated();
1203
+ return useQuery(() => client.adminB2BInvoices.getStatement(companyId, params), {
1204
+ enabled: isAuthenticated && !!companyId,
1205
+ });
1206
+ }
1207
+ /**
1208
+ * Hook for invoiceable jobs
1209
+ */
1210
+ function useInvoiceableJobs(companyId, params) {
1211
+ const client = useOsiseClient();
1212
+ const isAuthenticated = useIsAuthenticated();
1213
+ return useQuery(() => client.adminB2BInvoices.getInvoiceableJobs(companyId, params), {
1214
+ enabled: isAuthenticated && !!companyId,
1215
+ });
1216
+ }
1217
+ // ==================== Admin Payout Hooks ====================
1218
+ /**
1219
+ * Hook for pending payouts
1220
+ */
1221
+ function usePendingPayouts(params) {
1222
+ const client = useOsiseClient();
1223
+ const isAuthenticated = useIsAuthenticated();
1224
+ return useQuery(() => client.adminPayouts.getPendingPayouts(params), {
1225
+ enabled: isAuthenticated,
1226
+ });
1227
+ }
1228
+ /**
1229
+ * Hook for processing weekly payouts
1230
+ */
1231
+ function useProcessWeeklyPayouts() {
1232
+ const client = useOsiseClient();
1233
+ return useMutation((data) => client.adminPayouts.processWeeklyPayouts(data));
1234
+ }
1235
+ /**
1236
+ * Hook for payout history
1237
+ */
1238
+ function usePayoutHistory(params) {
1239
+ const client = useOsiseClient();
1240
+ const isAuthenticated = useIsAuthenticated();
1241
+ return useQuery(() => client.adminPayouts.getHistory(params), {
1242
+ enabled: isAuthenticated,
1243
+ });
1244
+ }
1245
+ /**
1246
+ * Hook for payout detail
1247
+ */
1248
+ function useAdminPayout(payoutId) {
1249
+ const client = useOsiseClient();
1250
+ const isAuthenticated = useIsAuthenticated();
1251
+ return useQuery(() => client.adminPayouts.getPayout(payoutId), {
1252
+ enabled: isAuthenticated && !!payoutId,
1253
+ });
1254
+ }
1255
+ /**
1256
+ * Hook for retrying a failed payout
1257
+ */
1258
+ function useRetryPayout() {
1259
+ const client = useOsiseClient();
1260
+ return useMutation(({ payoutId, data }) => client.adminPayouts.retryPayout(payoutId, data));
1261
+ }
1262
+ // ==================== Admin Finance Hooks ====================
1263
+ /**
1264
+ * Hook for admin transactions
1265
+ */
1266
+ function useAdminTransactions(params) {
1267
+ const client = useOsiseClient();
1268
+ const isAuthenticated = useIsAuthenticated();
1269
+ return useQuery(() => client.adminFinance.listTransactions(params), {
1270
+ enabled: isAuthenticated,
1271
+ });
1272
+ }
1273
+ /**
1274
+ * Hook for admin transaction detail
1275
+ */
1276
+ function useAdminTransaction(transactionId) {
1277
+ const client = useOsiseClient();
1278
+ const isAuthenticated = useIsAuthenticated();
1279
+ return useQuery(() => client.adminFinance.getTransaction(transactionId), {
1280
+ enabled: isAuthenticated && !!transactionId,
1281
+ });
1282
+ }
1283
+ /**
1284
+ * Hook for flagging a transaction
1285
+ */
1286
+ function useFlagTransaction() {
1287
+ const client = useOsiseClient();
1288
+ return useMutation(({ transactionId, data }) => client.adminFinance.flagTransaction(transactionId, data));
1289
+ }
1290
+ /**
1291
+ * Hook for unflagging a transaction
1292
+ */
1293
+ function useUnflagTransaction() {
1294
+ const client = useOsiseClient();
1295
+ return useMutation((transactionId) => client.adminFinance.unflagTransaction(transactionId));
1296
+ }
1297
+ /**
1298
+ * Hook for marking a transaction as reconciled
1299
+ */
1300
+ function useMarkTransactionReconciled() {
1301
+ const client = useOsiseClient();
1302
+ return useMutation((transactionId) => client.adminFinance.markReconciled(transactionId));
1303
+ }
1304
+ /**
1305
+ * Hook for reconciliation report
1306
+ */
1307
+ function useReconciliationReport(params) {
1308
+ const client = useOsiseClient();
1309
+ const isAuthenticated = useIsAuthenticated();
1310
+ return useQuery(() => client.adminFinance.getReconciliationReport(params), {
1311
+ enabled: isAuthenticated,
1312
+ });
1313
+ }
1314
+ /**
1315
+ * Hook for revenue summary
1316
+ */
1317
+ function useRevenueSummary(params) {
1318
+ const client = useOsiseClient();
1319
+ const isAuthenticated = useIsAuthenticated();
1320
+ return useQuery(() => client.adminFinance.getRevenueSummary(params), {
1321
+ enabled: isAuthenticated,
1322
+ });
1323
+ }
1324
+ /**
1325
+ * Hook for commission summary
1326
+ */
1327
+ function useCommissionSummary(params) {
1328
+ const client = useOsiseClient();
1329
+ const isAuthenticated = useIsAuthenticated();
1330
+ return useQuery(() => client.adminFinance.getCommissionSummary(params), {
1331
+ enabled: isAuthenticated,
1332
+ });
1333
+ }
1334
+ /**
1335
+ * Hook for outstanding balances
1336
+ */
1337
+ function useOutstandingBalances(params) {
1338
+ const client = useOsiseClient();
1339
+ const isAuthenticated = useIsAuthenticated();
1340
+ return useQuery(() => client.adminFinance.getOutstandingBalances(params), {
1341
+ enabled: isAuthenticated,
1342
+ });
1343
+ }
1344
+ // ==================== Consumer B2B Hooks ====================
1345
+ /**
1346
+ * Hook for getting my company info (B2B consumer)
1347
+ */
1348
+ function useMyCompany() {
1349
+ const client = useOsiseClient();
1350
+ const isAuthenticated = useIsAuthenticated();
1351
+ return useQuery(() => client.b2b.getMyCompany(), {
1352
+ enabled: isAuthenticated,
1353
+ });
1354
+ }
1355
+ /**
1356
+ * Hook for linking to a company
1357
+ */
1358
+ function useLinkToCompany() {
1359
+ const client = useOsiseClient();
1360
+ return useMutation((data) => client.b2b.linkToCompany(data));
1361
+ }
1362
+ /**
1363
+ * Hook for unlinking from company
1364
+ */
1365
+ function useUnlinkFromCompany() {
1366
+ const client = useOsiseClient();
1367
+ return useMutation(() => client.b2b.unlinkFromCompany());
1368
+ }
1369
+ /**
1370
+ * Hook for team members (B2B consumer)
1371
+ */
1372
+ function useTeamMembers(params) {
1373
+ const client = useOsiseClient();
1374
+ const isAuthenticated = useIsAuthenticated();
1375
+ return useQuery(() => client.b2b.getTeam(params), {
1376
+ enabled: isAuthenticated,
1377
+ });
1378
+ }
1379
+ /**
1380
+ * Hook for inviting a team member
1381
+ */
1382
+ function useInviteTeamMember() {
1383
+ const client = useOsiseClient();
1384
+ return useMutation((data) => client.b2b.inviteTeamMember(data));
1385
+ }
1386
+ /**
1387
+ * Hook for updating team member role
1388
+ */
1389
+ function useUpdateTeamMemberRole() {
1390
+ const client = useOsiseClient();
1391
+ return useMutation(({ memberId, data }) => client.b2b.updateTeamMemberRole(memberId, data));
1392
+ }
1393
+ /**
1394
+ * Hook for removing a team member
1395
+ */
1396
+ function useRemoveTeamMember() {
1397
+ const client = useOsiseClient();
1398
+ return useMutation((memberId) => client.b2b.removeTeamMember(memberId));
1399
+ }
1400
+ /**
1401
+ * Hook for monthly B2B report
1402
+ */
1403
+ function useB2BMonthlyReport(year, month) {
1404
+ const client = useOsiseClient();
1405
+ const isAuthenticated = useIsAuthenticated();
1406
+ return useQuery(() => client.b2b.getMonthlyReport(year, month), {
1407
+ enabled: isAuthenticated,
1408
+ });
1409
+ }
1410
+ /**
1411
+ * Hook for B2B properties (consumer)
1412
+ */
1413
+ function useB2BProperties(params) {
1414
+ const client = useOsiseClient();
1415
+ const isAuthenticated = useIsAuthenticated();
1416
+ return useQuery(() => client.b2b.getProperties(params), {
1417
+ enabled: isAuthenticated,
1418
+ });
1419
+ }
1420
+ /**
1421
+ * Hook for B2B property detail (consumer)
1422
+ */
1423
+ function useB2BProperty(propertyId) {
1424
+ const client = useOsiseClient();
1425
+ const isAuthenticated = useIsAuthenticated();
1426
+ return useQuery(() => client.b2b.getProperty(propertyId), {
1427
+ enabled: isAuthenticated && !!propertyId,
1428
+ });
1429
+ }
1430
+ /**
1431
+ * Hook for creating a B2B property (consumer)
1432
+ */
1433
+ function useCreateB2BProperty() {
1434
+ const client = useOsiseClient();
1435
+ return useMutation((data) => client.b2b.createProperty(data));
1436
+ }
1437
+ /**
1438
+ * Hook for updating a B2B property (consumer)
1439
+ */
1440
+ function useUpdateB2BProperty() {
1441
+ const client = useOsiseClient();
1442
+ return useMutation(({ propertyId, data }) => client.b2b.updateProperty(propertyId, data));
1443
+ }
1444
+ /**
1445
+ * Hook for deleting a B2B property (consumer)
1446
+ */
1447
+ function useDeleteB2BProperty() {
1448
+ const client = useOsiseClient();
1449
+ return useMutation((propertyId) => client.b2b.deleteProperty(propertyId));
1450
+ }
1451
+ // ==================== Admin B2B Company Hooks ====================
1452
+ /**
1453
+ * Hook for admin B2B companies list
1454
+ */
1455
+ function useAdminCompanies(params) {
1456
+ const client = useOsiseClient();
1457
+ const isAuthenticated = useIsAuthenticated();
1458
+ return useQuery(() => client.adminB2B.listCompanies(params), {
1459
+ enabled: isAuthenticated,
1460
+ });
1461
+ }
1462
+ /**
1463
+ * Hook for admin company detail
1464
+ */
1465
+ function useAdminCompany(companyId) {
1466
+ const client = useOsiseClient();
1467
+ const isAuthenticated = useIsAuthenticated();
1468
+ return useQuery(() => client.adminB2B.getCompany(companyId), {
1469
+ enabled: isAuthenticated && !!companyId,
1470
+ });
1471
+ }
1472
+ /**
1473
+ * Hook for creating a company (admin)
1474
+ */
1475
+ function useCreateCompany() {
1476
+ const client = useOsiseClient();
1477
+ return useMutation((data) => client.adminB2B.createCompany(data));
1478
+ }
1479
+ /**
1480
+ * Hook for updating a company (admin)
1481
+ */
1482
+ function useUpdateCompany() {
1483
+ const client = useOsiseClient();
1484
+ return useMutation(({ companyId, data }) => client.adminB2B.updateCompany(companyId, data));
1485
+ }
1486
+ /**
1487
+ * Hook for deleting a company (admin)
1488
+ */
1489
+ function useDeleteCompany() {
1490
+ const client = useOsiseClient();
1491
+ return useMutation((companyId) => client.adminB2B.deleteCompany(companyId));
1492
+ }
1493
+ /**
1494
+ * Hook for regenerating company code (admin)
1495
+ */
1496
+ function useRegenerateCompanyCode() {
1497
+ const client = useOsiseClient();
1498
+ return useMutation((companyId) => client.adminB2B.regenerateCompanyCode(companyId));
1499
+ }
1500
+ /**
1501
+ * Hook for assigning account manager (admin)
1502
+ */
1503
+ function useAssignAccountManager() {
1504
+ const client = useOsiseClient();
1505
+ return useMutation(({ companyId, data }) => client.adminB2B.assignAccountManager(companyId, data));
1506
+ }
1507
+ /**
1508
+ * Hook for company usage report (admin)
1509
+ */
1510
+ function useCompanyUsageReport(companyId, params) {
1511
+ const client = useOsiseClient();
1512
+ const isAuthenticated = useIsAuthenticated();
1513
+ return useQuery(() => client.adminB2B.getUsageReport(companyId, params), {
1514
+ enabled: isAuthenticated && !!companyId,
1515
+ });
1516
+ }
1517
+ // ==================== Admin B2B Company User Hooks ====================
1518
+ /**
1519
+ * Hook for company users (admin)
1520
+ */
1521
+ function useAdminCompanyUsers(companyId, params) {
1522
+ const client = useOsiseClient();
1523
+ const isAuthenticated = useIsAuthenticated();
1524
+ return useQuery(() => client.adminB2B.listCompanyUsers(companyId, params), {
1525
+ enabled: isAuthenticated && !!companyId,
1526
+ });
1527
+ }
1528
+ /**
1529
+ * Hook for adding a company user (admin)
1530
+ */
1531
+ function useAddCompanyUser() {
1532
+ const client = useOsiseClient();
1533
+ return useMutation(({ companyId, data }) => client.adminB2B.addCompanyUser(companyId, data));
1534
+ }
1535
+ /**
1536
+ * Hook for updating a company user (admin)
1537
+ */
1538
+ function useUpdateCompanyUser() {
1539
+ const client = useOsiseClient();
1540
+ return useMutation(({ companyId, userId, data }) => client.adminB2B.updateCompanyUser(companyId, userId, data));
1541
+ }
1542
+ /**
1543
+ * Hook for removing a company user (admin)
1544
+ */
1545
+ function useRemoveCompanyUser() {
1546
+ const client = useOsiseClient();
1547
+ return useMutation(({ companyId, userId }) => client.adminB2B.removeCompanyUser(companyId, userId));
1548
+ }
1549
+ // ==================== Admin B2B Contract Hooks ====================
1550
+ /**
1551
+ * Hook for company contracts (admin)
1552
+ */
1553
+ function useAdminCompanyContracts(companyId, params) {
1554
+ const client = useOsiseClient();
1555
+ const isAuthenticated = useIsAuthenticated();
1556
+ return useQuery(() => client.adminB2B.listCompanyContracts(companyId, params), {
1557
+ enabled: isAuthenticated && !!companyId,
1558
+ });
1559
+ }
1560
+ /**
1561
+ * Hook for contract detail (admin)
1562
+ */
1563
+ function useAdminContract(contractId) {
1564
+ const client = useOsiseClient();
1565
+ const isAuthenticated = useIsAuthenticated();
1566
+ return useQuery(() => client.adminB2B.getContract(contractId), {
1567
+ enabled: isAuthenticated && !!contractId,
1568
+ });
1569
+ }
1570
+ /**
1571
+ * Hook for creating a contract (admin)
1572
+ */
1573
+ function useCreateContract() {
1574
+ const client = useOsiseClient();
1575
+ return useMutation(({ companyId, data }) => client.adminB2B.createContract(companyId, data));
1576
+ }
1577
+ /**
1578
+ * Hook for updating a contract (admin)
1579
+ */
1580
+ function useUpdateContract() {
1581
+ const client = useOsiseClient();
1582
+ return useMutation(({ contractId, data }) => client.adminB2B.updateContract(contractId, data));
1583
+ }
1584
+ /**
1585
+ * Hook for terminating a contract (admin)
1586
+ */
1587
+ function useTerminateContract() {
1588
+ const client = useOsiseClient();
1589
+ return useMutation(({ contractId, reason }) => client.adminB2B.terminateContract(contractId, reason));
1590
+ }
1591
+ // ==================== Admin B2B Property Hooks ====================
1592
+ /**
1593
+ * Hook for company properties (admin)
1594
+ */
1595
+ function useAdminCompanyProperties(companyId, params) {
1596
+ const client = useOsiseClient();
1597
+ const isAuthenticated = useIsAuthenticated();
1598
+ return useQuery(() => client.adminB2B.listCompanyProperties(companyId, params), {
1599
+ enabled: isAuthenticated && !!companyId,
1600
+ });
1601
+ }
1602
+ /**
1603
+ * Hook for property detail (admin)
1604
+ */
1605
+ function useAdminProperty(propertyId) {
1606
+ const client = useOsiseClient();
1607
+ const isAuthenticated = useIsAuthenticated();
1608
+ return useQuery(() => client.adminB2B.getProperty(propertyId), {
1609
+ enabled: isAuthenticated && !!propertyId,
1610
+ });
1611
+ }
1612
+ /**
1613
+ * Hook for creating a property (admin)
1614
+ */
1615
+ function useCreateAdminProperty() {
1616
+ const client = useOsiseClient();
1617
+ return useMutation(({ companyId, data }) => client.adminB2B.createProperty(companyId, data));
1618
+ }
1619
+ /**
1620
+ * Hook for updating a property (admin)
1621
+ */
1622
+ function useUpdateAdminProperty() {
1623
+ const client = useOsiseClient();
1624
+ return useMutation(({ propertyId, data }) => client.adminB2B.updateProperty(propertyId, data));
1625
+ }
1626
+ /**
1627
+ * Hook for deleting a property (admin)
1628
+ */
1629
+ function useDeleteAdminProperty() {
1630
+ const client = useOsiseClient();
1631
+ return useMutation((propertyId) => client.adminB2B.deleteProperty(propertyId));
1632
+ }
1633
+ // ==================== Admin B2B Meeting Note Hooks ====================
1634
+ /**
1635
+ * Hook for company meeting notes (admin)
1636
+ */
1637
+ function useAdminMeetingNotes(companyId, params) {
1638
+ const client = useOsiseClient();
1639
+ const isAuthenticated = useIsAuthenticated();
1640
+ return useQuery(() => client.adminB2B.listCompanyMeetingNotes(companyId, params), {
1641
+ enabled: isAuthenticated && !!companyId,
1642
+ });
1643
+ }
1644
+ /**
1645
+ * Hook for meeting note detail (admin)
1646
+ */
1647
+ function useAdminMeetingNote(meetingNoteId) {
1648
+ const client = useOsiseClient();
1649
+ const isAuthenticated = useIsAuthenticated();
1650
+ return useQuery(() => client.adminB2B.getMeetingNote(meetingNoteId), {
1651
+ enabled: isAuthenticated && !!meetingNoteId,
1652
+ });
1653
+ }
1654
+ /**
1655
+ * Hook for creating a meeting note (admin)
1656
+ */
1657
+ function useCreateMeetingNote() {
1658
+ const client = useOsiseClient();
1659
+ return useMutation(({ companyId, data }) => client.adminB2B.createMeetingNote(companyId, data));
1660
+ }
1661
+ /**
1662
+ * Hook for updating a meeting note (admin)
1663
+ */
1664
+ function useUpdateMeetingNote() {
1665
+ const client = useOsiseClient();
1666
+ return useMutation(({ meetingNoteId, data }) => client.adminB2B.updateMeetingNote(meetingNoteId, data));
1667
+ }
1668
+ /**
1669
+ * Hook for deleting a meeting note (admin)
1670
+ */
1671
+ function useDeleteMeetingNote() {
1672
+ const client = useOsiseClient();
1673
+ return useMutation((meetingNoteId) => client.adminB2B.deleteMeetingNote(meetingNoteId));
1674
+ }
1675
+ // ==================== Admin Analytics Hooks ====================
1676
+ /**
1677
+ * Hook for dashboard KPIs
1678
+ */
1679
+ function useDashboardKpis(params) {
1680
+ const client = useOsiseClient();
1681
+ const isAuthenticated = useIsAuthenticated();
1682
+ return useQuery(() => client.adminAnalytics.getDashboard(params), {
1683
+ enabled: isAuthenticated,
1684
+ });
1685
+ }
1686
+ /**
1687
+ * Hook for job analytics
1688
+ */
1689
+ function useJobAnalytics(params) {
1690
+ const client = useOsiseClient();
1691
+ const isAuthenticated = useIsAuthenticated();
1692
+ return useQuery(() => client.adminAnalytics.getJobAnalytics(params), {
1693
+ enabled: isAuthenticated,
1694
+ });
1695
+ }
1696
+ /**
1697
+ * Hook for artisan analytics (detailed)
1698
+ */
1699
+ function useArtisanAnalytics(params) {
1700
+ const client = useOsiseClient();
1701
+ const isAuthenticated = useIsAuthenticated();
1702
+ return useQuery(() => client.adminAnalytics.getArtisanAnalytics(params), {
1703
+ enabled: isAuthenticated,
1704
+ });
1705
+ }
1706
+ /**
1707
+ * Hook for customer analytics
1708
+ */
1709
+ function useCustomerAnalytics(params) {
1710
+ const client = useOsiseClient();
1711
+ const isAuthenticated = useIsAuthenticated();
1712
+ return useQuery(() => client.adminAnalytics.getCustomerAnalytics(params), {
1713
+ enabled: isAuthenticated,
1714
+ });
1715
+ }
1716
+ /**
1717
+ * Hook for revenue analytics
1718
+ */
1719
+ function useRevenueAnalytics(params) {
1720
+ const client = useOsiseClient();
1721
+ const isAuthenticated = useIsAuthenticated();
1722
+ return useQuery(() => client.adminAnalytics.getRevenueAnalytics(params), {
1723
+ enabled: isAuthenticated,
1724
+ });
1725
+ }
1726
+ /**
1727
+ * Hook for SLA compliance analytics
1728
+ */
1729
+ function useSlaAnalytics(params) {
1730
+ const client = useOsiseClient();
1731
+ const isAuthenticated = useIsAuthenticated();
1732
+ return useQuery(() => client.adminAnalytics.getSlaAnalytics(params), {
1733
+ enabled: isAuthenticated,
1734
+ });
1735
+ }
1736
+ /**
1737
+ * Hook for complaint analytics
1738
+ */
1739
+ function useComplaintAnalytics(params) {
1740
+ const client = useOsiseClient();
1741
+ const isAuthenticated = useIsAuthenticated();
1742
+ return useQuery(() => client.adminAnalytics.getComplaintAnalytics(params), {
1743
+ enabled: isAuthenticated,
1744
+ });
1745
+ }
1746
+ // ==================== Admin Reports Hooks ====================
1747
+ /**
1748
+ * Hook for generating jobs report
1749
+ */
1750
+ function useGenerateJobsReport() {
1751
+ const client = useOsiseClient();
1752
+ return useMutation((data) => client.adminReports.generateJobsReport(data));
1753
+ }
1754
+ /**
1755
+ * Hook for generating artisans report
1756
+ */
1757
+ function useGenerateArtisansReport() {
1758
+ const client = useOsiseClient();
1759
+ return useMutation((data) => client.adminReports.generateArtisansReport(data));
1760
+ }
1761
+ /**
1762
+ * Hook for generating customers report
1763
+ */
1764
+ function useGenerateCustomersReport() {
1765
+ const client = useOsiseClient();
1766
+ return useMutation((data) => client.adminReports.generateCustomersReport(data));
1767
+ }
1768
+ /**
1769
+ * Hook for generating revenue report
1770
+ */
1771
+ function useGenerateRevenueReport() {
1772
+ const client = useOsiseClient();
1773
+ return useMutation((data) => client.adminReports.generateRevenueReport(data));
1774
+ }
1775
+ /**
1776
+ * Hook for listing reports
1777
+ */
1778
+ function useReportsList(params) {
1779
+ const client = useOsiseClient();
1780
+ const isAuthenticated = useIsAuthenticated();
1781
+ return useQuery(() => client.adminReports.list(params), {
1782
+ enabled: isAuthenticated,
1783
+ });
1784
+ }
1785
+ /**
1786
+ * Hook for report detail
1787
+ */
1788
+ function useReport(reportId) {
1789
+ const client = useOsiseClient();
1790
+ const isAuthenticated = useIsAuthenticated();
1791
+ return useQuery(() => client.adminReports.get(reportId), {
1792
+ enabled: isAuthenticated && !!reportId,
1793
+ });
1794
+ }
1795
+ /**
1796
+ * Hook for exporting a report
1797
+ */
1798
+ function useExportReport() {
1799
+ const client = useOsiseClient();
1800
+ return useMutation(({ reportId, data }) => client.adminReports.export(reportId, data));
1801
+ }
1802
+ /**
1803
+ * Hook for scheduled reports list
1804
+ */
1805
+ function useScheduledReports(params) {
1806
+ const client = useOsiseClient();
1807
+ const isAuthenticated = useIsAuthenticated();
1808
+ return useQuery(() => client.adminReports.getScheduled(params), {
1809
+ enabled: isAuthenticated,
1810
+ });
1811
+ }
1812
+ /**
1813
+ * Hook for creating a scheduled report
1814
+ */
1815
+ function useCreateScheduledReport() {
1816
+ const client = useOsiseClient();
1817
+ return useMutation((data) => client.adminReports.createScheduled(data));
1818
+ }
1819
+ /**
1820
+ * Hook for scheduled report detail
1821
+ */
1822
+ function useScheduledReport(scheduleId) {
1823
+ const client = useOsiseClient();
1824
+ const isAuthenticated = useIsAuthenticated();
1825
+ return useQuery(() => client.adminReports.getScheduledById(scheduleId), {
1826
+ enabled: isAuthenticated && !!scheduleId,
1827
+ });
1828
+ }
1829
+ /**
1830
+ * Hook for updating a scheduled report
1831
+ */
1832
+ function useUpdateScheduledReport() {
1833
+ const client = useOsiseClient();
1834
+ return useMutation(({ scheduleId, data }) => client.adminReports.updateScheduled(scheduleId, data));
1835
+ }
1836
+ /**
1837
+ * Hook for deleting a scheduled report
1838
+ */
1839
+ function useDeleteScheduledReport() {
1840
+ const client = useOsiseClient();
1841
+ return useMutation((scheduleId) => client.adminReports.deleteScheduled(scheduleId));
1842
+ }
1843
+ /**
1844
+ * Hook for available report types
1845
+ */
1846
+ function useAvailableReportTypes() {
1847
+ const client = useOsiseClient();
1848
+ const isAuthenticated = useIsAuthenticated();
1849
+ return useQuery(() => client.adminReports.getAvailableTypes(), {
1850
+ enabled: isAuthenticated,
1851
+ });
1852
+ }
1853
+ // ==================== Admin System Hooks ====================
1854
+ /**
1855
+ * Hook for admin users list
1856
+ */
1857
+ function useAdminUsers(params) {
1858
+ const client = useOsiseClient();
1859
+ const isAuthenticated = useIsAuthenticated();
1860
+ return useQuery(() => client.adminSystem.getAdminUsers(params), {
1861
+ enabled: isAuthenticated,
1862
+ });
1863
+ }
1864
+ /**
1865
+ * Hook for admin user detail
1866
+ */
1867
+ function useAdminUser(userId) {
1868
+ const client = useOsiseClient();
1869
+ const isAuthenticated = useIsAuthenticated();
1870
+ return useQuery(() => client.adminSystem.getAdminUser(userId), {
1871
+ enabled: isAuthenticated && !!userId,
1872
+ });
1873
+ }
1874
+ /**
1875
+ * Hook for creating an admin user
1876
+ */
1877
+ function useCreateAdminUser() {
1878
+ const client = useOsiseClient();
1879
+ return useMutation((data) => client.adminSystem.createAdminUser(data));
1880
+ }
1881
+ /**
1882
+ * Hook for updating an admin user
1883
+ */
1884
+ function useUpdateAdminUser() {
1885
+ const client = useOsiseClient();
1886
+ return useMutation(({ userId, data }) => client.adminSystem.updateAdminUser(userId, data));
1887
+ }
1888
+ /**
1889
+ * Hook for deactivating an admin user
1890
+ */
1891
+ function useDeactivateAdminUser() {
1892
+ const client = useOsiseClient();
1893
+ return useMutation(({ userId, data }) => client.adminSystem.deactivateAdminUser(userId, data));
1894
+ }
1895
+ /**
1896
+ * Hook for updating admin user roles
1897
+ */
1898
+ function useUpdateAdminUserRoles() {
1899
+ const client = useOsiseClient();
1900
+ return useMutation(({ userId, data }) => client.adminSystem.updateAdminUserRoles(userId, data));
1901
+ }
1902
+ /**
1903
+ * Hook for service areas list
1904
+ */
1905
+ function useServiceAreas(params) {
1906
+ const client = useOsiseClient();
1907
+ const isAuthenticated = useIsAuthenticated();
1908
+ return useQuery(() => client.adminSystem.getServiceAreas(params), {
1909
+ enabled: isAuthenticated,
1910
+ });
1911
+ }
1912
+ /**
1913
+ * Hook for service area detail
1914
+ */
1915
+ function useServiceArea(areaId) {
1916
+ const client = useOsiseClient();
1917
+ const isAuthenticated = useIsAuthenticated();
1918
+ return useQuery(() => client.adminSystem.getServiceArea(areaId), {
1919
+ enabled: isAuthenticated && !!areaId,
1920
+ });
1921
+ }
1922
+ /**
1923
+ * Hook for creating a service area
1924
+ */
1925
+ function useCreateServiceArea() {
1926
+ const client = useOsiseClient();
1927
+ return useMutation((data) => client.adminSystem.createServiceArea(data));
1928
+ }
1929
+ /**
1930
+ * Hook for updating a service area
1931
+ */
1932
+ function useUpdateServiceArea() {
1933
+ const client = useOsiseClient();
1934
+ return useMutation(({ areaId, data }) => client.adminSystem.updateServiceArea(areaId, data));
1935
+ }
1936
+ /**
1937
+ * Hook for deleting a service area
1938
+ */
1939
+ function useDeleteServiceArea() {
1940
+ const client = useOsiseClient();
1941
+ return useMutation((areaId) => client.adminSystem.deleteServiceArea(areaId));
1942
+ }
1943
+ /**
1944
+ * Hook for pricing configuration
1945
+ */
1946
+ function usePricingConfig() {
1947
+ const client = useOsiseClient();
1948
+ const isAuthenticated = useIsAuthenticated();
1949
+ return useQuery(() => client.adminSystem.getPricingConfig(), {
1950
+ enabled: isAuthenticated,
1951
+ });
1952
+ }
1953
+ /**
1954
+ * Hook for updating pricing configuration
1955
+ */
1956
+ function useUpdatePricingConfig() {
1957
+ const client = useOsiseClient();
1958
+ return useMutation((data) => client.adminSystem.updatePricingConfig(data));
1959
+ }
1960
+ /**
1961
+ * Hook for commission configuration
1962
+ */
1963
+ function useCommissionConfig() {
1964
+ const client = useOsiseClient();
1965
+ const isAuthenticated = useIsAuthenticated();
1966
+ return useQuery(() => client.adminSystem.getCommissionConfig(), {
1967
+ enabled: isAuthenticated,
1968
+ });
1969
+ }
1970
+ /**
1971
+ * Hook for updating commission configuration
1972
+ */
1973
+ function useUpdateCommissionConfig() {
1974
+ const client = useOsiseClient();
1975
+ return useMutation((data) => client.adminSystem.updateCommissionConfig(data));
1976
+ }
1977
+ /**
1978
+ * Hook for system settings
1979
+ */
1980
+ function useSystemSettings() {
1981
+ const client = useOsiseClient();
1982
+ const isAuthenticated = useIsAuthenticated();
1983
+ return useQuery(() => client.adminSystem.getSystemSettings(), {
1984
+ enabled: isAuthenticated,
1985
+ });
1986
+ }
1987
+ /**
1988
+ * Hook for updating system settings
1989
+ */
1990
+ function useUpdateSystemSettings() {
1991
+ const client = useOsiseClient();
1992
+ return useMutation((data) => client.adminSystem.updateSystemSettings(data));
1993
+ }
1994
+ /**
1995
+ * Hook for activity logs
1996
+ */
1997
+ function useActivityLogs(params) {
1998
+ const client = useOsiseClient();
1999
+ const isAuthenticated = useIsAuthenticated();
2000
+ return useQuery(() => client.adminSystem.getActivityLogs(params), {
2001
+ enabled: isAuthenticated,
2002
+ });
2003
+ }
2004
+ /**
2005
+ * Hook for activity log detail
2006
+ */
2007
+ function useActivityLog(logId) {
2008
+ const client = useOsiseClient();
2009
+ const isAuthenticated = useIsAuthenticated();
2010
+ return useQuery(() => client.adminSystem.getActivityLog(logId), {
2011
+ enabled: isAuthenticated && !!logId,
2012
+ });
2013
+ }
2014
+ /**
2015
+ * Hook for error logs
2016
+ */
2017
+ function useErrorLogs(params) {
2018
+ const client = useOsiseClient();
2019
+ const isAuthenticated = useIsAuthenticated();
2020
+ return useQuery(() => client.adminSystem.getErrorLogs(params), {
2021
+ enabled: isAuthenticated,
2022
+ });
2023
+ }
2024
+ // ==================== Support Ticket Hooks ====================
2025
+ /**
2026
+ * Hook for getting user's support tickets
2027
+ */
2028
+ function useTickets(params) {
2029
+ const client = useOsiseClient();
2030
+ const isAuthenticated = useIsAuthenticated();
2031
+ return useQuery(() => client.support.getTickets(params), {
2032
+ enabled: isAuthenticated,
2033
+ });
2034
+ }
2035
+ /**
2036
+ * Hook for getting a specific ticket
2037
+ */
2038
+ function useTicket(ticketId) {
2039
+ const client = useOsiseClient();
2040
+ const isAuthenticated = useIsAuthenticated();
2041
+ return useQuery(() => client.support.getTicket(ticketId), {
2042
+ enabled: isAuthenticated && !!ticketId,
2043
+ });
2044
+ }
2045
+ /**
2046
+ * Hook for creating a support ticket
2047
+ */
2048
+ function useCreateTicket() {
2049
+ const client = useOsiseClient();
2050
+ return useMutation((data) => client.support.createTicket(data));
2051
+ }
2052
+ /**
2053
+ * Hook for sending a message in a ticket
2054
+ */
2055
+ function useSendTicketMessage() {
2056
+ const client = useOsiseClient();
2057
+ return useMutation(({ ticketId, data }) => client.support.sendMessage(ticketId, data));
2058
+ }
2059
+ /**
2060
+ * Hook for closing a ticket
2061
+ */
2062
+ function useCloseTicket() {
2063
+ const client = useOsiseClient();
2064
+ return useMutation(({ ticketId, data }) => client.support.closeTicket(ticketId, data));
2065
+ }
2066
+ /**
2067
+ * Hook for rating a ticket
2068
+ */
2069
+ function useRateTicket() {
2070
+ const client = useOsiseClient();
2071
+ return useMutation(({ ticketId, data }) => client.support.rateTicket(ticketId, data));
2072
+ }
2073
+ /**
2074
+ * Hook for marking ticket messages as read
2075
+ */
2076
+ function useMarkTicketMessagesAsRead() {
2077
+ const client = useOsiseClient();
2078
+ return useMutation((ticketId) => client.support.markMessagesAsRead(ticketId));
2079
+ }
2080
+ // ==================== FAQ Hooks ====================
2081
+ /**
2082
+ * Hook for getting FAQ articles
2083
+ */
2084
+ function useFaq(params) {
2085
+ const client = useOsiseClient();
2086
+ return useQuery(() => client.support.getFaq(params));
2087
+ }
2088
+ /**
2089
+ * Hook for searching FAQ articles
2090
+ */
2091
+ function useSearchFaq(params) {
2092
+ const client = useOsiseClient();
2093
+ return useQuery(() => client.support.searchFaq(params), {
2094
+ enabled: !!params.query,
2095
+ });
2096
+ }
2097
+ /**
2098
+ * Hook for getting a specific FAQ article
2099
+ */
2100
+ function useFaqArticle(articleId) {
2101
+ const client = useOsiseClient();
2102
+ return useQuery(() => client.support.getFaqArticle(articleId), {
2103
+ enabled: !!articleId,
2104
+ });
2105
+ }
2106
+ /**
2107
+ * Hook for recording FAQ feedback
2108
+ */
2109
+ function useRecordFaqFeedback() {
2110
+ const client = useOsiseClient();
2111
+ return useMutation(({ articleId, data }) => client.support.recordFaqFeedback(articleId, data));
2112
+ }
2113
+ // ==================== Artisan Support Hooks ====================
2114
+ /**
2115
+ * Hook for reporting an emergency (artisan)
2116
+ */
2117
+ function useReportEmergency() {
2118
+ const client = useOsiseClient();
2119
+ return useMutation((data) => client.artisanSupport.reportEmergency(data));
2120
+ }
2121
+ /**
2122
+ * Hook for getting artisan's support tickets
2123
+ */
2124
+ function useArtisanTickets(params) {
2125
+ const client = useOsiseClient();
2126
+ const isAuthenticated = useIsAuthenticated();
2127
+ return useQuery(() => client.artisanSupport.getTickets(params), {
2128
+ enabled: isAuthenticated,
2129
+ });
2130
+ }
2131
+ /**
2132
+ * Hook for getting a specific artisan ticket
2133
+ */
2134
+ function useArtisanTicket(ticketId) {
2135
+ const client = useOsiseClient();
2136
+ const isAuthenticated = useIsAuthenticated();
2137
+ return useQuery(() => client.artisanSupport.getTicket(ticketId), {
2138
+ enabled: isAuthenticated && !!ticketId,
2139
+ });
2140
+ }
2141
+ /**
2142
+ * Hook for creating an artisan support ticket
2143
+ */
2144
+ function useCreateArtisanTicket() {
2145
+ const client = useOsiseClient();
2146
+ return useMutation((data) => client.artisanSupport.createTicket(data));
2147
+ }
2148
+ /**
2149
+ * Hook for sending a message in an artisan ticket
2150
+ */
2151
+ function useSendArtisanTicketMessage() {
2152
+ const client = useOsiseClient();
2153
+ return useMutation(({ ticketId, data }) => client.artisanSupport.sendMessage(ticketId, data));
2154
+ }
2155
+ /**
2156
+ * Hook for closing an artisan ticket
2157
+ */
2158
+ function useCloseArtisanTicket() {
2159
+ const client = useOsiseClient();
2160
+ return useMutation(({ ticketId, data }) => client.artisanSupport.closeTicket(ticketId, data));
2161
+ }
2162
+ /**
2163
+ * Hook for rating an artisan ticket
2164
+ */
2165
+ function useRateArtisanTicket() {
2166
+ const client = useOsiseClient();
2167
+ return useMutation(({ ticketId, data }) => client.artisanSupport.rateTicket(ticketId, data));
2168
+ }
435
2169
  //# sourceMappingURL=index.js.map