@hed-hog/operations 0.0.304 → 0.0.306
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/controllers/operations-projects.controller.d.ts +15 -0
- package/dist/controllers/operations-projects.controller.d.ts.map +1 -1
- package/dist/controllers/operations-tasks.controller.d.ts +41 -10
- package/dist/controllers/operations-tasks.controller.d.ts.map +1 -1
- package/dist/controllers/operations-tasks.controller.js +11 -0
- package/dist/controllers/operations-tasks.controller.js.map +1 -1
- package/dist/controllers/operations-timesheets.controller.d.ts +21 -0
- package/dist/controllers/operations-timesheets.controller.d.ts.map +1 -1
- package/dist/controllers/operations-timesheets.controller.js +12 -0
- package/dist/controllers/operations-timesheets.controller.js.map +1 -1
- package/dist/dto/create-task.dto.d.ts +7 -1
- package/dist/dto/create-task.dto.d.ts.map +1 -1
- package/dist/dto/create-task.dto.js +38 -5
- package/dist/dto/create-task.dto.js.map +1 -1
- package/dist/dto/list-tasks.dto.d.ts +1 -1
- package/dist/dto/list-tasks.dto.d.ts.map +1 -1
- package/dist/dto/list-tasks.dto.js +2 -2
- package/dist/dto/list-tasks.dto.js.map +1 -1
- package/dist/dto/update-collaborator-type.dto.d.ts +3 -1
- package/dist/dto/update-collaborator-type.dto.d.ts.map +1 -1
- package/dist/dto/update-collaborator-type.dto.js +2 -1
- package/dist/dto/update-collaborator-type.dto.js.map +1 -1
- package/dist/dto/update-task.dto.d.ts +7 -1
- package/dist/dto/update-task.dto.d.ts.map +1 -1
- package/dist/dto/update-task.dto.js +38 -5
- package/dist/dto/update-task.dto.js.map +1 -1
- package/dist/operations.service.d.ts +90 -12
- package/dist/operations.service.d.ts.map +1 -1
- package/dist/operations.service.js +560 -148
- package/dist/operations.service.js.map +1 -1
- package/dist/operations.service.spec.js +73 -0
- package/dist/operations.service.spec.js.map +1 -1
- package/hedhog/data/menu.yaml +26 -26
- package/hedhog/data/operations_collaborator_type.yaml +76 -76
- package/hedhog/data/route.yaml +26 -0
- package/hedhog/frontend/app/_components/async-options-combobox.tsx.ejs +5 -3
- package/hedhog/frontend/app/_components/collaborator-details-screen.tsx.ejs +44 -44
- package/hedhog/frontend/app/_components/collaborator-form-screen.tsx.ejs +168 -213
- package/hedhog/frontend/app/_components/collaborator-select-with-create.tsx.ejs +256 -256
- package/hedhog/frontend/app/_components/contract-form-screen.tsx.ejs +7 -7
- package/hedhog/frontend/app/_components/contract-template-form-screen.tsx.ejs +306 -306
- package/hedhog/frontend/app/_components/contract-template-select-with-create.tsx.ejs +247 -247
- package/hedhog/frontend/app/_components/contract-wizard-sheet.tsx.ejs +3520 -3520
- package/hedhog/frontend/app/_components/project-details-screen.tsx.ejs +1504 -52
- package/hedhog/frontend/app/_components/project-form-screen.tsx.ejs +528 -403
- package/hedhog/frontend/app/_components/section-card.tsx.ejs +25 -18
- package/hedhog/frontend/app/_components/system-user-select-with-create.tsx.ejs +609 -0
- package/hedhog/frontend/app/_components/timesheet-task-create-sheet.tsx.ejs +1 -0
- package/hedhog/frontend/app/_lib/types.ts.ejs +5 -0
- package/hedhog/frontend/app/_lib/utils/format.ts.ejs +7 -7
- package/hedhog/frontend/app/_lib/utils/forms.ts.ejs +48 -1
- package/hedhog/frontend/app/approvals/page.tsx.ejs +2 -2
- package/hedhog/frontend/app/collaborator-types/page.tsx.ejs +513 -502
- package/hedhog/frontend/app/collaborators/page.tsx.ejs +10 -7
- package/hedhog/frontend/app/contracts/page.tsx.ejs +938 -938
- package/hedhog/frontend/app/projects/[id]/edit/page.tsx.ejs +1 -1
- package/hedhog/frontend/app/projects/page.tsx.ejs +360 -133
- package/hedhog/frontend/app/schedule-adjustments/page.tsx.ejs +235 -72
- package/hedhog/frontend/app/timesheets/page.tsx.ejs +344 -134
- package/hedhog/frontend/messages/en.json +32 -4
- package/hedhog/frontend/messages/pt.json +34 -6
- package/hedhog/table/operations_collaborator.yaml +18 -18
- package/hedhog/table/operations_collaborator_equity_participation.yaml +43 -43
- package/hedhog/table/operations_collaborator_type.yaml +33 -33
- package/hedhog/table/operations_contract_document.yaml +33 -33
- package/hedhog/table/operations_project.yaml +9 -0
- package/hedhog/table/operations_task.yaml +43 -4
- package/package.json +6 -6
- package/src/controllers/operations-tasks.controller.ts +11 -0
- package/src/controllers/operations-timesheets.controller.ts +13 -0
- package/src/dto/create-collaborator-type.dto.ts +43 -43
- package/src/dto/create-collaborator.dto.ts +223 -223
- package/src/dto/create-task.dto.ts +47 -7
- package/src/dto/list-collaborator-types.dto.ts +15 -15
- package/src/dto/list-collaborators.dto.ts +30 -30
- package/src/dto/list-tasks.dto.ts +3 -3
- package/src/dto/update-collaborator-type.dto.ts +4 -3
- package/src/dto/update-collaborator.dto.ts +3 -3
- package/src/dto/update-task.dto.ts +47 -7
- package/src/operations.service.spec.ts +96 -0
- package/src/operations.service.ts +813 -135
|
@@ -20,7 +20,7 @@ function resolveLocale(currentLocaleCode: string) {
|
|
|
20
20
|
export function formatDate(
|
|
21
21
|
value?: string | null,
|
|
22
22
|
getSettingValue?: ((key: string) => unknown) | null,
|
|
23
|
-
currentLocaleCode = '
|
|
23
|
+
currentLocaleCode = 'pt-BR'
|
|
24
24
|
) {
|
|
25
25
|
if (!value) {
|
|
26
26
|
return '-';
|
|
@@ -47,8 +47,8 @@ export function formatDate(
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
return parsedDate.toLocaleDateString(resolveLocale(currentLocaleCode), {
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
day: '2-digit',
|
|
51
|
+
month: '2-digit',
|
|
52
52
|
year: 'numeric',
|
|
53
53
|
});
|
|
54
54
|
}
|
|
@@ -56,7 +56,7 @@ export function formatDate(
|
|
|
56
56
|
export function formatDateTime(
|
|
57
57
|
value?: string | null,
|
|
58
58
|
getSettingValue?: ((key: string) => unknown) | null,
|
|
59
|
-
currentLocaleCode = '
|
|
59
|
+
currentLocaleCode = 'pt-BR'
|
|
60
60
|
) {
|
|
61
61
|
if (!value) {
|
|
62
62
|
return '-';
|
|
@@ -81,8 +81,8 @@ export function formatDateTime(
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
return parsedDate.toLocaleString(resolveLocale(currentLocaleCode), {
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
day: '2-digit',
|
|
85
|
+
month: '2-digit',
|
|
86
86
|
year: 'numeric',
|
|
87
87
|
hour: '2-digit',
|
|
88
88
|
minute: '2-digit',
|
|
@@ -169,7 +169,7 @@ export function formatDateRange(
|
|
|
169
169
|
startDate?: string | null,
|
|
170
170
|
endDate?: string | null,
|
|
171
171
|
getSettingValue?: ((key: string) => unknown) | null,
|
|
172
|
-
currentLocaleCode = '
|
|
172
|
+
currentLocaleCode = 'pt-BR'
|
|
173
173
|
) {
|
|
174
174
|
if (!startDate && !endDate) {
|
|
175
175
|
return '-';
|
|
@@ -4,10 +4,57 @@ export function parseNumberInput(value: string) {
|
|
|
4
4
|
return null;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
const
|
|
7
|
+
const normalized = /[.,]/.test(trimmed)
|
|
8
|
+
? trimmed.replace(/\./g, '').replace(',', '.')
|
|
9
|
+
: trimmed;
|
|
10
|
+
|
|
11
|
+
const parsed = Number(normalized);
|
|
8
12
|
return Number.isFinite(parsed) ? parsed : null;
|
|
9
13
|
}
|
|
10
14
|
|
|
15
|
+
export function normalizePercentInput(value: string) {
|
|
16
|
+
const trimmed = value.trim();
|
|
17
|
+
|
|
18
|
+
if (!trimmed) {
|
|
19
|
+
return '';
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const withNormalizedSeparator = trimmed.replace(/,/g, '.');
|
|
23
|
+
const digitsAndSeparatorsOnly = withNormalizedSeparator.replace(
|
|
24
|
+
/[^0-9.]/g,
|
|
25
|
+
''
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
if (!digitsAndSeparatorsOnly) {
|
|
29
|
+
return '';
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const separatorIndex = digitsAndSeparatorsOnly.indexOf('.');
|
|
33
|
+
const normalized =
|
|
34
|
+
separatorIndex === -1
|
|
35
|
+
? digitsAndSeparatorsOnly
|
|
36
|
+
: `${digitsAndSeparatorsOnly.slice(0, separatorIndex + 1)}${digitsAndSeparatorsOnly
|
|
37
|
+
.slice(separatorIndex + 1)
|
|
38
|
+
.replace(/\./g, '')}`;
|
|
39
|
+
|
|
40
|
+
const prefixedValue = normalized.startsWith('.') ? `0${normalized}` : normalized;
|
|
41
|
+
const parsed = Number(prefixedValue);
|
|
42
|
+
|
|
43
|
+
if (!Number.isFinite(parsed)) {
|
|
44
|
+
return '';
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (parsed <= 0) {
|
|
48
|
+
return prefixedValue === '0.' ? prefixedValue : '0';
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (parsed >= 100) {
|
|
52
|
+
return '100';
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return prefixedValue;
|
|
56
|
+
}
|
|
57
|
+
|
|
11
58
|
export function trimToNull(value?: string | null) {
|
|
12
59
|
const trimmed = value?.trim() ?? '';
|
|
13
60
|
return trimmed ? trimmed : null;
|
|
@@ -22,8 +22,8 @@ import {
|
|
|
22
22
|
import { Textarea } from '@/components/ui/textarea';
|
|
23
23
|
import { useApp, useQuery } from '@hed-hog/next-app-provider';
|
|
24
24
|
import { Check, ClipboardCheck, X } from 'lucide-react';
|
|
25
|
-
import { useMemo, useState } from 'react';
|
|
26
25
|
import { useTranslations } from 'next-intl';
|
|
26
|
+
import { useMemo, useState } from 'react';
|
|
27
27
|
import { OperationsHeader } from '../_components/operations-header';
|
|
28
28
|
import { StatusBadge } from '../_components/status-badge';
|
|
29
29
|
import { fetchOperations } from '../_lib/api';
|
|
@@ -381,7 +381,7 @@ export default function OperationsApprovalsPage() {
|
|
|
381
381
|
}
|
|
382
382
|
}}
|
|
383
383
|
>
|
|
384
|
-
<DialogContent>
|
|
384
|
+
<DialogContent className="max-w-150">
|
|
385
385
|
<DialogHeader>
|
|
386
386
|
<DialogTitle>
|
|
387
387
|
{pendingDecision?.action === 'approve'
|