@hed-hog/operations 0.0.325 → 0.0.326

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 (32) hide show
  1. package/dist/controllers/operations-collaborators.controller.d.ts +5 -0
  2. package/dist/controllers/operations-collaborators.controller.d.ts.map +1 -1
  3. package/dist/operations.service.d.ts +9 -1
  4. package/dist/operations.service.d.ts.map +1 -1
  5. package/dist/operations.service.js +140 -26
  6. package/dist/operations.service.js.map +1 -1
  7. package/hedhog/data/integration_event_catalog.yaml +313 -0
  8. package/hedhog/data/setting_group.yaml +21 -0
  9. package/hedhog/frontend/app/_components/collaborator-form-screen.tsx.ejs +410 -23
  10. package/hedhog/frontend/app/_components/my-project-summary-screen.tsx.ejs +504 -375
  11. package/hedhog/frontend/app/_components/project-details-screen.tsx.ejs +258 -230
  12. package/hedhog/frontend/app/_components/task-detail-sheet.tsx.ejs +225 -162
  13. package/hedhog/frontend/app/_components/task-form-sheet.tsx.ejs +484 -230
  14. package/hedhog/frontend/app/_lib/api.ts.ejs +13 -4
  15. package/hedhog/frontend/app/_lib/hooks/use-mention-items.ts.ejs +28 -0
  16. package/hedhog/frontend/app/_lib/types.ts.ejs +30 -29
  17. package/hedhog/frontend/app/my-tasks/page.tsx.ejs +347 -236
  18. package/hedhog/frontend/app/reports/projects/page.tsx.ejs +31 -7
  19. package/hedhog/frontend/messages/en.json +38 -55
  20. package/hedhog/frontend/messages/en.json.ejs +21 -4
  21. package/hedhog/frontend/messages/pt.json +36 -55
  22. package/hedhog/frontend/messages/pt.json.ejs +14 -3
  23. package/hedhog/frontend/src/app/(app)/(libraries)/operations/_lib/types.d.ts +1 -0
  24. package/hedhog/frontend/src/app/(app)/(libraries)/operations/_lib/types.d.ts.map +1 -1
  25. package/hedhog/frontend/src/app/(app)/(libraries)/operations/_lib/types.ts +1 -0
  26. package/hedhog/frontend/src/app/(app)/(libraries)/operations/operations/_lib/types.d.ts +1 -0
  27. package/hedhog/frontend/src/app/(app)/(libraries)/operations/operations/_lib/types.d.ts.map +1 -1
  28. package/hedhog/frontend/src/app/(app)/(libraries)/operations/operations/_lib/types.ts +1 -0
  29. package/hedhog/table/operations_collaborator.yaml +5 -0
  30. package/hedhog/table/operations_collaborator_compensation_history.yaml +4 -0
  31. package/package.json +5 -5
  32. package/src/operations.service.ts +202 -26
@@ -124,6 +124,15 @@ export function createCostType(
124
124
  );
125
125
  }
126
126
 
127
+ // ─── Collaborators ────────────────────────────────────────────────────────────
128
+
129
+ export function fetchCollaborators(request: RequestFn) {
130
+ return fetchOperations<import('./types').OperationsCollaborator[]>(
131
+ request,
132
+ '/operations/collaborators'
133
+ );
134
+ }
135
+
127
136
  // ─── Collaborator Costs ───────────────────────────────────────────────────────
128
137
 
