@larisarozin/dodone-shared 1.0.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/README.md +116 -0
- package/dist/api/routes.d.ts +66 -0
- package/dist/api/routes.js +87 -0
- package/dist/config/ConfigContext.d.ts +4 -0
- package/dist/config/ConfigContext.js +10 -0
- package/dist/config/ConfigProvider.d.ts +8 -0
- package/dist/config/ConfigProvider.js +8 -0
- package/dist/config/useConfig.d.ts +1 -0
- package/dist/config/useConfig.js +17 -0
- package/dist/config.d.ts +4 -0
- package/dist/config.js +6 -0
- package/dist/hooks/auth/AuthContext.d.ts +6 -0
- package/dist/hooks/auth/AuthContext.js +10 -0
- package/dist/hooks/auth/AuthProvider.d.ts +6 -0
- package/dist/hooks/auth/AuthProvider.js +83 -0
- package/dist/hooks/auth/AuthState.d.ts +20 -0
- package/dist/hooks/auth/AuthState.js +7 -0
- package/dist/hooks/auth/useAuth.d.ts +3 -0
- package/dist/hooks/auth/useAuth.js +17 -0
- package/dist/hooks/useAllowanceHistories.d.ts +9 -0
- package/dist/hooks/useAllowanceHistories.js +87 -0
- package/dist/hooks/useAllowanceHistoryTaskItems.d.ts +7 -0
- package/dist/hooks/useAllowanceHistoryTaskItems.js +69 -0
- package/dist/hooks/useGrades.d.ts +5 -0
- package/dist/hooks/useGrades.js +50 -0
- package/dist/hooks/useNotificationPreferences.d.ts +9 -0
- package/dist/hooks/useNotificationPreferences.js +107 -0
- package/dist/hooks/useTaskCategories.d.ts +7 -0
- package/dist/hooks/useTaskCategories.js +70 -0
- package/dist/hooks/useTaskComments.d.ts +7 -0
- package/dist/hooks/useTaskComments.js +69 -0
- package/dist/hooks/useTaskGroups.d.ts +7 -0
- package/dist/hooks/useTaskGroups.js +70 -0
- package/dist/hooks/useTaskItems.d.ts +7 -0
- package/dist/hooks/useTaskItems.js +70 -0
- package/dist/hooks/useTaskKinds.d.ts +7 -0
- package/dist/hooks/useTaskKinds.js +70 -0
- package/dist/hooks/useTeam.d.ts +24 -0
- package/dist/hooks/useTeam.js +255 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +50 -0
- package/dist/types/AllowanceHistory.d.ts +66 -0
- package/dist/types/AllowanceHistory.js +7 -0
- package/dist/types/AllowanceInterval.d.ts +29 -0
- package/dist/types/AllowanceInterval.js +40 -0
- package/dist/types/ApiResponse.d.ts +7 -0
- package/dist/types/ApiResponse.js +7 -0
- package/dist/types/DeviceRegistration.d.ts +6 -0
- package/dist/types/DeviceRegistration.js +7 -0
- package/dist/types/TaskItem.d.ts +174 -0
- package/dist/types/TaskItem.js +16 -0
- package/dist/types/Team.d.ts +76 -0
- package/dist/types/Team.js +7 -0
- package/dist/types/User.d.ts +91 -0
- package/dist/types/User.js +7 -0
- package/dist/types/UserNotificationPreferences.d.ts +81 -0
- package/dist/types/UserNotificationPreferences.js +68 -0
- package/dist/utils/ApiClient.d.ts +204 -0
- package/dist/utils/ApiClient.js +608 -0
- package/dist/utils/paging.d.ts +305 -0
- package/dist/utils/paging.js +428 -0
- package/dist/utils/storage.d.ts +7 -0
- package/dist/utils/storage.js +37 -0
- package/dist/utils/utils.d.ts +0 -0
- package/dist/utils/utils.js +6 -0
- package/package.json +29 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { User } from "../types/User";
|
|
2
|
+
import { PagedListRequest, PagedListResponse } from "../utils/paging";
|
|
3
|
+
import { TeamDetailsResponse, TeamDetailsUpdateRequest, TeamAllowanceIntervalResponse, TeamAllowanceIntervalCreateRequest, TeamAllowanceIntervalUpdateRequest } from "../types/Team";
|
|
4
|
+
export declare function useTeam(request: PagedListRequest): {
|
|
5
|
+
teamMembersList: PagedListResponse<User> | undefined;
|
|
6
|
+
loadingTeamMembers: boolean;
|
|
7
|
+
refreshTeamMembers: (request: PagedListRequest) => void;
|
|
8
|
+
teamDetails: TeamDetailsResponse | null;
|
|
9
|
+
loadingTeamDetails: boolean;
|
|
10
|
+
updatingTeamDetails: boolean;
|
|
11
|
+
fetchTeamDetails: () => Promise<any>;
|
|
12
|
+
updateTeamDetails: (teamUpdateRequest: TeamDetailsUpdateRequest) => Promise<import("..").DataResponse<TeamDetailsResponse> | null>;
|
|
13
|
+
allowanceIntervals: TeamAllowanceIntervalResponse[];
|
|
14
|
+
loadingAllowanceIntervals: boolean;
|
|
15
|
+
creatingAllowanceInterval: boolean;
|
|
16
|
+
updatingAllowanceInterval: boolean;
|
|
17
|
+
deletingAllowanceInterval: boolean;
|
|
18
|
+
fetchingAllowanceInterval: boolean;
|
|
19
|
+
fetchAllowanceIntervals: () => Promise<import("../types/Team").TeamAllowanceIntervalListResponse | null>;
|
|
20
|
+
fetchAllowanceInterval: (id: number) => Promise<TeamAllowanceIntervalResponse | null>;
|
|
21
|
+
createAllowanceInterval: (request: TeamAllowanceIntervalCreateRequest) => Promise<TeamAllowanceIntervalResponse | null>;
|
|
22
|
+
updateAllowanceInterval: (request: TeamAllowanceIntervalUpdateRequest) => Promise<TeamAllowanceIntervalResponse | null>;
|
|
23
|
+
deleteAllowanceInterval: (id: number) => Promise<boolean>;
|
|
24
|
+
};
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2025 Larisa Rozin
|
|
4
|
+
* dodone-shared - Task Management, Allowance & Bonus Tracking Application Package
|
|
5
|
+
* All rights reserved.
|
|
6
|
+
*/
|
|
7
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
8
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
9
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
10
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
11
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
12
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
13
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.useTeam = useTeam;
|
|
18
|
+
const react_1 = require("react");
|
|
19
|
+
const useConfig_1 = require("../config/useConfig");
|
|
20
|
+
const useAuth_1 = require("./auth/useAuth");
|
|
21
|
+
const ApiClient_1 = require("../utils/ApiClient");
|
|
22
|
+
function useTeam(request) {
|
|
23
|
+
const { token } = (0, useAuth_1.useAuth)();
|
|
24
|
+
const { baseUrl } = (0, useConfig_1.useConfig)();
|
|
25
|
+
const [pagedListRequest, setPagedListRequest] = (0, react_1.useState)(request);
|
|
26
|
+
const [teamMembersList, setPagedTeam] = (0, react_1.useState)();
|
|
27
|
+
const [loadingTeamMembers, setLoading] = (0, react_1.useState)(true);
|
|
28
|
+
const [teamDetails, setTeamDetails] = (0, react_1.useState)(null);
|
|
29
|
+
const [loadingTeamDetails, setLoadingTeamDetails] = (0, react_1.useState)(false);
|
|
30
|
+
const [updatingTeamDetails, setUpdatingTeamDetails] = (0, react_1.useState)(false);
|
|
31
|
+
const [allowanceIntervals, setAllowanceIntervals] = (0, react_1.useState)([]);
|
|
32
|
+
const [loadingAllowanceIntervals, setLoadingAllowanceIntervals] = (0, react_1.useState)(false);
|
|
33
|
+
const [creatingAllowanceInterval, setCreatingAllowanceInterval] = (0, react_1.useState)(false);
|
|
34
|
+
const [updatingAllowanceInterval, setUpdatingAllowanceInterval] = (0, react_1.useState)(false);
|
|
35
|
+
const [deletingAllowanceInterval, setDeletingAllowanceInterval] = (0, react_1.useState)(false);
|
|
36
|
+
const [fetchingAllowanceInterval, setFetchingAllowanceInterval] = (0, react_1.useState)(false);
|
|
37
|
+
const fetchTeamMembers = (0, react_1.useCallback)((requestToUse) => __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
const requestToFetch = requestToUse || pagedListRequest;
|
|
39
|
+
if (!token) {
|
|
40
|
+
setLoading(false);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (!requestToFetch) {
|
|
44
|
+
console.error("No request available for fetching team members");
|
|
45
|
+
setLoading(false);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
setLoading(true);
|
|
49
|
+
try {
|
|
50
|
+
const apiClient = (0, ApiClient_1.createApiClient)(baseUrl, token);
|
|
51
|
+
const data = yield apiClient.teams.getTeamMembers(requestToFetch);
|
|
52
|
+
if (!data || data.success === false) {
|
|
53
|
+
console.error("Failed to fetch team members:", (data === null || data === void 0 ? void 0 : data.message) || "Unknown error");
|
|
54
|
+
setLoading(false);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
setPagedTeam(data);
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
console.error("Error fetching team members:", error);
|
|
61
|
+
}
|
|
62
|
+
finally {
|
|
63
|
+
setLoading(false);
|
|
64
|
+
}
|
|
65
|
+
}), [token, baseUrl]);
|
|
66
|
+
function refreshTeamMembers(request) {
|
|
67
|
+
setPagedListRequest(request);
|
|
68
|
+
// Pass the request directly to fetchTeam to avoid state timing issues
|
|
69
|
+
fetchTeamMembers(request);
|
|
70
|
+
}
|
|
71
|
+
const fetchTeamDetails = (0, react_1.useCallback)(() => __awaiter(this, void 0, void 0, function* () {
|
|
72
|
+
if (!token) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
setLoadingTeamDetails(true);
|
|
76
|
+
try {
|
|
77
|
+
const apiClient = (0, ApiClient_1.createApiClient)(baseUrl, token);
|
|
78
|
+
const data = yield apiClient.teams.getTeamDetails();
|
|
79
|
+
if (!data || data.success === false) {
|
|
80
|
+
console.error("Failed to fetch team details:", (data === null || data === void 0 ? void 0 : data.message) || "Unknown error");
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
setTeamDetails(data);
|
|
84
|
+
return data;
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
console.error("Error fetching team details:", error);
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
finally {
|
|
91
|
+
setLoadingTeamDetails(false);
|
|
92
|
+
}
|
|
93
|
+
}), [token, baseUrl]);
|
|
94
|
+
const updateTeamDetails = (0, react_1.useCallback)((teamUpdateRequest) => __awaiter(this, void 0, void 0, function* () {
|
|
95
|
+
if (!token) {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
setUpdatingTeamDetails(true);
|
|
99
|
+
try {
|
|
100
|
+
const apiClient = (0, ApiClient_1.createApiClient)(baseUrl, token);
|
|
101
|
+
const response = yield apiClient.teams.updateTeamDetails(teamUpdateRequest);
|
|
102
|
+
if (!response || response.success === false) {
|
|
103
|
+
console.error("Failed to update team details:", (response === null || response === void 0 ? void 0 : response.message) || "Unknown error");
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
// Update local state with the updated team details
|
|
107
|
+
if (response.data) {
|
|
108
|
+
// Convert TeamResponse to TeamDetailsResponse format for consistency
|
|
109
|
+
const updatedTeamDetails = Object.assign({}, response.data);
|
|
110
|
+
setTeamDetails(updatedTeamDetails);
|
|
111
|
+
}
|
|
112
|
+
return response;
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
console.error("Error updating team details:", error);
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
finally {
|
|
119
|
+
setUpdatingTeamDetails(false);
|
|
120
|
+
}
|
|
121
|
+
}), [token, baseUrl]);
|
|
122
|
+
const fetchAllowanceIntervals = (0, react_1.useCallback)(() => __awaiter(this, void 0, void 0, function* () {
|
|
123
|
+
if (!token) {
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
setLoadingAllowanceIntervals(true);
|
|
127
|
+
try {
|
|
128
|
+
const apiClient = (0, ApiClient_1.createApiClient)(baseUrl, token);
|
|
129
|
+
const data = yield apiClient.teams.getTeamAllowanceIntervals();
|
|
130
|
+
setAllowanceIntervals(data.allowanceIntervals || []);
|
|
131
|
+
return data;
|
|
132
|
+
}
|
|
133
|
+
catch (error) {
|
|
134
|
+
console.error("Error fetching allowance intervals:", error);
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
finally {
|
|
138
|
+
setLoadingAllowanceIntervals(false);
|
|
139
|
+
}
|
|
140
|
+
}), [token, baseUrl]);
|
|
141
|
+
const fetchAllowanceInterval = (0, react_1.useCallback)((id) => __awaiter(this, void 0, void 0, function* () {
|
|
142
|
+
if (!token) {
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
setFetchingAllowanceInterval(true);
|
|
146
|
+
try {
|
|
147
|
+
const apiClient = (0, ApiClient_1.createApiClient)(baseUrl, token);
|
|
148
|
+
const data = yield apiClient.teams.getTeamAllowanceInterval(id);
|
|
149
|
+
return data;
|
|
150
|
+
}
|
|
151
|
+
catch (error) {
|
|
152
|
+
console.error("Error fetching allowance interval:", error);
|
|
153
|
+
return null;
|
|
154
|
+
}
|
|
155
|
+
finally {
|
|
156
|
+
setFetchingAllowanceInterval(false);
|
|
157
|
+
}
|
|
158
|
+
}), [token, baseUrl]);
|
|
159
|
+
const createAllowanceInterval = (0, react_1.useCallback)((request) => __awaiter(this, void 0, void 0, function* () {
|
|
160
|
+
if (!token) {
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
163
|
+
setCreatingAllowanceInterval(true);
|
|
164
|
+
try {
|
|
165
|
+
const apiClient = (0, ApiClient_1.createApiClient)(baseUrl, token);
|
|
166
|
+
const response = yield apiClient.teams.createTeamAllowanceInterval(request);
|
|
167
|
+
// Refresh the allowance intervals list after creation
|
|
168
|
+
yield fetchAllowanceIntervals();
|
|
169
|
+
return response;
|
|
170
|
+
}
|
|
171
|
+
catch (error) {
|
|
172
|
+
console.error("Error creating allowance interval:", error);
|
|
173
|
+
return null;
|
|
174
|
+
}
|
|
175
|
+
finally {
|
|
176
|
+
setCreatingAllowanceInterval(false);
|
|
177
|
+
}
|
|
178
|
+
}), [token, baseUrl, fetchAllowanceIntervals]);
|
|
179
|
+
const updateAllowanceInterval = (0, react_1.useCallback)((request) => __awaiter(this, void 0, void 0, function* () {
|
|
180
|
+
if (!token) {
|
|
181
|
+
return null;
|
|
182
|
+
}
|
|
183
|
+
setUpdatingAllowanceInterval(true);
|
|
184
|
+
try {
|
|
185
|
+
const apiClient = (0, ApiClient_1.createApiClient)(baseUrl, token);
|
|
186
|
+
const response = yield apiClient.teams.updateTeamAllowanceInterval(request);
|
|
187
|
+
// Update the local state with the updated allowance interval
|
|
188
|
+
setAllowanceIntervals(prev => prev.map(interval => interval.id === request.id ? response : interval));
|
|
189
|
+
return response;
|
|
190
|
+
}
|
|
191
|
+
catch (error) {
|
|
192
|
+
console.error("Error updating allowance interval:", error);
|
|
193
|
+
return null;
|
|
194
|
+
}
|
|
195
|
+
finally {
|
|
196
|
+
setUpdatingAllowanceInterval(false);
|
|
197
|
+
}
|
|
198
|
+
}), [token, baseUrl]);
|
|
199
|
+
const deleteAllowanceInterval = (0, react_1.useCallback)((id) => __awaiter(this, void 0, void 0, function* () {
|
|
200
|
+
if (!token) {
|
|
201
|
+
return false;
|
|
202
|
+
}
|
|
203
|
+
setDeletingAllowanceInterval(true);
|
|
204
|
+
try {
|
|
205
|
+
const apiClient = (0, ApiClient_1.createApiClient)(baseUrl, token);
|
|
206
|
+
const success = yield apiClient.teams.deleteTeamAllowanceInterval(id);
|
|
207
|
+
if (!success) {
|
|
208
|
+
console.error("Failed to delete allowance interval");
|
|
209
|
+
return false;
|
|
210
|
+
}
|
|
211
|
+
// Remove the deleted interval from local state
|
|
212
|
+
setAllowanceIntervals(prev => prev.filter(interval => interval.id !== id));
|
|
213
|
+
return true;
|
|
214
|
+
}
|
|
215
|
+
catch (error) {
|
|
216
|
+
console.error("Error deleting allowance interval:", error);
|
|
217
|
+
return false;
|
|
218
|
+
}
|
|
219
|
+
finally {
|
|
220
|
+
setDeletingAllowanceInterval(false);
|
|
221
|
+
}
|
|
222
|
+
}), [token, baseUrl]);
|
|
223
|
+
(0, react_1.useEffect)(() => {
|
|
224
|
+
if (!token) {
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
// Only fetch on initial load if we have a valid request
|
|
228
|
+
fetchTeamDetails();
|
|
229
|
+
fetchAllowanceIntervals();
|
|
230
|
+
if (pagedListRequest) {
|
|
231
|
+
fetchTeamMembers(pagedListRequest);
|
|
232
|
+
}
|
|
233
|
+
}, [fetchTeamDetails, fetchAllowanceIntervals, fetchTeamMembers, pagedListRequest]);
|
|
234
|
+
return {
|
|
235
|
+
teamMembersList,
|
|
236
|
+
loadingTeamMembers,
|
|
237
|
+
refreshTeamMembers,
|
|
238
|
+
teamDetails,
|
|
239
|
+
loadingTeamDetails,
|
|
240
|
+
updatingTeamDetails,
|
|
241
|
+
fetchTeamDetails,
|
|
242
|
+
updateTeamDetails,
|
|
243
|
+
allowanceIntervals,
|
|
244
|
+
loadingAllowanceIntervals,
|
|
245
|
+
creatingAllowanceInterval,
|
|
246
|
+
updatingAllowanceInterval,
|
|
247
|
+
deletingAllowanceInterval,
|
|
248
|
+
fetchingAllowanceInterval,
|
|
249
|
+
fetchAllowanceIntervals,
|
|
250
|
+
fetchAllowanceInterval,
|
|
251
|
+
createAllowanceInterval,
|
|
252
|
+
updateAllowanceInterval,
|
|
253
|
+
deleteAllowanceInterval
|
|
254
|
+
};
|
|
255
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export * from './types/User';
|
|
2
|
+
export * from './types/TaskItem';
|
|
3
|
+
export * from './types/ApiResponse';
|
|
4
|
+
export * from './api/routes';
|
|
5
|
+
export * from './hooks/auth/useAuth';
|
|
6
|
+
export * from './hooks/auth/AuthState';
|
|
7
|
+
export * from './hooks/auth/AuthProvider';
|
|
8
|
+
export * from './hooks/auth/AuthContext';
|
|
9
|
+
export * from './hooks/useTeam';
|
|
10
|
+
export * from './hooks/useTaskItems';
|
|
11
|
+
export * from './hooks/useTaskGroups';
|
|
12
|
+
export * from './hooks/useTaskKinds';
|
|
13
|
+
export * from './hooks/useTaskCategories';
|
|
14
|
+
export * from './hooks/useTaskComments';
|
|
15
|
+
export * from './hooks/useGrades';
|
|
16
|
+
export * from './hooks/useAllowanceHistories';
|
|
17
|
+
export * from './hooks/useAllowanceHistoryTaskItems';
|
|
18
|
+
export * from './hooks/useNotificationPreferences';
|
|
19
|
+
export * from './config/ConfigContext';
|
|
20
|
+
export * from './config/ConfigProvider';
|
|
21
|
+
export * from './config/useConfig';
|
|
22
|
+
export * from './utils/storage';
|
|
23
|
+
export * from './utils/ApiClient';
|
|
24
|
+
export * from './utils/paging';
|
|
25
|
+
export * from './types/DeviceRegistration';
|
|
26
|
+
export * from './types/AllowanceHistory';
|
|
27
|
+
export * from './types/UserNotificationPreferences';
|
|
28
|
+
export * from './types/AllowanceInterval';
|
|
29
|
+
export * from './types/Team';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2025 Larisa Rozin
|
|
4
|
+
* dodone-shared - Task Management, Allowance & Bonus Tracking Application Package
|
|
5
|
+
* All rights reserved.
|
|
6
|
+
*/
|
|
7
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
8
|
+
if (k2 === undefined) k2 = k;
|
|
9
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
10
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
11
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
12
|
+
}
|
|
13
|
+
Object.defineProperty(o, k2, desc);
|
|
14
|
+
}) : (function(o, m, k, k2) {
|
|
15
|
+
if (k2 === undefined) k2 = k;
|
|
16
|
+
o[k2] = m[k];
|
|
17
|
+
}));
|
|
18
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
19
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
__exportStar(require("./types/User"), exports);
|
|
23
|
+
__exportStar(require("./types/TaskItem"), exports);
|
|
24
|
+
__exportStar(require("./types/ApiResponse"), exports);
|
|
25
|
+
__exportStar(require("./api/routes"), exports);
|
|
26
|
+
__exportStar(require("./hooks/auth/useAuth"), exports);
|
|
27
|
+
__exportStar(require("./hooks/auth/AuthState"), exports);
|
|
28
|
+
__exportStar(require("./hooks/auth/AuthProvider"), exports);
|
|
29
|
+
__exportStar(require("./hooks/auth/AuthContext"), exports);
|
|
30
|
+
__exportStar(require("./hooks/useTeam"), exports);
|
|
31
|
+
__exportStar(require("./hooks/useTaskItems"), exports);
|
|
32
|
+
__exportStar(require("./hooks/useTaskGroups"), exports);
|
|
33
|
+
__exportStar(require("./hooks/useTaskKinds"), exports);
|
|
34
|
+
__exportStar(require("./hooks/useTaskCategories"), exports);
|
|
35
|
+
__exportStar(require("./hooks/useTaskComments"), exports);
|
|
36
|
+
__exportStar(require("./hooks/useGrades"), exports);
|
|
37
|
+
__exportStar(require("./hooks/useAllowanceHistories"), exports);
|
|
38
|
+
__exportStar(require("./hooks/useAllowanceHistoryTaskItems"), exports);
|
|
39
|
+
__exportStar(require("./hooks/useNotificationPreferences"), exports);
|
|
40
|
+
__exportStar(require("./config/ConfigContext"), exports);
|
|
41
|
+
__exportStar(require("./config/ConfigProvider"), exports);
|
|
42
|
+
__exportStar(require("./config/useConfig"), exports);
|
|
43
|
+
__exportStar(require("./utils/storage"), exports);
|
|
44
|
+
__exportStar(require("./utils/ApiClient"), exports);
|
|
45
|
+
__exportStar(require("./utils/paging"), exports);
|
|
46
|
+
__exportStar(require("./types/DeviceRegistration"), exports);
|
|
47
|
+
__exportStar(require("./types/AllowanceHistory"), exports);
|
|
48
|
+
__exportStar(require("./types/UserNotificationPreferences"), exports);
|
|
49
|
+
__exportStar(require("./types/AllowanceInterval"), exports);
|
|
50
|
+
__exportStar(require("./types/Team"), exports);
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { PagingRequest } from "../utils/paging";
|
|
2
|
+
import { AllowanceDayOfWeek, AllowanceIntervalType } from "./AllowanceInterval";
|
|
3
|
+
export interface AllowanceHistoryResponse {
|
|
4
|
+
id: number;
|
|
5
|
+
teamId: number;
|
|
6
|
+
userId?: number;
|
|
7
|
+
teamAllowanceIntervalId: number;
|
|
8
|
+
teamAllowanceIntervalName: string;
|
|
9
|
+
allowanceIntervalType: AllowanceIntervalType;
|
|
10
|
+
allowanceIntervalValue: number;
|
|
11
|
+
allowanceStartDayOfWeek?: AllowanceDayOfWeek;
|
|
12
|
+
allowanceStartMonthOfYear?: number;
|
|
13
|
+
calculatedStartAt: string;
|
|
14
|
+
actualStartAt: string;
|
|
15
|
+
calculatedEndAt: string;
|
|
16
|
+
totalCredits: number;
|
|
17
|
+
gpa: number;
|
|
18
|
+
calculatedAmount: number;
|
|
19
|
+
approvedAmount?: number;
|
|
20
|
+
isApproved: boolean;
|
|
21
|
+
isRejected: boolean;
|
|
22
|
+
comment?: string;
|
|
23
|
+
createdAt: string;
|
|
24
|
+
createdBy?: number;
|
|
25
|
+
updatedAt?: string;
|
|
26
|
+
updatedBy?: number;
|
|
27
|
+
approvedAt?: string;
|
|
28
|
+
approvedBy?: number;
|
|
29
|
+
claimedAt?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface AllowanceHistoryApprovalRequest {
|
|
32
|
+
id: number;
|
|
33
|
+
approvedAmount?: number;
|
|
34
|
+
comment?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface AllowanceHistoryClaimRequest {
|
|
37
|
+
id: number;
|
|
38
|
+
}
|
|
39
|
+
export interface AllowanceHistoryTaskItemResponse {
|
|
40
|
+
id: number;
|
|
41
|
+
allowanceHistoryId: number;
|
|
42
|
+
taskItemId: number;
|
|
43
|
+
credits: number;
|
|
44
|
+
gradeId: number;
|
|
45
|
+
percentComplete: number;
|
|
46
|
+
completedAt?: string;
|
|
47
|
+
completedBy?: number;
|
|
48
|
+
assignedTo: number;
|
|
49
|
+
assignedBy: number;
|
|
50
|
+
assignedAt?: string;
|
|
51
|
+
gradedAt?: string;
|
|
52
|
+
gradedBy?: number;
|
|
53
|
+
createdAt: string;
|
|
54
|
+
updatedAt?: string;
|
|
55
|
+
}
|
|
56
|
+
export interface PagedAllowanceHistoriesListRequest {
|
|
57
|
+
teamId: number;
|
|
58
|
+
userId?: number;
|
|
59
|
+
startAt?: string;
|
|
60
|
+
endAt?: string;
|
|
61
|
+
paging: PagingRequest;
|
|
62
|
+
}
|
|
63
|
+
export interface PagedAllowanceHistoryTaskItemsListRequest {
|
|
64
|
+
allowanceHistoryId: number;
|
|
65
|
+
paging: PagingRequest;
|
|
66
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare enum AllowanceIntervalType {
|
|
2
|
+
Weekly = 1,
|
|
3
|
+
Monthly = 2,
|
|
4
|
+
Quarterly = 3,
|
|
5
|
+
SchoolYear = 4
|
|
6
|
+
}
|
|
7
|
+
export declare enum AllowanceDayOfWeek {
|
|
8
|
+
Sunday = 0,
|
|
9
|
+
Monday = 1,
|
|
10
|
+
Tuesday = 2,
|
|
11
|
+
Wednesday = 3,
|
|
12
|
+
Thursday = 4,
|
|
13
|
+
Friday = 5,
|
|
14
|
+
Saturday = 6
|
|
15
|
+
}
|
|
16
|
+
export declare enum AllowanceMonthOfYear {
|
|
17
|
+
January = 1,
|
|
18
|
+
February = 2,
|
|
19
|
+
March = 3,
|
|
20
|
+
April = 4,
|
|
21
|
+
May = 5,
|
|
22
|
+
June = 6,
|
|
23
|
+
July = 7,
|
|
24
|
+
August = 8,
|
|
25
|
+
September = 9,
|
|
26
|
+
October = 10,
|
|
27
|
+
November = 11,
|
|
28
|
+
December = 12
|
|
29
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2025 Larisa Rozin
|
|
4
|
+
* dodone-shared - Task Management, Allowance & Bonus Tracking Application Package
|
|
5
|
+
* All rights reserved.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.AllowanceMonthOfYear = exports.AllowanceDayOfWeek = exports.AllowanceIntervalType = void 0;
|
|
9
|
+
var AllowanceIntervalType;
|
|
10
|
+
(function (AllowanceIntervalType) {
|
|
11
|
+
AllowanceIntervalType[AllowanceIntervalType["Weekly"] = 1] = "Weekly";
|
|
12
|
+
AllowanceIntervalType[AllowanceIntervalType["Monthly"] = 2] = "Monthly";
|
|
13
|
+
AllowanceIntervalType[AllowanceIntervalType["Quarterly"] = 3] = "Quarterly";
|
|
14
|
+
AllowanceIntervalType[AllowanceIntervalType["SchoolYear"] = 4] = "SchoolYear";
|
|
15
|
+
})(AllowanceIntervalType || (exports.AllowanceIntervalType = AllowanceIntervalType = {}));
|
|
16
|
+
var AllowanceDayOfWeek;
|
|
17
|
+
(function (AllowanceDayOfWeek) {
|
|
18
|
+
AllowanceDayOfWeek[AllowanceDayOfWeek["Sunday"] = 0] = "Sunday";
|
|
19
|
+
AllowanceDayOfWeek[AllowanceDayOfWeek["Monday"] = 1] = "Monday";
|
|
20
|
+
AllowanceDayOfWeek[AllowanceDayOfWeek["Tuesday"] = 2] = "Tuesday";
|
|
21
|
+
AllowanceDayOfWeek[AllowanceDayOfWeek["Wednesday"] = 3] = "Wednesday";
|
|
22
|
+
AllowanceDayOfWeek[AllowanceDayOfWeek["Thursday"] = 4] = "Thursday";
|
|
23
|
+
AllowanceDayOfWeek[AllowanceDayOfWeek["Friday"] = 5] = "Friday";
|
|
24
|
+
AllowanceDayOfWeek[AllowanceDayOfWeek["Saturday"] = 6] = "Saturday";
|
|
25
|
+
})(AllowanceDayOfWeek || (exports.AllowanceDayOfWeek = AllowanceDayOfWeek = {}));
|
|
26
|
+
var AllowanceMonthOfYear;
|
|
27
|
+
(function (AllowanceMonthOfYear) {
|
|
28
|
+
AllowanceMonthOfYear[AllowanceMonthOfYear["January"] = 1] = "January";
|
|
29
|
+
AllowanceMonthOfYear[AllowanceMonthOfYear["February"] = 2] = "February";
|
|
30
|
+
AllowanceMonthOfYear[AllowanceMonthOfYear["March"] = 3] = "March";
|
|
31
|
+
AllowanceMonthOfYear[AllowanceMonthOfYear["April"] = 4] = "April";
|
|
32
|
+
AllowanceMonthOfYear[AllowanceMonthOfYear["May"] = 5] = "May";
|
|
33
|
+
AllowanceMonthOfYear[AllowanceMonthOfYear["June"] = 6] = "June";
|
|
34
|
+
AllowanceMonthOfYear[AllowanceMonthOfYear["July"] = 7] = "July";
|
|
35
|
+
AllowanceMonthOfYear[AllowanceMonthOfYear["August"] = 8] = "August";
|
|
36
|
+
AllowanceMonthOfYear[AllowanceMonthOfYear["September"] = 9] = "September";
|
|
37
|
+
AllowanceMonthOfYear[AllowanceMonthOfYear["October"] = 10] = "October";
|
|
38
|
+
AllowanceMonthOfYear[AllowanceMonthOfYear["November"] = 11] = "November";
|
|
39
|
+
AllowanceMonthOfYear[AllowanceMonthOfYear["December"] = 12] = "December";
|
|
40
|
+
})(AllowanceMonthOfYear || (exports.AllowanceMonthOfYear = AllowanceMonthOfYear = {}));
|