129
138
  export type CollaboratorCost = {
@@ -221,10 +230,10 @@ export function deleteCollaboratorCost(
221
230
 
222
231
  // ─── Currencies ───────────────────────────────────────────────────────────────
223
232
 
224
- export type Currency = Record<string, unknown> & {
225
- id: number;
226
- code: string;
227
- name: string;
233
+ export type Currency = Record<string, unknown> & {
234
+ id: number;
235
+ code: string;
236
+ name: string;
228
237
  symbol: string;
229
238
  status: 'active' | 'inactive';
230
239
  };
@@ -0,0 +1,28 @@
1
+ 'use client';
2
+
3
+ import type { MentionItem } from '@/components/rich-text-editor';
4
+ import { useQuery } from '@hed-hog/next-app-provider';
5
+ import type { AxiosRequestConfig, AxiosResponse } from 'axios';
6
+ import { fetchCollaborators } from '../api';
7
+ import type { OperationsCollaborator } from '../types';
8
+
9
+ type RequestFn = <T extends object>(
10
+ config?: AxiosRequestConfig
11
+ ) => Promise<AxiosResponse<T>>;
12
+
13
+ export function useMentionItems(request: RequestFn): MentionItem[] {
14
+ const { data: collaborators = [] } = useQuery<OperationsCollaborator[]>({
15
+ queryKey: ['operations-collaborators-mention'],
16
+ queryFn: () => fetchCollaborators(request),
17
+ staleTime: 5 * 60 * 1000,
18
+ });
19
+
20
+ return collaborators.map<MentionItem>((c) => ({
21
+ id: c.id,
22
+ label: c.displayName,
23
+ avatarSrc:
24
+ typeof c.personAvatarId === 'number' && c.personAvatarId > 0
25
+ ? `${process.env.NEXT_PUBLIC_API_BASE_URL}/person/avatar/${c.personAvatarId}`
26
+ : null,
27
+ }));
28
+ }
@@ -234,11 +234,11 @@ export type OperationsCollaboratorsReport = {
234
234
  export type OperationsCollaborator = {
235
235
  id: number;
236
236
  userId?: number | null;
237
- personId?: number | null;
238
- personName?: string | null;
239
- personAvatarId?: number | null;
240
- userPhotoId?: number | null;
241
- code: string;
237
+ personId?: number | null;
238
+ personName?: string | null;
239
+ personAvatarId?: number | null;
240
+ userPhotoId?: number | null;
241
+ code: string;
242
242
  collaboratorTypeId?: number | null;
243
243
  collaboratorTypeSlug?: string | null;
244
244
  collaboratorType?: string | null;
@@ -251,6 +251,7 @@ export type OperationsCollaborator = {
251
251
  levelLabel?: string | null;
252
252
  weeklyCapacityHours?: number | null;
253
253
  compensationAmount?: number | null;
254
+ hourlyRate?: number | null;
254
255
  status: string;
255
256
  joinedAt?: string | null;
256
257
  leftAt?: string | null;
@@ -364,10 +365,10 @@ export type OperationsTaskOption = {
364
365
  assigneeUserPhotoId?: number | null;
365
366
  assigneePersonAvatarId?: number | null;
366
367
  commentCount?: number | null;
367
- fileCount?: number | null;
368
- createdAt?: string | null;
369
- deletedAt?: string | null;
370
- };
368
+ fileCount?: number | null;
369
+ createdAt?: string | null;
370
+ deletedAt?: string | null;
371
+ };
371
372
 
372
373
  export type OperationsProject = {
373
374
  id: number;
@@ -759,7 +760,7 @@ export type OperationsContractDetails = OperationsContract & {
759
760
 
760
761
  // ─── Project Cost ─────────────────────────────────────────────────────────────
761
762
 
762
- export interface ProjectCostCategory extends Record<string, unknown> {
763
+ export interface ProjectCostCategory extends Record<string, unknown> {
763
764
  id: number;
764
765
  slug: string;
765
766
  name: string;
@@ -770,7 +771,7 @@ export interface ProjectCostCategory extends Record<string, unknown> {
770
771
  sort_order: number;
771
772
  }
772
773
 
773
- export interface ProjectCostType extends Record<string, unknown> {
774
+ export interface ProjectCostType extends Record<string, unknown> {
774
775
  id: number;
775
776
  category_id?: number;
776
777
  slug: string;
@@ -899,24 +900,24 @@ export interface ProjectCostReport {
899
900
  non_billable_total: number;
900
901
  reimbursable_total: number;
901
902
  };
902
- cost_by_month: Array<{
903
- month: string;
904
- total: number;
905
- count: number;
906
- planned_subtotal?: number;
907
- realized_subtotal?: number;
908
- }>;
909
- cost_by_category: Array<{
910
- category_id?: number | null;
911
- category_slug?: string | null;
912
- category_name: string;
913
- category_color?: string | null;
914
- category_icon?: string | null;
915
- total: number;
916
- count: number;
917
- planned_subtotal?: number;
918
- realized_subtotal?: number;
919
- }>;
903
+ cost_by_month: Array<{
904
+ month: string;
905
+ total: number;
906
+ count: number;
907
+ planned_subtotal?: number;
908
+ realized_subtotal?: number;
909
+ }>;
910
+ cost_by_category: Array<{
911
+ category_id?: number | null;
912
+ category_slug?: string | null;
913
+ category_name: string;
914
+ category_color?: string | null;
915
+ category_icon?: string | null;
916
+ total: number;
917
+ count: number;
918
+ planned_subtotal?: number;
919
+ realized_subtotal?: number;
920
+ }>;
920
921
  top_5_costs: ProjectCostReportItem[];
921
922
  detailed_list: ProjectCostReportItem[];
922
923
  }