teraprox-core-sdk 0.3.10 → 0.3.14
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 +515 -0
- package/dist/{chunk-JK654W4P.mjs → chunk-CBKXJHPL.mjs} +195 -25
- package/dist/{federation-Bhx0XhSP.d.mts → federation-Cp_lk0Xd.d.mts} +231 -49
- package/dist/{federation-Bhx0XhSP.d.ts → federation-Cp_lk0Xd.d.ts} +231 -49
- package/dist/federation.d.mts +1 -1
- package/dist/federation.d.ts +1 -1
- package/dist/federation.js +199 -26
- package/dist/federation.mjs +9 -3
- package/dist/index.d.mts +1414 -21
- package/dist/index.d.ts +1414 -21
- package/dist/index.js +2467 -886
- package/dist/index.mjs +2172 -827
- package/package.json +2 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { C as CoreService, T as ToastService, H as HttpController, I as IObservabilityPort, a as InteractionPayload, V as VitalsPayload, B as BreadcrumbPayload } from './federation-
|
|
2
|
-
export { D as DevAutoLogin, F as FederatedBridge, M as MatchingObjectSubscription, R as ReducersBundle,
|
|
1
|
+
import { C as CoreService, T as ToastService, H as HttpController, I as IObservabilityPort, a as InteractionPayload, V as VitalsPayload, B as BreadcrumbPayload } from './federation-Cp_lk0Xd.mjs';
|
|
2
|
+
export { D as DefaultReducerKeys, b as DevAutoLogin, F as FederatedBridge, M as MatchingObjectSubscription, c as MenuTreeChild, d as MenuTreeNode, R as RateLimitEntry, e as ReducerDep, f as ReducersBundle, g as ReducersBundleConfig, h as RemoteFormRoute, i as RemoteManifest, j as RemoteMenuItem, k as RemoteMenuSection, l as RemoteReducerMap, S as StandaloneProvider, m as ToastOptions, n as createReducersBundle, o as createReducersFromManifest, p as groupMenuSections, q as isHostedByCore } from './federation-Cp_lk0Xd.mjs';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { Dispatch } from 'react';
|
|
5
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
5
|
import * as redux from 'redux';
|
|
7
6
|
import * as _reduxjs_toolkit from '@reduxjs/toolkit';
|
|
7
|
+
import 'react/jsx-runtime';
|
|
8
8
|
|
|
9
9
|
interface Notification {
|
|
10
10
|
id?: string | number;
|
|
@@ -54,24 +54,231 @@ interface SolicitacaoDeServico {
|
|
|
54
54
|
equipamento?: string;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
type StatusOrdemDeCorrecao = 'ABERTA' | 'EM_EXECUCAO' | 'CONCLUIDA' | 'CANCELADA' | 'PENDENTE_AUTORIZACAO';
|
|
58
|
+
interface TarefaDeCorrecao {
|
|
59
|
+
id?: string | number;
|
|
60
|
+
localId?: string;
|
|
61
|
+
descricao: string;
|
|
62
|
+
responsavel?: string;
|
|
63
|
+
responsavelId?: string | number;
|
|
64
|
+
status?: string;
|
|
65
|
+
removed?: boolean;
|
|
66
|
+
tarefasUnidadeMaterial?: TarefaUnidadeMaterial[];
|
|
67
|
+
}
|
|
68
|
+
interface TarefaUnidadeMaterial {
|
|
69
|
+
id?: string | number;
|
|
70
|
+
unidadeMaterialId?: string | number | null;
|
|
71
|
+
unidadeMaterial?: any;
|
|
72
|
+
quantidade: number;
|
|
73
|
+
userId: string;
|
|
74
|
+
dataDoApontamento: string;
|
|
75
|
+
removed?: boolean;
|
|
76
|
+
}
|
|
77
|
+
interface OrdemDeCorrecao {
|
|
78
|
+
id: string | number;
|
|
79
|
+
status: StatusOrdemDeCorrecao;
|
|
80
|
+
ordemDeServicoId?: string | number;
|
|
81
|
+
registroDeCampoId?: string | number;
|
|
82
|
+
recursoNome?: string;
|
|
83
|
+
recursoId?: string | number;
|
|
84
|
+
observacao?: string;
|
|
85
|
+
dataDeAbertura?: string | null;
|
|
86
|
+
dataDeEncerramento?: string | null;
|
|
87
|
+
tarefas: TarefaDeCorrecao[];
|
|
88
|
+
solicitante?: {
|
|
89
|
+
id: string | number;
|
|
90
|
+
nome: string;
|
|
91
|
+
};
|
|
92
|
+
recurso?: {
|
|
93
|
+
id: string | number;
|
|
94
|
+
nome: string;
|
|
95
|
+
};
|
|
96
|
+
createdAt?: string;
|
|
97
|
+
updatedAt?: string;
|
|
98
|
+
}
|
|
99
|
+
interface OrdemDeCorrecaoFormState {
|
|
100
|
+
ordemDeServicoId: string;
|
|
101
|
+
registroDeCampoId: string;
|
|
102
|
+
recursoNome: string;
|
|
103
|
+
recursoId: string;
|
|
104
|
+
observacao: string;
|
|
105
|
+
tarefas: TarefaDeCorrecao[];
|
|
106
|
+
dataDeAbertura?: string | null;
|
|
107
|
+
dataDeEncerramento?: string | null;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
interface RegraDeCorrecao {
|
|
111
|
+
id?: string | number;
|
|
112
|
+
acao?: any;
|
|
113
|
+
acaoId?: string | number;
|
|
114
|
+
parametro?: any;
|
|
115
|
+
parametroId?: string | number;
|
|
116
|
+
campoDeVerificacao?: any;
|
|
117
|
+
campoDeVerificacaoId?: string | number;
|
|
118
|
+
tipoDeCorrecao?: string;
|
|
119
|
+
calculosDeCorrecao?: CalculoDeCorrecao[];
|
|
120
|
+
}
|
|
121
|
+
interface CalculoDeCorrecao {
|
|
122
|
+
id?: string | number;
|
|
123
|
+
material?: any;
|
|
124
|
+
materialId?: string | number;
|
|
125
|
+
formula?: string;
|
|
126
|
+
unidade?: string;
|
|
127
|
+
}
|
|
128
|
+
interface RegraDeCorrecaoFormState {
|
|
129
|
+
acao: any;
|
|
130
|
+
acaoId: string;
|
|
131
|
+
parametro: any;
|
|
132
|
+
parametroId: string;
|
|
133
|
+
campoDeVerificacao: any;
|
|
134
|
+
campoDeVerificacaoId: string;
|
|
135
|
+
tipoDeCorrecao: string;
|
|
136
|
+
calculosDeCorrecao: CalculoDeCorrecao[];
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Representação de um anexo persistido (retornado pela API).
|
|
141
|
+
*/
|
|
142
|
+
interface AnexoPersistido {
|
|
143
|
+
id: string | number;
|
|
144
|
+
nome: string;
|
|
145
|
+
tipo: string;
|
|
146
|
+
tamanho?: number;
|
|
147
|
+
/** Chave no object storage — necessária para `POST /anexo/signedUrl` (API não usa só anexoId). */
|
|
148
|
+
key?: string;
|
|
149
|
+
url?: string;
|
|
150
|
+
signedUrl?: string;
|
|
151
|
+
context?: string;
|
|
152
|
+
entityId?: string | number;
|
|
153
|
+
createdAt?: string;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Representação de um anexo local (selecionado mas ainda não enviado).
|
|
157
|
+
*/
|
|
158
|
+
interface AnexoLocal {
|
|
159
|
+
localId: string;
|
|
160
|
+
file: File;
|
|
161
|
+
nome: string;
|
|
162
|
+
tipo: string;
|
|
163
|
+
tamanho: number;
|
|
164
|
+
progress: number;
|
|
165
|
+
status: 'pending' | 'uploading' | 'done' | 'error';
|
|
166
|
+
errorMessage?: string;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Resultado da intent de upload (signed URL da nuvem).
|
|
170
|
+
*/
|
|
171
|
+
interface UploadIntent {
|
|
172
|
+
/** URL for signed upload — API may return as `uploadUrl` or `signedUrl`. */
|
|
173
|
+
signedUrl?: string;
|
|
174
|
+
uploadUrl?: string;
|
|
175
|
+
key?: string;
|
|
176
|
+
anexoId?: string | number;
|
|
177
|
+
fileName?: string;
|
|
178
|
+
contentType?: string;
|
|
179
|
+
dataId?: string;
|
|
180
|
+
dataContext?: string;
|
|
181
|
+
fields?: Record<string, string>;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Port Hexagonal para operações de anexo.
|
|
185
|
+
* Permite que qualquer módulo federado gerencie anexos de forma uniforme,
|
|
186
|
+
* sem conhecer detalhes de implementação (GCS, S3, local, etc.).
|
|
187
|
+
*/
|
|
188
|
+
interface IAnexoPort {
|
|
189
|
+
/** Solicita intent de upload ao backend (retorna signed URL). */
|
|
190
|
+
intent(params: {
|
|
191
|
+
nome: string;
|
|
192
|
+
tipo: string;
|
|
193
|
+
tamanho: number;
|
|
194
|
+
context: string;
|
|
195
|
+
entityId: string | number;
|
|
196
|
+
}): Promise<UploadIntent>;
|
|
197
|
+
/** Confirma que o upload para a signed URL foi concluído (alguns backends não usam anexoId — só key + dataId). */
|
|
198
|
+
confirm(params: {
|
|
199
|
+
anexoId?: string | number;
|
|
200
|
+
context: string;
|
|
201
|
+
entityId: string | number;
|
|
202
|
+
key: string;
|
|
203
|
+
fileName: string;
|
|
204
|
+
contentType: string;
|
|
205
|
+
}): Promise<AnexoPersistido>;
|
|
206
|
+
/** Upload direto via FormData (fallback quando signed URL não está disponível). */
|
|
207
|
+
uploadDirect(params: {
|
|
208
|
+
file: File;
|
|
209
|
+
context: string;
|
|
210
|
+
entityId: string | number;
|
|
211
|
+
path?: string;
|
|
212
|
+
}): Promise<AnexoPersistido>;
|
|
213
|
+
/** Lê todos os anexos de uma entidade num contexto. */
|
|
214
|
+
readByEntity(context: string, entityId: string | number): Promise<AnexoPersistido[]>;
|
|
215
|
+
/** Obtém URL assinada para download/visualização (corpo `{ key }` na API onRoad; `anexoId` é fallback). */
|
|
216
|
+
getSignedUrl(anexoId: string | number, key?: string): Promise<string>;
|
|
217
|
+
/** Remove um anexo pelo ID. */
|
|
218
|
+
remove(anexoId: string | number): Promise<void>;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Interceptors that can be injected into FetchHttpAdapter.
|
|
223
|
+
*
|
|
224
|
+
* The core provides implementations (token injection, auto-toast, MO dispatch, etc.).
|
|
225
|
+
* Standalone mode can use a subset or none at all.
|
|
226
|
+
*/
|
|
227
|
+
interface HttpInterceptors {
|
|
228
|
+
/**
|
|
229
|
+
* Called before every request.
|
|
230
|
+
* Use to inject dynamic headers (Authorization, tenant, etc.).
|
|
231
|
+
* Return the final headers to use.
|
|
232
|
+
*/
|
|
233
|
+
onBeforeRequest?(headers: Record<string, string>): Record<string, string> | Promise<Record<string, string>>;
|
|
234
|
+
/**
|
|
235
|
+
* Called on successful HTTP response (2xx).
|
|
236
|
+
* Receives raw status, headers, and parsed JSON body.
|
|
237
|
+
* Return the value that callers will receive.
|
|
238
|
+
*/
|
|
239
|
+
onResponse?(response: HttpResponseMeta, method: string): any;
|
|
240
|
+
/**
|
|
241
|
+
* Called on HTTP error (non-2xx).
|
|
242
|
+
* Can return a resolved value (swallow error), or throw/reject.
|
|
243
|
+
* `retry` re-executes the original request (useful for 401 token refresh).
|
|
244
|
+
*/
|
|
245
|
+
onError?(error: HttpErrorMeta, retry: () => Promise<any>): any;
|
|
246
|
+
}
|
|
247
|
+
interface HttpResponseMeta {
|
|
248
|
+
status: number;
|
|
249
|
+
headers: Headers;
|
|
250
|
+
data: any;
|
|
251
|
+
}
|
|
252
|
+
interface HttpErrorMeta {
|
|
253
|
+
status: number;
|
|
254
|
+
headers: Headers;
|
|
255
|
+
data: any;
|
|
256
|
+
message: string;
|
|
257
|
+
}
|
|
258
|
+
|
|
57
259
|
declare const CoreServiceContext: React.Context<CoreService | null>;
|
|
58
260
|
|
|
59
261
|
declare class FetchHttpAdapter implements HttpController {
|
|
60
262
|
private endpoint;
|
|
61
263
|
private extraHeaders?;
|
|
62
|
-
|
|
264
|
+
private interceptors?;
|
|
265
|
+
constructor(endpoint: string, extraHeaders?: Record<string, string> | undefined, interceptors?: HttpInterceptors | undefined);
|
|
266
|
+
private mergeHeaders;
|
|
267
|
+
/** Join non-empty path segments, avoiding double slashes. */
|
|
268
|
+
private joinPath;
|
|
63
269
|
private request;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
270
|
+
private qs;
|
|
271
|
+
get(path?: string, query?: string): Promise<any>;
|
|
272
|
+
post(path?: string, data?: any, extraHeaders?: Record<string, string>, query?: string): Promise<any>;
|
|
273
|
+
put(path?: string, data?: any, extraHeaders?: Record<string, string>, query?: string): Promise<any>;
|
|
274
|
+
patch(path?: string, data?: any, extraHeaders?: Record<string, string>, query?: string): Promise<any>;
|
|
275
|
+
delete(path?: string, id?: string | number, extraHeaders?: Record<string, string>, query?: string): Promise<any>;
|
|
276
|
+
deleteSimple(path?: string, extraHeaders?: Record<string, string>, query?: string): Promise<any>;
|
|
277
|
+
save(path?: string, data?: any, extraHeaders?: Record<string, string>, query?: string): Promise<any>;
|
|
278
|
+
read(path?: string, id?: string | number, extraHeaders?: Record<string, string>, query?: string): Promise<any>;
|
|
279
|
+
readAll(path?: string, extraHeaders?: Record<string, string>, query?: string): Promise<any>;
|
|
280
|
+
readAllwithPage(path?: string, page?: number, size?: number): Promise<any>;
|
|
281
|
+
bulkDelete(path?: string, ids?: (string | number)[], extraHeaders?: Record<string, string>, query?: string): Promise<any>;
|
|
75
282
|
}
|
|
76
283
|
declare class CoreServiceBuilder {
|
|
77
284
|
private _toast;
|
|
@@ -222,6 +429,35 @@ declare function useNavigator(config: NavigatorConfig): NavigateFn;
|
|
|
222
429
|
*/
|
|
223
430
|
declare function useObservability(): IObservabilityPort;
|
|
224
431
|
|
|
432
|
+
interface UseAnexoManagerOptions$1 {
|
|
433
|
+
context: string;
|
|
434
|
+
entityId: string | number;
|
|
435
|
+
/** Port customizado (para injeção em testes ou implementações alternativas). */
|
|
436
|
+
port?: IAnexoPort;
|
|
437
|
+
}
|
|
438
|
+
interface UseAnexoManagerReturn {
|
|
439
|
+
persistidos: AnexoPersistido[];
|
|
440
|
+
locais: AnexoLocal[];
|
|
441
|
+
loading: boolean;
|
|
442
|
+
/** Carrega anexos existentes da entidade. */
|
|
443
|
+
loadAnexos: () => Promise<void>;
|
|
444
|
+
/** Adiciona arquivos locais (ainda não enviados). */
|
|
445
|
+
addFiles: (files: File[]) => void;
|
|
446
|
+
/** Remove um arquivo local da fila. */
|
|
447
|
+
removeLocal: (localId: string) => void;
|
|
448
|
+
/** Envia todos os arquivos pendentes. Se `overrideEntityId` for fornecido, usa-o em vez do entityId do hook. */
|
|
449
|
+
uploadAll: (overrideEntityId?: string | number) => Promise<AnexoPersistido[]>;
|
|
450
|
+
/** Remove um anexo persistido (do servidor). */
|
|
451
|
+
removePersistido: (anexoId: string | number) => Promise<void>;
|
|
452
|
+
/** Obtém signed URL para preview/download. */
|
|
453
|
+
getUrl: (anexoId: string | number) => Promise<string>;
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* Hook central para gerenciamento de anexos.
|
|
457
|
+
* Conecta a UI (AnexoManager do ui-kit) com a infraestrutura HTTP (core-sdk).
|
|
458
|
+
*/
|
|
459
|
+
declare function useAnexoManager({ context, entityId, port }: UseAnexoManagerOptions$1): UseAnexoManagerReturn;
|
|
460
|
+
|
|
225
461
|
interface FetchDataReturn<T = any> {
|
|
226
462
|
data: T | null;
|
|
227
463
|
loading: boolean;
|
|
@@ -297,12 +533,1169 @@ interface ValidationReturn<T> {
|
|
|
297
533
|
*/
|
|
298
534
|
declare function useValidation<T = any>(rules: ValidationRule<T>[]): ValidationReturn<T>;
|
|
299
535
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
536
|
+
/**
|
|
537
|
+
* useTimeFormat — helpers para conversao entre segundos e string `HH:mm:ss` /
|
|
538
|
+
* `HH:mm`. Extraido de `TimeFormField` (teraprox-SGM-OS) na Wave 5D.2 da
|
|
539
|
+
* sprint 2026-04-21-ui-kit-domain-split-wave0.
|
|
540
|
+
*
|
|
541
|
+
* Nao e um hook stateful — apenas um container reutilizavel de utilitarios
|
|
542
|
+
* para evitar duplicacao do `dayjs.extend(duration)` em cada caller. O nome
|
|
543
|
+
* `use*` sinaliza que o consumidor invoca dentro de um componente React.
|
|
544
|
+
*/
|
|
545
|
+
interface TimeFormatApi {
|
|
546
|
+
/** Converte segundos (number) em string `HH:mm:ss`. */
|
|
547
|
+
secondsToHms(seconds: number | null | undefined): string;
|
|
548
|
+
/** Converte string `HH:mm` (ou `HH:mm:ss`) em segundos totais. */
|
|
549
|
+
hmsToSeconds(value: string | null | undefined): number | null;
|
|
550
|
+
}
|
|
551
|
+
declare const secondsToHms: (seconds: number | null | undefined) => string;
|
|
552
|
+
declare const hmsToSeconds: (value: string | null | undefined) => number | null;
|
|
553
|
+
declare const useTimeFormat: () => TimeFormatApi;
|
|
554
|
+
|
|
555
|
+
/**
|
|
556
|
+
* Modos de combinação de predicados em filtros multi-select.
|
|
557
|
+
*
|
|
558
|
+
* - `union` (∪) — item passa se satisfazer QUALQUER predicado ativo (OR).
|
|
559
|
+
* - `intersection` (∩) — item passa se satisfazer TODOS os predicados ativos (AND).
|
|
560
|
+
* - `xor` (△) — diferença simétrica: item passa se satisfazer UM número
|
|
561
|
+
* ímpar de predicados (exactly-one quando há 2 predicados;
|
|
562
|
+
* generaliza para N: usado para "A ou B, mas não ambos").
|
|
563
|
+
*/
|
|
564
|
+
type FilterCombineMode = 'union' | 'intersection' | 'xor';
|
|
565
|
+
declare const FILTER_COMBINE_MODES: readonly FilterCombineMode[];
|
|
566
|
+
interface FilterCombineModeApi {
|
|
567
|
+
mode: FilterCombineMode;
|
|
568
|
+
setMode: (mode: FilterCombineMode) => void;
|
|
569
|
+
/** Avança para o próximo modo do ciclo: union → intersection → xor → union. */
|
|
570
|
+
cycleMode: () => void;
|
|
571
|
+
/**
|
|
572
|
+
* Combina predicados contra um item segundo o modo atual.
|
|
573
|
+
* Retorna `true` quando não há predicados (semântica "sem filtro").
|
|
574
|
+
*/
|
|
575
|
+
matches: <T>(predicates: Array<(item: T) => boolean>, item: T) => boolean;
|
|
576
|
+
}
|
|
577
|
+
/**
|
|
578
|
+
* Hook que gerencia o modo de combinação para filtros multi-select.
|
|
579
|
+
*
|
|
580
|
+
* Contexto: em listas com múltiplas pills selecionáveis, o usuário pode querer:
|
|
581
|
+
* - ver a UNIÃO dos filtros (qualquer match — padrão "mais permissivo"),
|
|
582
|
+
* - a INTERSECÇÃO (drill-down, todos os filtros devem bater),
|
|
583
|
+
* - ou a DIFERENÇA SIMÉTRICA (itens que batem em um número ímpar de filtros).
|
|
584
|
+
*
|
|
585
|
+
* Expõe um helper `matches` que o consumidor chama dentro do seu loop de filtragem:
|
|
586
|
+
*
|
|
587
|
+
* ```ts
|
|
588
|
+
* const combine = useFilterCombineMode('union')
|
|
589
|
+
* const filtered = items.filter(item => combine.matches(activePredicates, item))
|
|
590
|
+
* ```
|
|
591
|
+
*/
|
|
592
|
+
declare function useFilterCombineMode(initialMode?: FilterCombineMode): FilterCombineModeApi;
|
|
593
|
+
|
|
594
|
+
/**
|
|
595
|
+
* Port for UnidadeMaterialForm (ui-kit).
|
|
596
|
+
*
|
|
597
|
+
* Implementado por ReduxUnidadeMaterialAdapter. A UI (UnidadeMaterialForm)
|
|
598
|
+
* nao deve chamar useCoreService / useSelector / useDispatch — consome
|
|
599
|
+
* exclusivamente este contrato via useUnidadeMaterialViewModel().
|
|
600
|
+
*/
|
|
601
|
+
interface UnidadeMaterialRef {
|
|
602
|
+
id: string | number;
|
|
603
|
+
nome: string;
|
|
604
|
+
[key: string]: any;
|
|
605
|
+
}
|
|
606
|
+
interface UnidadeMaterialValue {
|
|
607
|
+
material?: UnidadeMaterialRef | null;
|
|
608
|
+
quantidade?: number | string;
|
|
609
|
+
unidade?: UnidadeMaterialRef | null;
|
|
610
|
+
}
|
|
611
|
+
interface ValidationResult {
|
|
612
|
+
ok: boolean;
|
|
613
|
+
errors: Record<string, string>;
|
|
614
|
+
}
|
|
615
|
+
interface IUnidadeMaterialViewModel {
|
|
616
|
+
/** Estado atual da composição Unidade-Material (Redux) */
|
|
617
|
+
value: UnidadeMaterialValue;
|
|
618
|
+
/** Flag derivada: material+unidade+quantidade numerica > 0 */
|
|
619
|
+
isValid: boolean;
|
|
620
|
+
/** Flag transiente — true enquanto submit() esta pendente */
|
|
621
|
+
isSubmitting: boolean;
|
|
622
|
+
/** Atualiza material selecionado */
|
|
623
|
+
onMaterialSelected(material: UnidadeMaterialRef): void;
|
|
624
|
+
/** Atualiza quantidade */
|
|
625
|
+
onQuantidadeUpdate(qtd: string): void;
|
|
626
|
+
/** Atualiza unidade de medida */
|
|
627
|
+
onUnidadeSelected(unidade: UnidadeMaterialRef): void;
|
|
628
|
+
/** Carrega lista de materiais (via useCoreService('material')) */
|
|
629
|
+
loadMaterials(): Promise<any[]>;
|
|
630
|
+
/** Carrega lista de unidades (via useCoreService('unidade')) */
|
|
631
|
+
loadUnidades(): Promise<any[]>;
|
|
632
|
+
/** Limpa o estado da composicao */
|
|
633
|
+
clear(): void;
|
|
634
|
+
/** Popula a composicao para edicao */
|
|
635
|
+
populate(value: UnidadeMaterialValue): void;
|
|
636
|
+
/** Validacao sincrona — mesma regra do SGM-OS Services/default/validations.js */
|
|
637
|
+
validate(): ValidationResult;
|
|
638
|
+
/**
|
|
639
|
+
* Retorna o DTO consolidado pronto para o caller persistir.
|
|
640
|
+
* Nao dispatcha side effects adicionais — apenas valida e devolve.
|
|
641
|
+
* Lanca Error se validate() falhar.
|
|
642
|
+
*/
|
|
643
|
+
submit(): Promise<UnidadeMaterialValue>;
|
|
644
|
+
/** Alias semantico de clear() para modal composto */
|
|
645
|
+
reset(): void;
|
|
646
|
+
/**
|
|
647
|
+
* Persiste edicao inline da quantidade utilizada de uma TarefaUnidadeMaterial.
|
|
648
|
+
*
|
|
649
|
+
* Em modo `edit` a UI consumidora pode interceptar via callback opcional
|
|
650
|
+
* (`TarefaItemProps.onAddUnidadeMaterial` etc); em `execute` o adapter
|
|
651
|
+
* persiste direto via `PUT /tarefaUnidadeMaterial/:id`.
|
|
652
|
+
*
|
|
653
|
+
* O adapter recebe `tarefaId` na construcao do hook
|
|
654
|
+
* (`useUnidadeMaterialViewModel(tarefaId)`) e o adiciona ao body.
|
|
655
|
+
*
|
|
656
|
+
* Em caso de erro, dispara `useToast().warning(...)` e relan ca o erro
|
|
657
|
+
* para que o caller possa reverter estado otimista se desejar.
|
|
658
|
+
*/
|
|
659
|
+
updateQuantidade(tumId: string | number, quantidade: number): Promise<void>;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
/**
|
|
663
|
+
* Adapter Redux que implementa IUnidadeMaterialViewModel.
|
|
664
|
+
*
|
|
665
|
+
* Consome useHttpController('material') e useHttpController('unidade')
|
|
666
|
+
* para expor loadMaterials/loadUnidades.
|
|
667
|
+
*
|
|
668
|
+
* Estado lido do slice 'unidadeMaterial' (ver unidadeMaterialSlice.ts),
|
|
669
|
+
* parametrizado por tarefaId para suportar multiplas composicoes simultaneas
|
|
670
|
+
* (ex: varias tarefas no mesmo form de Ordem de Servico).
|
|
671
|
+
*
|
|
672
|
+
* isSubmitting vive em useState local — estado transiente do modal,
|
|
673
|
+
* nao precisa ir para Redux.
|
|
674
|
+
*/
|
|
675
|
+
declare function useUnidadeMaterialViewModel(tarefaId?: string | number): IUnidadeMaterialViewModel;
|
|
676
|
+
|
|
677
|
+
/**
|
|
678
|
+
* Slice para o estado do UnidadeMaterialForm.
|
|
679
|
+
*
|
|
680
|
+
* Estrutura parametrizada por tarefaId:
|
|
681
|
+
* state.unidadeMaterial.byTarefa[tarefaId] = { material, quantidade, unidade }
|
|
682
|
+
*
|
|
683
|
+
* Chave '__default__' armazena o estado quando nenhum tarefaId eh fornecido.
|
|
684
|
+
*/
|
|
685
|
+
declare const DEFAULT_KEY$3 = "__default__";
|
|
686
|
+
interface UnidadeMaterialSliceState {
|
|
687
|
+
byTarefa: Record<string, UnidadeMaterialValue>;
|
|
688
|
+
}
|
|
689
|
+
interface ByTarefaPayload$1<T> {
|
|
690
|
+
tarefaId?: string | number;
|
|
691
|
+
value: T;
|
|
692
|
+
}
|
|
693
|
+
declare const setMaterial: _reduxjs_toolkit.ActionCreatorWithPayload<ByTarefaPayload$1<UnidadeMaterialRef | null>, "unidadeMaterialVm/setMaterial">;
|
|
694
|
+
declare const setQuantidade: _reduxjs_toolkit.ActionCreatorWithPayload<ByTarefaPayload$1<string | number>, "unidadeMaterialVm/setQuantidade">;
|
|
695
|
+
declare const setUnidade: _reduxjs_toolkit.ActionCreatorWithPayload<ByTarefaPayload$1<UnidadeMaterialRef | null>, "unidadeMaterialVm/setUnidade">;
|
|
696
|
+
declare const populateUnidadeMaterial: _reduxjs_toolkit.ActionCreatorWithPayload<ByTarefaPayload$1<UnidadeMaterialValue>, "unidadeMaterialVm/populate">;
|
|
697
|
+
declare const clearUnidadeMaterial: _reduxjs_toolkit.ActionCreatorWithPayload<{
|
|
698
|
+
tarefaId?: string | number;
|
|
699
|
+
}, "unidadeMaterialVm/clearUnidadeMaterial">;
|
|
700
|
+
declare const selectUnidadeMaterial: (state: any, tarefaId?: string | number) => UnidadeMaterialValue;
|
|
701
|
+
declare const _default$7: redux.Reducer<UnidadeMaterialSliceState>;
|
|
702
|
+
|
|
703
|
+
/**
|
|
704
|
+
* Port for InspecaoModal (ui-kit-sgm).
|
|
705
|
+
*
|
|
706
|
+
* Implementado por ReduxInspecaoModalAdapter. A UI (InspecaoModal) nao
|
|
707
|
+
* deve acessar Redux diretamente — consome o contrato via
|
|
708
|
+
* useInspecaoModalViewModel().
|
|
709
|
+
*/
|
|
710
|
+
interface LimiteDeControle {
|
|
711
|
+
nome?: string;
|
|
712
|
+
boundRule?: string;
|
|
713
|
+
valor?: number | string;
|
|
714
|
+
removed?: boolean;
|
|
715
|
+
[k: string]: unknown;
|
|
716
|
+
}
|
|
717
|
+
interface InspecaoValue {
|
|
718
|
+
tipo?: string;
|
|
719
|
+
nomeParametro?: string;
|
|
720
|
+
unidadeParametro?: string;
|
|
721
|
+
parametroId?: string;
|
|
722
|
+
limitesDeControle: LimiteDeControle[];
|
|
723
|
+
[k: string]: unknown;
|
|
724
|
+
}
|
|
725
|
+
interface InspecaoValidationResult {
|
|
726
|
+
ok: boolean;
|
|
727
|
+
errors: Record<string, string>;
|
|
728
|
+
}
|
|
729
|
+
interface IInspecaoModalViewModel {
|
|
730
|
+
/** Estado atual do form de inspecao (Redux) */
|
|
731
|
+
value: InspecaoValue;
|
|
732
|
+
/** Flag derivada — ver regra em validate() */
|
|
733
|
+
isValid: boolean;
|
|
734
|
+
/** Flag transiente — true enquanto submit() esta pendente */
|
|
735
|
+
isSubmitting: boolean;
|
|
736
|
+
/** Define o tipo de dado (Numerico | Verdadeiro ou Falso | ...) */
|
|
737
|
+
onTipoDeDado(tipo: string): void;
|
|
738
|
+
/** Atualiza o nome do parametro avulso */
|
|
739
|
+
onNomeParametro(nome: string): void;
|
|
740
|
+
/** Usuario selecionou um parametro pre-cadastrado (copia id/unidade/nome) */
|
|
741
|
+
onParametroSelected(parametro: any): void;
|
|
742
|
+
/** Atualiza a unidade de medida do parametro */
|
|
743
|
+
onUnidadeParametro(unidade: string): void;
|
|
744
|
+
/** Substitui toda a lista de limites de controle */
|
|
745
|
+
onLimitesChange(limites: LimiteDeControle[]): void;
|
|
746
|
+
/** Marca o limite no indice idx como removed=true (soft-delete) */
|
|
747
|
+
removeLimite(idx: number): void;
|
|
748
|
+
/**
|
|
749
|
+
* Coloca um limite em modo de edicao. Implementacao default faz
|
|
750
|
+
* noop no Redux — a UI pode manter o item em state local — mas
|
|
751
|
+
* a Port existe para que a UI nao precise conhecer esse detalhe.
|
|
752
|
+
*/
|
|
753
|
+
editLimite(limite: LimiteDeControle): void;
|
|
754
|
+
/**
|
|
755
|
+
* Validacao sincrona:
|
|
756
|
+
* - tipo obrigatorio
|
|
757
|
+
* - tipo === 'Numerico' exige >= 1 limite de controle nao-removed
|
|
758
|
+
* - tipo === 'Verdadeiro ou Falso' nao exige limites
|
|
759
|
+
*/
|
|
760
|
+
validate(): InspecaoValidationResult;
|
|
761
|
+
/** Valida + retorna DTO. Nao persiste em API. */
|
|
762
|
+
submit(): Promise<InspecaoValue>;
|
|
763
|
+
/** Limpa para initialState */
|
|
764
|
+
reset(): void;
|
|
765
|
+
/** Popula para edicao */
|
|
766
|
+
populateFromExisting(inspecao: InspecaoValue): void;
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
/**
|
|
770
|
+
* Adapter Redux que implementa IInspecaoModalViewModel.
|
|
771
|
+
*
|
|
772
|
+
* Le de state.inspecaoModalVm (slice proprio — inspecaoModalSlice.ts).
|
|
773
|
+
* isSubmitting vive em useState local (estado transiente do modal).
|
|
774
|
+
*/
|
|
775
|
+
declare function useInspecaoModalViewModel(tarefaId?: string | number): IInspecaoModalViewModel;
|
|
776
|
+
|
|
777
|
+
/**
|
|
778
|
+
* Slice autonomo para o modal de Inspecao (core-sdk).
|
|
779
|
+
*
|
|
780
|
+
* Parametrizado por tarefaId — mesmo padrao do unidadeMaterialSlice.
|
|
781
|
+
* Chave '__default__' armazena o estado quando nenhum tarefaId eh fornecido.
|
|
782
|
+
*
|
|
783
|
+
* Nao depende do slice legado state.inspecao do SGM-OS — o caller
|
|
784
|
+
* decide se quer espelhar (ou nao) de volta para o slice antigo.
|
|
785
|
+
*/
|
|
786
|
+
declare const DEFAULT_KEY$2 = "__default__";
|
|
787
|
+
interface InspecaoModalSliceState {
|
|
788
|
+
byTarefa: Record<string, InspecaoValue>;
|
|
789
|
+
}
|
|
790
|
+
interface ByTarefaPayload<T> {
|
|
791
|
+
tarefaId?: string | number;
|
|
792
|
+
value: T;
|
|
793
|
+
}
|
|
794
|
+
declare const setInspecaoTipo: _reduxjs_toolkit.ActionCreatorWithPayload<ByTarefaPayload<string>, "inspecaoModalVm/setTipo">;
|
|
795
|
+
declare const setInspecaoNomeParametro: _reduxjs_toolkit.ActionCreatorWithPayload<ByTarefaPayload<string>, "inspecaoModalVm/setNomeParametro">;
|
|
796
|
+
declare const setInspecaoUnidadeParametro: _reduxjs_toolkit.ActionCreatorWithPayload<ByTarefaPayload<string>, "inspecaoModalVm/setUnidadeParametro">;
|
|
797
|
+
declare const setInspecaoParametro: _reduxjs_toolkit.ActionCreatorWithPayload<ByTarefaPayload<any>, "inspecaoModalVm/setParametro">;
|
|
798
|
+
declare const setInspecaoLimites: _reduxjs_toolkit.ActionCreatorWithPayload<ByTarefaPayload<LimiteDeControle[]>, "inspecaoModalVm/setLimites">;
|
|
799
|
+
declare const removeInspecaoLimiteAt: _reduxjs_toolkit.ActionCreatorWithPayload<{
|
|
800
|
+
tarefaId?: string | number;
|
|
801
|
+
idx: number;
|
|
802
|
+
}, "inspecaoModalVm/removeLimiteAt">;
|
|
803
|
+
declare const populateInspecaoModal: _reduxjs_toolkit.ActionCreatorWithPayload<ByTarefaPayload<InspecaoValue>, "inspecaoModalVm/populate">;
|
|
804
|
+
declare const clearInspecaoModal: _reduxjs_toolkit.ActionCreatorWithPayload<{
|
|
805
|
+
tarefaId?: string | number;
|
|
806
|
+
}, "inspecaoModalVm/clearInspecaoModal">;
|
|
807
|
+
declare const selectInspecaoModal: (state: any, tarefaId?: string | number) => InspecaoValue;
|
|
808
|
+
declare const _default$6: redux.Reducer<InspecaoModalSliceState>;
|
|
809
|
+
|
|
810
|
+
/**
|
|
811
|
+
* Port for RecursoDisplayer (ui-kit-sgm).
|
|
812
|
+
*
|
|
813
|
+
* Implementado por ReduxRecursoDisplayerAdapter. A UI (RecursoDisplayer)
|
|
814
|
+
* nao deve chamar useDispatch / useSelector / useHttpController /
|
|
815
|
+
* useCoreService — consome exclusivamente este contrato via
|
|
816
|
+
* useRecursoDisplayerViewModel().
|
|
817
|
+
*
|
|
818
|
+
* Wave 2A da sprint 2026-04-21-ui-kit-domain-split-wave0 — elimina a
|
|
819
|
+
* violacao P0 apontada em wiki/troubleshooting/2026-04-19-ui-kit-hexagonal-audit.md.
|
|
820
|
+
*/
|
|
821
|
+
interface BranchLevelRef {
|
|
822
|
+
level: number;
|
|
823
|
+
color?: string;
|
|
824
|
+
nome?: string;
|
|
825
|
+
[k: string]: any;
|
|
304
826
|
}
|
|
305
|
-
|
|
827
|
+
interface BranchNodeRef {
|
|
828
|
+
recurso: {
|
|
829
|
+
id: string | number;
|
|
830
|
+
nome: string;
|
|
831
|
+
branchId?: string | number;
|
|
832
|
+
branch?: {
|
|
833
|
+
id: string | number;
|
|
834
|
+
[k: string]: any;
|
|
835
|
+
};
|
|
836
|
+
[k: string]: any;
|
|
837
|
+
};
|
|
838
|
+
[k: string]: any;
|
|
839
|
+
}
|
|
840
|
+
interface Branch {
|
|
841
|
+
id: string | number;
|
|
842
|
+
branchId?: string | number;
|
|
843
|
+
nomeRecurso?: string;
|
|
844
|
+
branchLevel?: BranchLevelRef;
|
|
845
|
+
branchNodes?: BranchNodeRef[];
|
|
846
|
+
[k: string]: any;
|
|
847
|
+
}
|
|
848
|
+
interface IRecursoDisplayerViewModel {
|
|
849
|
+
/** Trilha atual (nivel raiz -> folha) do seletor arvore. */
|
|
850
|
+
branches: Branch[];
|
|
851
|
+
/** Flag transiente enquanto loadInitialBranches / advanceBranch estao pendentes. */
|
|
852
|
+
isLoading: boolean;
|
|
853
|
+
/**
|
|
854
|
+
* Carrega a raiz da arvore:
|
|
855
|
+
* - arvoreEstrutural.get('branchByBranchLevel/1') -> seta `branches[0]`
|
|
856
|
+
* - branchLevel.readAll() -> dispatch(setLevels(...))
|
|
857
|
+
*/
|
|
858
|
+
loadInitialBranches(): Promise<void>;
|
|
859
|
+
/**
|
|
860
|
+
* "branchSetter" do componente original (displays/RecursoDisplayer.tsx L69-94).
|
|
861
|
+
* Avanca a trilha — ao selecionar um branchNode no dropdown atual, carrega
|
|
862
|
+
* o proximo nivel via arvoreEstrutural.read('branch', nextBranchId).
|
|
863
|
+
*/
|
|
864
|
+
advanceBranch(bn: BranchNodeRef): Promise<void>;
|
|
865
|
+
/**
|
|
866
|
+
* "backOnBranch" do componente original (L96-101). Recolhe a trilha para
|
|
867
|
+
* o nivel clicado, descartando niveis mais profundos.
|
|
868
|
+
*/
|
|
869
|
+
backToBranch(branch: Branch): void;
|
|
870
|
+
/** Reinicia a trilha para vazio (util em cancel/cleanup). */
|
|
871
|
+
reset(): void;
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
/**
|
|
875
|
+
* Overrides opcionais de controllers — usado por callers que precisam de
|
|
876
|
+
* `gatewayBase` custom (ex. teraprox-SGM-OS/src/hooks/useArvoreControllers.js)
|
|
877
|
+
* para evitar que `useHttpController('')` caia em endpoint relativo.
|
|
878
|
+
*
|
|
879
|
+
* Regra de memoria (Federation endpoint bake-in): nunca passar
|
|
880
|
+
* `endPointManutencao` / `endPointUser` como baseEndPoint. O Adapter
|
|
881
|
+
* usa apenas o que for injetado OU o default de `useHttpController()`.
|
|
882
|
+
*/
|
|
883
|
+
interface RecursoDisplayerAdapterOverrides {
|
|
884
|
+
arvoreEstruturalController?: HttpController;
|
|
885
|
+
branchLevelController?: HttpController;
|
|
886
|
+
}
|
|
887
|
+
/**
|
|
888
|
+
* Adapter Redux que implementa IRecursoDisplayerViewModel.
|
|
889
|
+
*
|
|
890
|
+
* Porta para o Redux a logica antes inline em
|
|
891
|
+
* `teraprox-core/packages/ui-kit/src/displays/RecursoDisplayer.tsx`
|
|
892
|
+
* (useEffect de init + branchSetter + backOnBranch, L42-101).
|
|
893
|
+
*
|
|
894
|
+
* - `branches` vive em useState local (estado de navegacao do componente)
|
|
895
|
+
* - `levels` (branchLevel.readAll) continua em Redux via slice existente
|
|
896
|
+
* (`branchLevelReducer.setLevels`) porque outros componentes do dominio
|
|
897
|
+
* consomem essa lista.
|
|
898
|
+
*/
|
|
899
|
+
declare function useRecursoDisplayerViewModel(overrides?: RecursoDisplayerAdapterOverrides): IRecursoDisplayerViewModel;
|
|
900
|
+
|
|
901
|
+
/**
|
|
902
|
+
* Port for FindRecursoByTagField (ui-kit-sgm).
|
|
903
|
+
*
|
|
904
|
+
* Implementado por ReduxFindRecursoByTagAdapter. A UI nao chama
|
|
905
|
+
* useHttpController — consome exclusivamente este contrato.
|
|
906
|
+
*
|
|
907
|
+
* Wave 2A da sprint 2026-04-21-ui-kit-domain-split-wave0.
|
|
908
|
+
*/
|
|
909
|
+
interface RecursoTagRef {
|
|
910
|
+
id: string | number;
|
|
911
|
+
descricao?: string;
|
|
912
|
+
[k: string]: any;
|
|
913
|
+
}
|
|
914
|
+
interface IFindRecursoByTagViewModel {
|
|
915
|
+
/** Flag transiente enquanto searchByTag / loadActiveTags estao pendentes. */
|
|
916
|
+
isSearching: boolean;
|
|
917
|
+
/**
|
|
918
|
+
* Carrega a lista de tags ativas (feed do AutoComplete).
|
|
919
|
+
* Equivalente a recurso.get('findActiveRecursosTags').
|
|
920
|
+
*/
|
|
921
|
+
loadActiveTags(): Promise<RecursoTagRef[]>;
|
|
922
|
+
/**
|
|
923
|
+
* Busca um recurso pelo ID da tag selecionada no AutoComplete.
|
|
924
|
+
* Equivalente a recurso.read('findRecursoByTagId', tagId).
|
|
925
|
+
*/
|
|
926
|
+
searchByTagId(tagId: string | number): Promise<any | null>;
|
|
927
|
+
/**
|
|
928
|
+
* Busca um recurso pela descricao lida via QR (sem espacos).
|
|
929
|
+
* Equivalente a recurso.read('recurso/findByTagDescription', description).
|
|
930
|
+
*/
|
|
931
|
+
searchByTag(description: string): Promise<any | null>;
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
interface FindRecursoByTagAdapterOverrides {
|
|
935
|
+
/**
|
|
936
|
+
* Override explicito do controller — util para callers que precisam de
|
|
937
|
+
* gatewayBase customizado (workaround federation endpoint bake-in).
|
|
938
|
+
* Se ausente, resolve via useHttpController('recurso').
|
|
939
|
+
*/
|
|
940
|
+
recursoController?: HttpController | Pick<HttpController, 'read' | 'get'>;
|
|
941
|
+
}
|
|
942
|
+
/**
|
|
943
|
+
* Adapter que implementa IFindRecursoByTagViewModel.
|
|
944
|
+
*
|
|
945
|
+
* Porta para fora da UI a logica antes inline em
|
|
946
|
+
* `teraprox-core/packages/ui-kit/src/forms/FindRecursoByTagField.tsx`
|
|
947
|
+
* (useHttpController('recurso') + findRecursoByTagId/Description handlers).
|
|
948
|
+
*/
|
|
949
|
+
declare function useFindRecursoByTagViewModel(overrides?: FindRecursoByTagAdapterOverrides): IFindRecursoByTagViewModel;
|
|
950
|
+
|
|
951
|
+
/**
|
|
952
|
+
* Port for JustificativaModal (ui-kit).
|
|
953
|
+
*
|
|
954
|
+
* O componente ui-kit `JustificativaModal` eh puramente apresentacional
|
|
955
|
+
* (controlled via props/callbacks). Esta Port formaliza o ViewModel
|
|
956
|
+
* reutilizavel para que consumers nao precisem re-implementar a logica
|
|
957
|
+
* de adicionar/editar/remover/desfazer-remocao em cada tela.
|
|
958
|
+
*
|
|
959
|
+
* Implementado pelo `ReduxJustificativaModalAdapter` (default) — que vive
|
|
960
|
+
* 100% em useState local (nao ha slice global). Consumers que quiserem
|
|
961
|
+
* persistir em Redux podem implementar um Adapter proprio respeitando a
|
|
962
|
+
* mesma interface.
|
|
963
|
+
*/
|
|
964
|
+
interface JustificativaUserRef {
|
|
965
|
+
userId: string | number;
|
|
966
|
+
userName?: string;
|
|
967
|
+
firstName?: string;
|
|
968
|
+
}
|
|
969
|
+
interface Justificativa {
|
|
970
|
+
id: string | number;
|
|
971
|
+
descricao: string;
|
|
972
|
+
user?: JustificativaUserRef;
|
|
973
|
+
createdAt: string | number | Date;
|
|
974
|
+
removed?: boolean;
|
|
975
|
+
isNew?: boolean;
|
|
976
|
+
[k: string]: unknown;
|
|
977
|
+
}
|
|
978
|
+
interface JustificativaValidationResult {
|
|
979
|
+
ok: boolean;
|
|
980
|
+
errors: Record<string, string>;
|
|
981
|
+
}
|
|
982
|
+
interface IJustificativaModalViewModel {
|
|
983
|
+
/** Lista atual (inclui soft-deleted com `removed=true`) */
|
|
984
|
+
justificativas: Justificativa[];
|
|
985
|
+
/** Texto do input de nova justificativa / edicao em andamento */
|
|
986
|
+
draft: string;
|
|
987
|
+
/** Id sendo editado; null quando for criacao nova */
|
|
988
|
+
editingId: string | number | null;
|
|
989
|
+
/** True enquanto submit() estiver pendente */
|
|
990
|
+
isSubmitting: boolean;
|
|
991
|
+
/** Atualiza o draft */
|
|
992
|
+
setDraft(value: string): void;
|
|
993
|
+
/** Coloca uma justificativa em modo edicao (copia descricao pro draft) */
|
|
994
|
+
startEdit(id: string | number): void;
|
|
995
|
+
/** Cancela edicao e limpa draft */
|
|
996
|
+
cancelEdit(): void;
|
|
997
|
+
/**
|
|
998
|
+
* Adiciona (ou salva edicao) a justificativa usando o draft atual.
|
|
999
|
+
* Gera id local com `uuid` v4 quando em criacao.
|
|
1000
|
+
* Retorna a lista atualizada apos persistir (quando onUpdate foi fornecido).
|
|
1001
|
+
*/
|
|
1002
|
+
addOrEdit(): Promise<Justificativa[]>;
|
|
1003
|
+
/** Soft-delete: marca `removed=true` */
|
|
1004
|
+
remove(id: string | number): Promise<Justificativa[]>;
|
|
1005
|
+
/** Desfaz soft-delete: volta `removed=false` */
|
|
1006
|
+
undoRemove(id: string | number): Promise<Justificativa[]>;
|
|
1007
|
+
/** Valida estado atual (draft nao-vazio quando editando) */
|
|
1008
|
+
validate(): JustificativaValidationResult;
|
|
1009
|
+
/** Reseta para a lista inicial (descarta edicoes locais) */
|
|
1010
|
+
reset(): void;
|
|
1011
|
+
/** Popula a lista para visualizacao/edicao */
|
|
1012
|
+
populateFromExisting(justificativas: Justificativa[]): void;
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
interface JustificativaAdapterOptions {
|
|
1016
|
+
/** Lista inicial (tipicamente vinda do backend via hook consumer) */
|
|
1017
|
+
initialJustificativas?: Justificativa[];
|
|
1018
|
+
/** Usuario corrente — usado para setar `user` ao criar novas */
|
|
1019
|
+
currentUser: JustificativaUserRef;
|
|
1020
|
+
/**
|
|
1021
|
+
* Callback chamado apos qualquer mutacao. Recebe a lista completa
|
|
1022
|
+
* (inclui soft-deleted). O consumer tipicamente faz dispatch Redux
|
|
1023
|
+
* para persistir a alteracao.
|
|
1024
|
+
*
|
|
1025
|
+
* Retorno pode ser `void`, `Promise<void>`, ou `Promise<Justificativa[]>`
|
|
1026
|
+
* (caso o consumer normalize a lista). Quando Promise<Justificativa[]>
|
|
1027
|
+
* for retornada, usamos ela como novo estado.
|
|
1028
|
+
*/
|
|
1029
|
+
onUpdate?: (justificativas: Justificativa[]) => void | Promise<void> | Promise<Justificativa[]>;
|
|
1030
|
+
}
|
|
1031
|
+
/**
|
|
1032
|
+
* Adapter default — gerencia estado local (useState) e delega persistencia
|
|
1033
|
+
* ao consumer via `onUpdate`. Nao fala com Redux diretamente porque
|
|
1034
|
+
* nao existe slice global de justificativas; consumers tipicamente
|
|
1035
|
+
* persistem como parte de uma tarefa/OS/OM.
|
|
1036
|
+
*
|
|
1037
|
+
* Caso um consumer queira slice proprio, basta implementar um Adapter
|
|
1038
|
+
* alternativo respeitando `IJustificativaModalViewModel`.
|
|
1039
|
+
*/
|
|
1040
|
+
declare function useJustificativaModalViewModel(opts: JustificativaAdapterOptions): IJustificativaModalViewModel;
|
|
1041
|
+
|
|
1042
|
+
/**
|
|
1043
|
+
* Port for AnexoManager (ui-kit).
|
|
1044
|
+
*
|
|
1045
|
+
* A UI (`AnexoManager` em ui-kit) eh puramente apresentacional — consome
|
|
1046
|
+
* `persistidos`, `locais`, e callbacks. Esta Port formaliza o ViewModel
|
|
1047
|
+
* reutilizavel, elevando o hook parcial `useAnexoManager` (em core-sdk/hooks)
|
|
1048
|
+
* ao padrao hexagonal completo com contrato explicito + adapter separado.
|
|
1049
|
+
*
|
|
1050
|
+
* O Adapter default (`ReduxAnexoManagerAdapter` — embora nao use Redux:
|
|
1051
|
+
* o nome segue a convencao do core-sdk para indicar "Adapter HTTP/CoreService")
|
|
1052
|
+
* usa `useCoreService().createController('anexo')` por baixo dos panos.
|
|
1053
|
+
*
|
|
1054
|
+
* Modulos que queiram customizar totalmente (testes, mocks, estrategias
|
|
1055
|
+
* alternativas) podem injetar um `IAnexoPort` via `port` ou implementar
|
|
1056
|
+
* um Adapter proprio respeitando `IAnexoManagerViewModel`.
|
|
1057
|
+
*/
|
|
1058
|
+
|
|
1059
|
+
interface IAnexoManagerViewModel {
|
|
1060
|
+
/** Anexos salvos no servidor */
|
|
1061
|
+
persistidos: AnexoPersistido[];
|
|
1062
|
+
/** Anexos selecionados localmente aguardando upload */
|
|
1063
|
+
locais: AnexoLocal[];
|
|
1064
|
+
/** True durante operacoes assincronas */
|
|
1065
|
+
loading: boolean;
|
|
1066
|
+
/** Busca anexos existentes da entidade (via Port.readByEntity) */
|
|
1067
|
+
loadAnexos(): Promise<void>;
|
|
1068
|
+
/** Adiciona arquivos na fila local (ainda nao faz upload) */
|
|
1069
|
+
addFiles(files: File[]): void;
|
|
1070
|
+
/** Remove um arquivo da fila local */
|
|
1071
|
+
removeLocal(localId: string): void;
|
|
1072
|
+
/**
|
|
1073
|
+
* Executa upload de todos os pendentes.
|
|
1074
|
+
* Se `overrideEntityId` for fornecido, usa-o no lugar do entityId do hook —
|
|
1075
|
+
* util quando a entidade foi criada no mesmo fluxo (ex: save-then-upload).
|
|
1076
|
+
* Retorna lista de anexos persistidos.
|
|
1077
|
+
*/
|
|
1078
|
+
uploadAll(overrideEntityId?: string | number): Promise<AnexoPersistido[]>;
|
|
1079
|
+
/** Remove um anexo persistido (chama Port.remove) */
|
|
1080
|
+
removePersistido(anexoId: string | number): Promise<void>;
|
|
1081
|
+
/** Obtem signed URL para preview/download */
|
|
1082
|
+
getUrl(anexoId: string | number, key?: string): Promise<string>;
|
|
1083
|
+
}
|
|
1084
|
+
interface UseAnexoManagerOptions {
|
|
1085
|
+
/** Contexto da entidade (ex: 'ordemDeServico', 'tarefa') */
|
|
1086
|
+
context: string;
|
|
1087
|
+
/** ID da entidade alvo */
|
|
1088
|
+
entityId: string | number;
|
|
1089
|
+
/**
|
|
1090
|
+
* Port customizado (opcional). Por default o adapter constroi um Port
|
|
1091
|
+
* a partir do `useCoreService().createController('anexo')`.
|
|
1092
|
+
*/
|
|
1093
|
+
port?: IAnexoPort;
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
/**
|
|
1097
|
+
* Adapter default do Port `IAnexoManagerViewModel`.
|
|
1098
|
+
*
|
|
1099
|
+
* Delega para `useAnexoManager` (hook parcial ja existente em core-sdk/hooks).
|
|
1100
|
+
* A existencia deste Adapter formaliza a camada: a UI consome
|
|
1101
|
+
* `useAnexoManagerViewModel({...})` e ganha contrato tipado + isolamento
|
|
1102
|
+
* de implementacao.
|
|
1103
|
+
*
|
|
1104
|
+
* Retrocompatibilidade: `useAnexoManager` continua exportado no root do SDK
|
|
1105
|
+
* com a mesma assinatura original.
|
|
1106
|
+
*/
|
|
1107
|
+
|
|
1108
|
+
declare function useAnexoManagerViewModel(opts: UseAnexoManagerOptions): IAnexoManagerViewModel;
|
|
1109
|
+
|
|
1110
|
+
/**
|
|
1111
|
+
* Port for Recorrencia / FrequenciaFormV2 (cross-domain — SGM + SGP).
|
|
1112
|
+
*
|
|
1113
|
+
* Shape alinhado ao contrato do backend `api-manutencao/recorrencia`:
|
|
1114
|
+
*
|
|
1115
|
+
* { id?, valor: number, escala: 'millisecond'|'second'|'minute'|'hour'|'day'|'week'|'month'|'year', dataInicio: ISO }
|
|
1116
|
+
*
|
|
1117
|
+
* SEM conversao a milissegundos no client — o backend persiste `valor`+`escala` cru.
|
|
1118
|
+
* `dataFim`/`diaExecucao`/`horarioExecucao` nao existem neste contrato.
|
|
1119
|
+
*
|
|
1120
|
+
* Responsabilidades de orquestracao (isModel, XOR dataPlanejada vs recorrencia,
|
|
1121
|
+
* coexistencia com agregador, historico) permanecem no caller — este Port foca
|
|
1122
|
+
* apenas na entidade Recorrencia.
|
|
1123
|
+
*
|
|
1124
|
+
* Reescrito em Track C.1 UI (realinhamento atomico) da sprint
|
|
1125
|
+
* 2026-04-20-code-split-fix-e-ports-faltantes.
|
|
1126
|
+
*/
|
|
1127
|
+
type RecorrenciaEscala = 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';
|
|
1128
|
+
interface RecorrenciaValue {
|
|
1129
|
+
id?: number;
|
|
1130
|
+
valor: number;
|
|
1131
|
+
escala: RecorrenciaEscala;
|
|
1132
|
+
/**
|
|
1133
|
+
* ISO 8601. Opcional porque dominios como caderno/planoDeControle nao usam
|
|
1134
|
+
* agendamento temporal, apenas intervalo de amostragem (valor+escala). SGM-OS
|
|
1135
|
+
* (agendamento real de OS) continua passando dataInicio — o default do
|
|
1136
|
+
* FrequenciaFormV2 preserva o campo, entao callers atuais nao precisam mudar.
|
|
1137
|
+
*/
|
|
1138
|
+
dataInicio?: string;
|
|
1139
|
+
}
|
|
1140
|
+
interface RecorrenciaValidationResult {
|
|
1141
|
+
ok: boolean;
|
|
1142
|
+
errors: Record<string, string>;
|
|
1143
|
+
}
|
|
1144
|
+
interface IRecorrenciaViewModel {
|
|
1145
|
+
/**
|
|
1146
|
+
* Estado atual. `null` = "sem recorrencia" (estado valido em UI;
|
|
1147
|
+
* a validacao so acusa invalido se o usuario comecou a preencher).
|
|
1148
|
+
*/
|
|
1149
|
+
value: RecorrenciaValue | null;
|
|
1150
|
+
/**
|
|
1151
|
+
* Regra:
|
|
1152
|
+
* valid = false se value === null OU valor < 1 OU !escala.
|
|
1153
|
+
* dataInicio NAO entra na validacao (opcional — dominios sem agendamento
|
|
1154
|
+
* temporal nao fornecem). Callers que exigem dataInicio fazem validacao
|
|
1155
|
+
* adicional em cima deste Port.
|
|
1156
|
+
* value === null em contexto "sem recorrencia" e valido na UI mas
|
|
1157
|
+
* isValid reflete apenas validade estrutural da entidade Recorrencia.
|
|
1158
|
+
*/
|
|
1159
|
+
isValid: boolean;
|
|
1160
|
+
/** Transiente — true enquanto submit() esta pendente. */
|
|
1161
|
+
isSubmitting: boolean;
|
|
1162
|
+
onValorChange(valor: number): void;
|
|
1163
|
+
onEscalaChange(escala: RecorrenciaEscala): void;
|
|
1164
|
+
/** Aceita undefined para limpar (dominios sem agendamento temporal). */
|
|
1165
|
+
onDataInicioChange(dataInicio: string | undefined): void;
|
|
1166
|
+
/** Seta value = null (estado "sem recorrencia"). */
|
|
1167
|
+
clear(): void;
|
|
1168
|
+
/** Popula para edicao. Aceita null para limpar. */
|
|
1169
|
+
populateFromExisting(value: RecorrenciaValue | null): void;
|
|
1170
|
+
validate(): RecorrenciaValidationResult;
|
|
1171
|
+
/** Valida + retorna DTO (ou null se sem recorrencia). Nao persiste em API. */
|
|
1172
|
+
submit(): Promise<RecorrenciaValue | null>;
|
|
1173
|
+
/** Alias semantico para clear(). */
|
|
1174
|
+
reset(): void;
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
/**
|
|
1178
|
+
* Adapter Redux que implementa IRecorrenciaViewModel.
|
|
1179
|
+
*
|
|
1180
|
+
* Estado lido do slice 'recorrenciaVm' (ver recorrenciaSlice.ts),
|
|
1181
|
+
* parametrizado por entityId para suportar multiplas recorrencias
|
|
1182
|
+
* simultaneas.
|
|
1183
|
+
*
|
|
1184
|
+
* isSubmitting vive em useState local — estado transiente.
|
|
1185
|
+
*/
|
|
1186
|
+
declare function useRecorrenciaViewModel(entityId?: string | number): IRecorrenciaViewModel;
|
|
1187
|
+
|
|
1188
|
+
/**
|
|
1189
|
+
* Slice autonomo para Recorrencia (core-sdk, cross-domain).
|
|
1190
|
+
*
|
|
1191
|
+
* Parametrizado por entityId — mesmo padrao dos demais slices
|
|
1192
|
+
* (unidadeMaterialSlice, inspecaoModalSlice).
|
|
1193
|
+
* Chave '__default__' armazena o estado quando nenhum entityId eh fornecido.
|
|
1194
|
+
*
|
|
1195
|
+
* Shape alinhado ao backend `api-manutencao/recorrencia`:
|
|
1196
|
+
* { id?, valor, escala, dataInicio }
|
|
1197
|
+
*
|
|
1198
|
+
* `value === null` = estado "sem recorrencia" (entidade ausente).
|
|
1199
|
+
*/
|
|
1200
|
+
declare const DEFAULT_KEY$1 = "__default__";
|
|
1201
|
+
interface RecorrenciaSliceState {
|
|
1202
|
+
byEntity: Record<string, RecorrenciaValue | null>;
|
|
1203
|
+
}
|
|
1204
|
+
interface ByEntityPayload$1<T> {
|
|
1205
|
+
entityId?: string | number;
|
|
1206
|
+
value: T;
|
|
1207
|
+
}
|
|
1208
|
+
declare const setRecorrenciaValor: _reduxjs_toolkit.ActionCreatorWithPayload<ByEntityPayload$1<number>, "recorrenciaVm/setValor">;
|
|
1209
|
+
declare const setRecorrenciaEscala: _reduxjs_toolkit.ActionCreatorWithPayload<ByEntityPayload$1<RecorrenciaEscala>, "recorrenciaVm/setEscala">;
|
|
1210
|
+
declare const setRecorrenciaDataInicio: _reduxjs_toolkit.ActionCreatorWithPayload<ByEntityPayload$1<string | null | undefined>, "recorrenciaVm/setDataInicio">;
|
|
1211
|
+
declare const populateRecorrencia: _reduxjs_toolkit.ActionCreatorWithPayload<ByEntityPayload$1<RecorrenciaValue | null>, "recorrenciaVm/populate">;
|
|
1212
|
+
declare const clearRecorrencia: _reduxjs_toolkit.ActionCreatorWithPayload<{
|
|
1213
|
+
entityId?: string | number;
|
|
1214
|
+
}, "recorrenciaVm/clearRecorrencia">;
|
|
1215
|
+
declare const selectRecorrencia: (state: any, entityId?: string | number) => RecorrenciaValue | null;
|
|
1216
|
+
declare const _default$5: redux.Reducer<RecorrenciaSliceState>;
|
|
1217
|
+
|
|
1218
|
+
/**
|
|
1219
|
+
* Port for Contador / ContadorPicker (cross-domain — SGM + SGP).
|
|
1220
|
+
*
|
|
1221
|
+
* Implementado por ReduxContadorAdapter. A UI (ContadorPicker em
|
|
1222
|
+
* ui-kit-core) nao deve chamar useSelector/useDispatch/useCoreService —
|
|
1223
|
+
* consome exclusivamente este contrato via useContadorViewModel().
|
|
1224
|
+
*
|
|
1225
|
+
* Alinhado ao shape real usado em TarefaFormV2 + LimiteDeControlePicker
|
|
1226
|
+
* legacy (SGM-OS): um "contador" eh uma leitura numerica com unidade,
|
|
1227
|
+
* parametro e lista de limites de controle (min/max/target com regra
|
|
1228
|
+
* de comparacao).
|
|
1229
|
+
*
|
|
1230
|
+
* Reaproveita o tipo `LimiteDeControle` ja exportado por
|
|
1231
|
+
* IInspecaoModalViewModel para manter 1 unica fonte de verdade.
|
|
1232
|
+
*/
|
|
1233
|
+
|
|
1234
|
+
type ContadorBoundRule = '>=' | '<=' | '>' | '<' | '==' | '!=';
|
|
1235
|
+
interface ContadorValue {
|
|
1236
|
+
/** Leitura atual do contador (ex.: 23.5). Null quando ainda nao lido. */
|
|
1237
|
+
valor: number | null;
|
|
1238
|
+
/** Unidade de medida (ex.: "°C", "kg", "un"). */
|
|
1239
|
+
unidade: string | null;
|
|
1240
|
+
/** Nome do parametro medido (ex.: "Temperatura"). */
|
|
1241
|
+
parametro: string | null;
|
|
1242
|
+
/** Limites de controle aplicaveis (min/max/target + regra). */
|
|
1243
|
+
limitesDeControle: LimiteDeControle[];
|
|
1244
|
+
}
|
|
1245
|
+
interface ContadorValidationResult {
|
|
1246
|
+
ok: boolean;
|
|
1247
|
+
errors: Record<string, string>;
|
|
1248
|
+
}
|
|
1249
|
+
interface IContadorViewModel {
|
|
1250
|
+
/** Estado atual do contador (Redux). */
|
|
1251
|
+
value: ContadorValue;
|
|
1252
|
+
/** Flag derivada — ver regra em validate(). */
|
|
1253
|
+
isValid: boolean;
|
|
1254
|
+
/** Flag transiente — true enquanto submit() esta pendente. */
|
|
1255
|
+
isSubmitting: boolean;
|
|
1256
|
+
/** Atualiza a leitura numerica. */
|
|
1257
|
+
onValorChange(v: number | null): void;
|
|
1258
|
+
/** Atualiza a unidade de medida. */
|
|
1259
|
+
onUnidadeChange(u: string): void;
|
|
1260
|
+
/** Atualiza o nome do parametro. */
|
|
1261
|
+
onParametroChange(p: string): void;
|
|
1262
|
+
/** Anexa um novo limite de controle ao final da lista. */
|
|
1263
|
+
onLimiteAdd(limite: LimiteDeControle): void;
|
|
1264
|
+
/** Remove o limite no indice informado (hard-delete no array). */
|
|
1265
|
+
onLimiteRemove(index: number): void;
|
|
1266
|
+
/** Substitui o limite no indice informado. */
|
|
1267
|
+
onLimiteUpdate(index: number, limite: LimiteDeControle): void;
|
|
1268
|
+
/**
|
|
1269
|
+
* Validacao sincrona:
|
|
1270
|
+
* - valor finito quando presente
|
|
1271
|
+
* - unidade nao-vazia quando ha valor
|
|
1272
|
+
* - cada limite precisa de nome, boundRule e valor numerico finito
|
|
1273
|
+
*/
|
|
1274
|
+
validate(): ContadorValidationResult;
|
|
1275
|
+
/** Valida + retorna DTO. Nao persiste em API. */
|
|
1276
|
+
submit(): Promise<ContadorValue>;
|
|
1277
|
+
/** Limpa para initialState. */
|
|
1278
|
+
reset(): void;
|
|
1279
|
+
/** Popula para edicao. */
|
|
1280
|
+
populateFromExisting(value: ContadorValue): void;
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
/**
|
|
1284
|
+
* Adapter Redux que implementa IContadorViewModel.
|
|
1285
|
+
*
|
|
1286
|
+
* Estado lido do slice 'contadorVm' (ver contadorSlice.ts),
|
|
1287
|
+
* parametrizado por entityId para suportar multiplos contadores
|
|
1288
|
+
* simultaneos (ex.: varias tarefas com leitura propria).
|
|
1289
|
+
*
|
|
1290
|
+
* isSubmitting vive em useState local — estado transiente.
|
|
1291
|
+
*/
|
|
1292
|
+
declare function useContadorViewModel(entityId?: string | number): IContadorViewModel;
|
|
1293
|
+
|
|
1294
|
+
/**
|
|
1295
|
+
* IMantenedorPickerViewModel — Port do widget de seleção de manutentor
|
|
1296
|
+
* (Wave 5B hexagonal). Suporta estado client-side de busca + fluxo de
|
|
1297
|
+
* confirmação de desalocação quando o mantenedor selecionado já está
|
|
1298
|
+
* alocado em outra OS.
|
|
1299
|
+
*/
|
|
1300
|
+
interface MantenedorOption {
|
|
1301
|
+
id: number | string;
|
|
1302
|
+
nomeUsuario: string;
|
|
1303
|
+
_busy?: boolean;
|
|
1304
|
+
osId?: number | string | null;
|
|
1305
|
+
[key: string]: unknown;
|
|
1306
|
+
}
|
|
1307
|
+
interface IMantenedorPickerViewModel {
|
|
1308
|
+
readonly options: MantenedorOption[];
|
|
1309
|
+
readonly filteredOptions: MantenedorOption[];
|
|
1310
|
+
readonly searchTerm: string;
|
|
1311
|
+
readonly isLoading: boolean;
|
|
1312
|
+
readonly error?: string | null;
|
|
1313
|
+
readonly pendingConfirm: MantenedorOption | null;
|
|
1314
|
+
search(term: string): void;
|
|
1315
|
+
refresh(): Promise<void>;
|
|
1316
|
+
requestSelect(item: MantenedorOption, currentOsId?: number | string | null): 'confirm' | 'immediate';
|
|
1317
|
+
confirmSelect(): MantenedorOption | null;
|
|
1318
|
+
cancelConfirm(): void;
|
|
1319
|
+
reset(): void;
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
/**
|
|
1323
|
+
* Adapter Redux que implementa IMantenedorPickerViewModel.
|
|
1324
|
+
*
|
|
1325
|
+
* Estado lido do slice 'mantenedorPicker', parametrizado por entityId
|
|
1326
|
+
* (normalmente osId). IO via useCoreService().createController('mantenedor').
|
|
1327
|
+
*/
|
|
1328
|
+
declare function useMantenedorPickerViewModel(entityId?: string | number | null): IMantenedorPickerViewModel;
|
|
1329
|
+
|
|
1330
|
+
/**
|
|
1331
|
+
* Slice do MantenedorPicker (Wave 5B). Parametrizado por entityId
|
|
1332
|
+
* (tipicamente osId) — mesmo padrão dos demais slices hexagonais.
|
|
1333
|
+
*/
|
|
1334
|
+
interface MantenedorPickerSlot {
|
|
1335
|
+
options: MantenedorOption[];
|
|
1336
|
+
searchTerm: string;
|
|
1337
|
+
isLoading: boolean;
|
|
1338
|
+
error: string | null;
|
|
1339
|
+
pendingConfirm: MantenedorOption | null;
|
|
1340
|
+
}
|
|
1341
|
+
interface MantenedorPickerSliceState {
|
|
1342
|
+
byEntity: Record<string, MantenedorPickerSlot>;
|
|
1343
|
+
}
|
|
1344
|
+
declare const setMantenedorOptions: _reduxjs_toolkit.ActionCreatorWithPayload<{
|
|
1345
|
+
key: string;
|
|
1346
|
+
options: MantenedorOption[];
|
|
1347
|
+
}, "mantenedorPicker/setOptions">;
|
|
1348
|
+
declare const setMantenedorSearchTerm: _reduxjs_toolkit.ActionCreatorWithPayload<{
|
|
1349
|
+
key: string;
|
|
1350
|
+
term: string;
|
|
1351
|
+
}, "mantenedorPicker/setSearchTerm">;
|
|
1352
|
+
declare const setMantenedorLoading: _reduxjs_toolkit.ActionCreatorWithPayload<{
|
|
1353
|
+
key: string;
|
|
1354
|
+
loading: boolean;
|
|
1355
|
+
}, "mantenedorPicker/setLoading">;
|
|
1356
|
+
declare const setMantenedorError: _reduxjs_toolkit.ActionCreatorWithPayload<{
|
|
1357
|
+
key: string;
|
|
1358
|
+
error: string | null;
|
|
1359
|
+
}, "mantenedorPicker/setError">;
|
|
1360
|
+
declare const setMantenedorPendingConfirm: _reduxjs_toolkit.ActionCreatorWithPayload<{
|
|
1361
|
+
key: string;
|
|
1362
|
+
item: MantenedorOption | null;
|
|
1363
|
+
}, "mantenedorPicker/setPendingConfirm">;
|
|
1364
|
+
declare const clearMantenedorSlot: _reduxjs_toolkit.ActionCreatorWithPayload<{
|
|
1365
|
+
key: string;
|
|
1366
|
+
}, "mantenedorPicker/clearSlot">;
|
|
1367
|
+
declare const _default$4: redux.Reducer<MantenedorPickerSliceState>;
|
|
1368
|
+
|
|
1369
|
+
/**
|
|
1370
|
+
* Slice autonomo para Contador (core-sdk, cross-domain).
|
|
1371
|
+
*
|
|
1372
|
+
* Parametrizado por entityId — mesmo padrao de recorrenciaSlice /
|
|
1373
|
+
* unidadeMaterialSlice / inspecaoModalSlice.
|
|
1374
|
+
* Chave '__default__' armazena o estado quando nenhum entityId eh fornecido.
|
|
1375
|
+
*
|
|
1376
|
+
* `entityId` eh generico: no SGM-OS eh o id da tarefa/OS; no SGP-caderno
|
|
1377
|
+
* pode ser o id do campo de verificacao.
|
|
1378
|
+
*/
|
|
1379
|
+
declare const DEFAULT_KEY = "__default__";
|
|
1380
|
+
interface ContadorSliceState {
|
|
1381
|
+
byEntity: Record<string, ContadorValue>;
|
|
1382
|
+
}
|
|
1383
|
+
interface ByEntityPayload<T> {
|
|
1384
|
+
entityId?: string | number;
|
|
1385
|
+
value: T;
|
|
1386
|
+
}
|
|
1387
|
+
interface ByEntityIndexedPayload<T> {
|
|
1388
|
+
entityId?: string | number;
|
|
1389
|
+
index: number;
|
|
1390
|
+
value: T;
|
|
1391
|
+
}
|
|
1392
|
+
declare const setContadorValor: _reduxjs_toolkit.ActionCreatorWithPayload<ByEntityPayload<number | null>, "contadorVm/setValor">;
|
|
1393
|
+
declare const setContadorUnidade: _reduxjs_toolkit.ActionCreatorWithPayload<ByEntityPayload<string>, "contadorVm/setUnidade">;
|
|
1394
|
+
declare const setContadorParametro: _reduxjs_toolkit.ActionCreatorWithPayload<ByEntityPayload<string>, "contadorVm/setParametro">;
|
|
1395
|
+
declare const addContadorLimite: _reduxjs_toolkit.ActionCreatorWithPayload<ByEntityPayload<LimiteDeControle>, "contadorVm/addLimite">;
|
|
1396
|
+
declare const removeContadorLimiteAt: _reduxjs_toolkit.ActionCreatorWithPayload<{
|
|
1397
|
+
entityId?: string | number;
|
|
1398
|
+
index: number;
|
|
1399
|
+
}, "contadorVm/removeLimiteAt">;
|
|
1400
|
+
declare const updateContadorLimiteAt: _reduxjs_toolkit.ActionCreatorWithPayload<ByEntityIndexedPayload<LimiteDeControle>, "contadorVm/updateLimiteAt">;
|
|
1401
|
+
declare const populateContador: _reduxjs_toolkit.ActionCreatorWithPayload<ByEntityPayload<ContadorValue>, "contadorVm/populate">;
|
|
1402
|
+
declare const clearContador: _reduxjs_toolkit.ActionCreatorWithPayload<{
|
|
1403
|
+
entityId?: string | number;
|
|
1404
|
+
}, "contadorVm/clearContador">;
|
|
1405
|
+
declare const selectContador: (state: any, entityId?: string | number) => ContadorValue;
|
|
1406
|
+
declare const _default$3: redux.Reducer<ContadorSliceState>;
|
|
1407
|
+
|
|
1408
|
+
/**
|
|
1409
|
+
* Port para o status de uma Tarefa (TarefaItem em modo execucao).
|
|
1410
|
+
*
|
|
1411
|
+
* Implementado por `ReduxTarefaStatusAdapter`. A UI apresentacional
|
|
1412
|
+
* (`TarefaItem` em ui-kit-sgm) consome o contrato exclusivamente via
|
|
1413
|
+
* `useTarefaStatusViewModel({ tarefaId, fatherId })`, sem importar
|
|
1414
|
+
* Redux/useCoreService.
|
|
1415
|
+
*
|
|
1416
|
+
* Semantica:
|
|
1417
|
+
* - `current` reflete o status atual da tarefa (PENDENTE | EXECUTANDO | ENCERRADO)
|
|
1418
|
+
* - `toggle()` alterna entre PENDENTE e ENCERRADO. O Adapter aplica o flip
|
|
1419
|
+
* localmente (otimista), persiste via `PUT /ordemDeServico/tarefa/:id`
|
|
1420
|
+
* com payload `{ status, fatherId? }`. Em erro, reverte e dispara
|
|
1421
|
+
* `useToast().warning(...)`.
|
|
1422
|
+
* - `saving` indica operacao em curso.
|
|
1423
|
+
*/
|
|
1424
|
+
type TarefaStatus = 'PENDENTE' | 'EXECUTANDO' | 'ENCERRADO';
|
|
1425
|
+
interface ITarefaStatusViewModel {
|
|
1426
|
+
/** Status atual da tarefa */
|
|
1427
|
+
current: TarefaStatus;
|
|
1428
|
+
/**
|
|
1429
|
+
* Alterna PENDENTE ↔ ENCERRADO. Persiste via
|
|
1430
|
+
* `PUT /ordemDeServico/tarefa/:id` `{ status, fatherId? }`.
|
|
1431
|
+
* Em erro, reverte estado local e dispara toast warning.
|
|
1432
|
+
*/
|
|
1433
|
+
toggle(): Promise<void>;
|
|
1434
|
+
/** True enquanto a chamada de persistencia esta em curso */
|
|
1435
|
+
saving: boolean;
|
|
1436
|
+
}
|
|
1437
|
+
interface UseTarefaStatusOptions {
|
|
1438
|
+
/** Id da tarefa alvo */
|
|
1439
|
+
tarefaId: string | number;
|
|
1440
|
+
/**
|
|
1441
|
+
* Id da estrutura pai (ex: ordemDeServicoId). Quando definido, o Adapter
|
|
1442
|
+
* inclui no body do PUT (`{ status, fatherId }`). Mantem semantica do
|
|
1443
|
+
* legacy `TarefaItem.js#handleToggleStatus`.
|
|
1444
|
+
*/
|
|
1445
|
+
fatherId?: number | null;
|
|
1446
|
+
/**
|
|
1447
|
+
* Status inicial. Default `'PENDENTE'`. O caller normalmente passa o
|
|
1448
|
+
* status atual da tarefa carregada (ex: `tarefa.status`).
|
|
1449
|
+
*/
|
|
1450
|
+
initialStatus?: TarefaStatus;
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
/**
|
|
1454
|
+
* Adapter default do Port `ITarefaStatusViewModel`.
|
|
1455
|
+
*
|
|
1456
|
+
* Embora nomeado "Redux*Adapter" pela convencao do core-sdk, NAO usa Redux —
|
|
1457
|
+
* apenas `useState` local + `useCoreService().createController('tarefa')`
|
|
1458
|
+
* para persistir via `PUT /tarefa/:id`.
|
|
1459
|
+
*
|
|
1460
|
+
* Backend: TarefaController montado em `@Controller("/")` + prefix `tarefa`
|
|
1461
|
+
* → `/tarefa/:id` (root, sem prefixo /ordemDeServico). Tarefas com id UUID
|
|
1462
|
+
* (recorrencia) tambem sao aceitas porque o service trata generico.
|
|
1463
|
+
*
|
|
1464
|
+
* Em caso de erro de persistencia, reverte o estado e dispara
|
|
1465
|
+
* `useToast().warning(...)` informando o usuario.
|
|
1466
|
+
*/
|
|
1467
|
+
|
|
1468
|
+
declare function useTarefaStatusViewModel(opts: UseTarefaStatusOptions): ITarefaStatusViewModel;
|
|
1469
|
+
|
|
1470
|
+
/**
|
|
1471
|
+
* Port para a lista de Observacoes (Justificativas) de uma Tarefa.
|
|
1472
|
+
*
|
|
1473
|
+
* Implementado por `ReduxObservacoesTarefaAdapter`. A UI apresentacional
|
|
1474
|
+
* (`ObservacaoModal` em ui-kit-sgm) consome o contrato exclusivamente via
|
|
1475
|
+
* `useObservacoesTarefaViewModel({ tarefaId })`, sem importar
|
|
1476
|
+
* Redux/useCoreService.
|
|
1477
|
+
*
|
|
1478
|
+
* Endpoints (api-manutencao):
|
|
1479
|
+
* - `GET /ordemDeServico/tarefa/readObservacoesTarefa/:id`
|
|
1480
|
+
* - `POST /ordemDeServico/tarefa/addObservacaoTarefa/:tarefaId`
|
|
1481
|
+
*
|
|
1482
|
+
* `add(...)` dispara `load()` ao concluir, garantindo lista atualizada.
|
|
1483
|
+
*/
|
|
1484
|
+
interface ObservacaoTarefaPayload {
|
|
1485
|
+
/** Texto livre da observacao/justificativa */
|
|
1486
|
+
texto: string;
|
|
1487
|
+
[k: string]: unknown;
|
|
1488
|
+
}
|
|
1489
|
+
interface IObservacoesTarefaViewModel {
|
|
1490
|
+
/** Lista atual de observacoes carregadas (any[] preserva shape backend) */
|
|
1491
|
+
list: any[];
|
|
1492
|
+
/** True durante operacoes assincronas (load/add) */
|
|
1493
|
+
loading: boolean;
|
|
1494
|
+
/** Carrega lista do servidor */
|
|
1495
|
+
load(): Promise<void>;
|
|
1496
|
+
/**
|
|
1497
|
+
* Adiciona observacao no servidor e dispara `load()` ao concluir.
|
|
1498
|
+
* Nao mantem estado otimista — fluxo simples post-then-fetch.
|
|
1499
|
+
*/
|
|
1500
|
+
add(obs: ObservacaoTarefaPayload): Promise<void>;
|
|
1501
|
+
}
|
|
1502
|
+
interface UseObservacoesTarefaOptions {
|
|
1503
|
+
/** Id da tarefa alvo */
|
|
1504
|
+
tarefaId: string | number;
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1507
|
+
/**
|
|
1508
|
+
* Adapter default do Port `IObservacoesTarefaViewModel`.
|
|
1509
|
+
*
|
|
1510
|
+
* Embora nomeado "Redux*Adapter" pela convencao do core-sdk, NAO usa Redux —
|
|
1511
|
+
* apenas `useState` local + `useCoreService().createController('tarefa')`
|
|
1512
|
+
* para chamar:
|
|
1513
|
+
* - `GET /tarefa/readObservacoesTarefa/:id` → `load()`
|
|
1514
|
+
* - `POST /tarefa/addObservacaoTarefa/:id` → `add({ texto })`
|
|
1515
|
+
*
|
|
1516
|
+
* Backend: TarefaController em api-manutencao agora montado em `@Controller("/")`
|
|
1517
|
+
* + prefix `tarefa` (sprint 2026-04-29-tarefa-item-unified — anteriormente
|
|
1518
|
+
* `@Controller("/ordemDeServico")`).
|
|
1519
|
+
*
|
|
1520
|
+
* Em erro de persistencia, dispara `useToast().warning(...)` e mantem o
|
|
1521
|
+
* estado local consistente.
|
|
1522
|
+
*/
|
|
1523
|
+
|
|
1524
|
+
declare function useObservacoesTarefaViewModel(opts: UseObservacoesTarefaOptions): IObservacoesTarefaViewModel;
|
|
1525
|
+
|
|
1526
|
+
/**
|
|
1527
|
+
* IPickMantenedorTipoViewModel — Port para o fluxo "configurar OS antes
|
|
1528
|
+
* de iniciar" (atribuir mantenedor + tipo de ordem).
|
|
1529
|
+
*
|
|
1530
|
+
* Promove o legacy SGM-OS PickMantenedorModal — usado tanto pelo
|
|
1531
|
+
* Planejamento quanto pela tela Executar Ordem de Manutenção (statusBindChange).
|
|
1532
|
+
*
|
|
1533
|
+
* Design:
|
|
1534
|
+
* - Carrega `mantenedores` via GET mantenedor/mantenedorDashboard
|
|
1535
|
+
* - Carrega `tiposDeOrdem` via GET tipoDeOrdem
|
|
1536
|
+
* - Atribui mantenedor via POST ordemDeServico/atribuirMantenedor/:osId
|
|
1537
|
+
* - Atribui tipo via PUT ordemDeServico/updateTipoDeOrdem/:osId
|
|
1538
|
+
* - Estado fica num slice flat (singleton — modal só aparece um por vez)
|
|
1539
|
+
*/
|
|
1540
|
+
interface PickMantenedorOption {
|
|
1541
|
+
id: number | string;
|
|
1542
|
+
userId?: number | string;
|
|
1543
|
+
nomeUsuario?: string;
|
|
1544
|
+
nome?: string;
|
|
1545
|
+
[key: string]: unknown;
|
|
1546
|
+
}
|
|
1547
|
+
interface PickTipoDeOrdemOption {
|
|
1548
|
+
id: number | string;
|
|
1549
|
+
tipo: string;
|
|
1550
|
+
[key: string]: unknown;
|
|
1551
|
+
}
|
|
1552
|
+
interface IPickMantenedorTipoViewModel {
|
|
1553
|
+
readonly mantenedores: PickMantenedorOption[];
|
|
1554
|
+
readonly tiposDeOrdem: PickTipoDeOrdemOption[];
|
|
1555
|
+
readonly loading: boolean;
|
|
1556
|
+
readonly assigning: boolean;
|
|
1557
|
+
readonly error: string | null;
|
|
1558
|
+
/** Carrega mantenedores + tipos em paralelo */
|
|
1559
|
+
loadOptions(): Promise<void>;
|
|
1560
|
+
/** POST ordemDeServico/atribuirMantenedor/:osId para cada item */
|
|
1561
|
+
assignMantenedores(osId: number | string, mantenedores: PickMantenedorOption[]): Promise<void>;
|
|
1562
|
+
/** PUT ordemDeServico/updateTipoDeOrdem/:osId */
|
|
1563
|
+
assignTipo(osId: number | string, tipoId: number | string): Promise<void>;
|
|
1564
|
+
/**
|
|
1565
|
+
* Aplica os mesmos mantenedores em N OS (uma chamada bulk por mantenedor).
|
|
1566
|
+
* Usa POST ordemDeServico/atribuirMantenedorBulk { osIds, mantenedorId, userId }.
|
|
1567
|
+
*/
|
|
1568
|
+
assignMantenedoresMultiOs(osIds: Array<number | string>, mantenedores: PickMantenedorOption[]): Promise<void>;
|
|
1569
|
+
/**
|
|
1570
|
+
* Aplica o mesmo tipo em N OS via PUT ordemDeServico/updateTipoBulk { osIds, tipoId }.
|
|
1571
|
+
*/
|
|
1572
|
+
assignTipoMultiOs(osIds: Array<number | string>, tipoId: number | string): Promise<void>;
|
|
1573
|
+
/** Reseta estado (limpa cache de options) */
|
|
1574
|
+
reset(): void;
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
declare function usePickMantenedorTipoViewModel(): IPickMantenedorTipoViewModel;
|
|
1578
|
+
|
|
1579
|
+
interface PickMantenedorTipoSliceState {
|
|
1580
|
+
mantenedores: PickMantenedorOption[];
|
|
1581
|
+
tiposDeOrdem: PickTipoDeOrdemOption[];
|
|
1582
|
+
loading: boolean;
|
|
1583
|
+
assigning: boolean;
|
|
1584
|
+
error: string | null;
|
|
1585
|
+
}
|
|
1586
|
+
declare const setPickMantenedorTipoOptions: _reduxjs_toolkit.ActionCreatorWithPayload<{
|
|
1587
|
+
mantenedores: PickMantenedorOption[];
|
|
1588
|
+
tiposDeOrdem: PickTipoDeOrdemOption[];
|
|
1589
|
+
}, "pickMantenedorTipo/setOptions">;
|
|
1590
|
+
declare const setPickMantenedorTipoLoading: _reduxjs_toolkit.ActionCreatorWithPayload<boolean, "pickMantenedorTipo/setLoading">;
|
|
1591
|
+
declare const setPickMantenedorTipoAssigning: _reduxjs_toolkit.ActionCreatorWithPayload<boolean, "pickMantenedorTipo/setAssigning">;
|
|
1592
|
+
declare const setPickMantenedorTipoError: _reduxjs_toolkit.ActionCreatorWithPayload<string | null, "pickMantenedorTipo/setError">;
|
|
1593
|
+
declare const resetPickMantenedorTipo: _reduxjs_toolkit.ActionCreatorWithoutPayload<"pickMantenedorTipo/reset">;
|
|
1594
|
+
declare const _default$2: redux.Reducer<PickMantenedorTipoSliceState>;
|
|
1595
|
+
|
|
1596
|
+
/**
|
|
1597
|
+
* Port umbrella para o componente `TarefaItem` (ui-kit-sgm).
|
|
1598
|
+
*
|
|
1599
|
+
* Composicao de cinco VMs ja existentes/novos no core-sdk:
|
|
1600
|
+
* - status → `ITarefaStatusViewModel` (PENDENTE↔ENCERRADO + persist)
|
|
1601
|
+
* - observacoes → `IObservacoesTarefaViewModel` (load/add justificativas)
|
|
1602
|
+
* - inspecao → `IInspecaoModalViewModel` (form de nova inspecao)
|
|
1603
|
+
* - unidadeMaterial → `IUnidadeMaterialViewModel` (composicao mat+un+qtd)
|
|
1604
|
+
* - anexos → `IAnexoManagerViewModel` (signed-URL, intent/confirm)
|
|
1605
|
+
*
|
|
1606
|
+
* Mais duas operacoes de nivel da tarefa:
|
|
1607
|
+
* - `updateDescricao(texto)` → `PUT /ordemDeServico/tarefa/:id` `{ descricao }`
|
|
1608
|
+
* - `subscribeLive()` → ativa/desativa subscriptions RTDB (apenas em
|
|
1609
|
+
* `mode='execute'`); em outros modos retorna no-op (`() => {}`).
|
|
1610
|
+
*
|
|
1611
|
+
* Sobre `subscribeLive`:
|
|
1612
|
+
* - O caller (UI) chama dentro de `useEffect` para manter o ciclo de vida
|
|
1613
|
+
* em si — o Adapter NAO usa o hook `useMatchingObject` internamente
|
|
1614
|
+
* (regra das hooks: nao chamavel dentro de funcoes). Em vez disso,
|
|
1615
|
+
* delega a `useCoreService().subscribe/unsubscribe` (nao-hook).
|
|
1616
|
+
* - Em `mode='execute'` registra as MOs do legacy TarefaItem.js linhas
|
|
1617
|
+
* 136-158: `tarefa{id}` e `tarefaJus{id}` com location `*`. O refresher
|
|
1618
|
+
* chama `observacoes.load()` (e `anexos.loadAnexos()` quando aplicavel).
|
|
1619
|
+
*
|
|
1620
|
+
* Consumo:
|
|
1621
|
+
* const vm = useTarefaItemViewModel({ tarefaId, mode: 'execute', fatherId })
|
|
1622
|
+
* useEffect(() => vm.subscribeLive(), [vm])
|
|
1623
|
+
* <TarefaItem vm={vm} mode="execute" tarefa={...} />
|
|
1624
|
+
*/
|
|
1625
|
+
|
|
1626
|
+
type TarefaItemMode = 'edit' | 'execute' | 'readOnly';
|
|
1627
|
+
interface ITarefaItemViewModel {
|
|
1628
|
+
/** Status da tarefa (PENDENTE↔ENCERRADO). Ativo em modo 'execute'. */
|
|
1629
|
+
status: ITarefaStatusViewModel;
|
|
1630
|
+
/** Lista de observacoes/justificativas da tarefa */
|
|
1631
|
+
observacoes: IObservacoesTarefaViewModel;
|
|
1632
|
+
/** Form de nova inspecao (delegado ao IInspecaoModalViewModel existente) */
|
|
1633
|
+
inspecao: IInspecaoModalViewModel;
|
|
1634
|
+
/** Composicao Material+Unidade+Quantidade (delegado ao IUnidadeMaterialViewModel) */
|
|
1635
|
+
unidadeMaterial: IUnidadeMaterialViewModel;
|
|
1636
|
+
/**
|
|
1637
|
+
* Anexos via fluxo signed-URL (delegado ao IAnexoManagerViewModel — mesmo
|
|
1638
|
+
* fluxo de `context: 'tarefa'`, `entityId: tarefaId`).
|
|
1639
|
+
*/
|
|
1640
|
+
anexos: IAnexoManagerViewModel;
|
|
1641
|
+
/**
|
|
1642
|
+
* Persiste descricao via `PUT /ordemDeServico/tarefa/:tarefaId`
|
|
1643
|
+
* com payload `{ descricao: texto }`.
|
|
1644
|
+
*/
|
|
1645
|
+
updateDescricao(texto: string): Promise<void>;
|
|
1646
|
+
/**
|
|
1647
|
+
* Ativa subscription RTDB (apenas em `mode='execute'`).
|
|
1648
|
+
* Retorna funcao de unsubscribe. Em outros modos retorna `() => {}`.
|
|
1649
|
+
*
|
|
1650
|
+
* O caller deve invocar dentro de `useEffect`:
|
|
1651
|
+
* useEffect(() => vm.subscribeLive(), [vm])
|
|
1652
|
+
*/
|
|
1653
|
+
subscribeLive(): () => void;
|
|
1654
|
+
}
|
|
1655
|
+
interface UseTarefaItemViewModelOptions {
|
|
1656
|
+
/** Id da tarefa alvo */
|
|
1657
|
+
tarefaId: string | number;
|
|
1658
|
+
/**
|
|
1659
|
+
* Modo de operacao do componente:
|
|
1660
|
+
* - 'edit' → edicao (TarefasTab no FormV2). Sem subscription RTDB.
|
|
1661
|
+
* - 'execute' → execucao (OrdemDeServico tela). Subscription RTDB ativa.
|
|
1662
|
+
* - 'readOnly' → apenas leitura. Sem subscription, sem mutacao.
|
|
1663
|
+
*/
|
|
1664
|
+
mode: TarefaItemMode;
|
|
1665
|
+
/**
|
|
1666
|
+
* Id da estrutura pai (ex: ordemDeServicoId). Repassado para
|
|
1667
|
+
* `useTarefaStatusViewModel` ao alternar status.
|
|
1668
|
+
*/
|
|
1669
|
+
fatherId?: number | null;
|
|
1670
|
+
/** Status inicial da tarefa, repassado para `useTarefaStatusViewModel`. */
|
|
1671
|
+
initialStatus?: ITarefaStatusViewModel['current'];
|
|
1672
|
+
}
|
|
1673
|
+
|
|
1674
|
+
/**
|
|
1675
|
+
* Adapter default do Port `ITarefaItemViewModel`.
|
|
1676
|
+
*
|
|
1677
|
+
* Compoe os 5 VMs (status, observacoes, inspecao, unidadeMaterial, anexos),
|
|
1678
|
+
* adiciona `updateDescricao(...)` (PUT /ordemDeServico/tarefa/:id) e
|
|
1679
|
+
* `subscribeLive()` (RTDB em modo execute, no-op nos demais).
|
|
1680
|
+
*
|
|
1681
|
+
* Sobre `subscribeLive`:
|
|
1682
|
+
* - `useMatchingObject` NAO pode ser invocado dentro de `subscribeLive`
|
|
1683
|
+
* (regra das hooks). Por isso usamos `subscribe`/`unsubscribe` do
|
|
1684
|
+
* `useCoreService()` que sao funcoes regulares.
|
|
1685
|
+
* - O caller (UI) deve chamar dentro de `useEffect`, fazendo do retorno
|
|
1686
|
+
* o cleanup:
|
|
1687
|
+
*
|
|
1688
|
+
* useEffect(() => vm.subscribeLive(), [vm])
|
|
1689
|
+
*
|
|
1690
|
+
* - Em `mode='execute'` registra MOs:
|
|
1691
|
+
* `{ context: 'tarefa{id}', location: '*', refresher }`
|
|
1692
|
+
* `{ context: 'tarefaJus{id}', location: '*', refresher }`
|
|
1693
|
+
* O `refresher` dispara `observacoes.load()` (e poderia disparar mais
|
|
1694
|
+
* refreshes — anexos.loadAnexos — se necessario; mantido conservador
|
|
1695
|
+
* aqui para nao causar loops).
|
|
1696
|
+
*/
|
|
1697
|
+
|
|
1698
|
+
declare function useTarefaItemViewModel(opts: UseTarefaItemViewModelOptions): ITarefaItemViewModel;
|
|
306
1699
|
|
|
307
1700
|
interface BranchLevelForm {
|
|
308
1701
|
nome: string;
|
|
@@ -391,4 +1784,4 @@ declare function removeAccents(str: string): string;
|
|
|
391
1784
|
declare function slugify(str: string): string;
|
|
392
1785
|
declare function isBlank(str: string | null | undefined): boolean;
|
|
393
1786
|
|
|
394
|
-
export { BreadcrumbPayload, CoreService, CoreServiceBuilder, CoreServiceContext, FetchHttpAdapter, HttpController, IObservabilityPort, InteractionPayload, type NavigateFn, type NavigationConfig, type Notification, type NotificationState, NullCoreService, NullHttpController, NullObservabilityAdapter, NullToastService,
|
|
1787
|
+
export { type AnexoLocal, type AnexoPersistido, type Branch, type BranchLevelRef, type BranchNodeRef, BreadcrumbPayload, DEFAULT_KEY as CONTADOR_DEFAULT_KEY, type CalculoDeCorrecao, type ContadorBoundRule, type ContadorSliceState, type ContadorValidationResult, type ContadorValue, CoreService, CoreServiceBuilder, CoreServiceContext, FILTER_COMBINE_MODES, FetchHttpAdapter, type FilterCombineMode, type FilterCombineModeApi, type FindRecursoByTagAdapterOverrides, HttpController, type HttpErrorMeta, type HttpInterceptors, type HttpResponseMeta, type IAnexoManagerViewModel, type IAnexoPort, type IContadorViewModel, type IFindRecursoByTagViewModel, type IInspecaoModalViewModel, type IJustificativaModalViewModel, type IMantenedorPickerViewModel, DEFAULT_KEY$2 as INSPECAO_MODAL_DEFAULT_KEY, IObservabilityPort, type IObservacoesTarefaViewModel, type IPickMantenedorTipoViewModel, type IRecorrenciaViewModel, type IRecursoDisplayerViewModel, type ITarefaItemViewModel, type ITarefaStatusViewModel, type IUnidadeMaterialViewModel, type InspecaoModalSliceState, type InspecaoValidationResult, type InspecaoValue, InteractionPayload, type Justificativa, type JustificativaAdapterOptions, type JustificativaUserRef, type JustificativaValidationResult, type LimiteDeControle, type MantenedorOption, type MantenedorPickerSliceState, type MantenedorPickerSlot, type NavigateFn, type NavigationConfig, type Notification, type NotificationState, NullCoreService, NullHttpController, NullObservabilityAdapter, NullToastService, type ObservacaoTarefaPayload, type OrdemDeCorrecao, type OrdemDeCorrecaoFormState, type PickMantenedorOption, type PickMantenedorTipoSliceState, type PickTipoDeOrdemOption, DEFAULT_KEY$1 as RECORRENCIA_DEFAULT_KEY, type RecorrenciaEscala, type RecorrenciaSliceState, type RecorrenciaValidationResult, type RecorrenciaValue, type RecursoDisplayerAdapterOverrides, type RecursoTagRef, type RegraDeCorrecao, type RegraDeCorrecaoFormState, type SolicitacaoDeServico, type StatusOrdemDeCorrecao, type StatusSolicitacao, type TarefaDeCorrecao, type TarefaItemMode, type TarefaStatus, type TarefaUnidadeMaterial, type TimeFormatApi, ToastService, TracingHttpAdapter, DEFAULT_KEY$3 as UNIDADE_MATERIAL_DEFAULT_KEY, type UnidadeMaterialRef, type UnidadeMaterialSliceState, type UnidadeMaterialValue, type UploadIntent, type UseAnexoManagerOptions as UseAnexoManagerViewModelOptions, type UseObservacoesTarefaOptions, type UseTarefaItemViewModelOptions, type UseTarefaStatusOptions, type ValidationResult, VitalsPayload, addContadorLimite, addDays, _default$1 as branchLevelReducer, buildTraceparent, capitalize, clearBranchLevelForm, clearContador, clearInspecaoModal, clearMantenedorSlot, clearPicker, clearRecorrencia, clearUnidadeMaterial, _default$3 as contadorReducer, daysBetween, formatDate, formatDateTime, generateSpanId, generateTraceId, hmsToSeconds, initWebVitals, _default$6 as inspecaoModalReducer, isBlank, isDateAfter, isDateBefore, _default$4 as mantenedorPickerReducer, _default$2 as pickMantenedorTipoReducer, pickTextColorBasedOnBgColorAdvanced, _default as pickerReducer, populateContador, populateInspecaoModal, populateRecorrencia, populateToEdit, populateUnidadeMaterial, _default$5 as recorrenciaReducer, removeAccents, removeContadorLimiteAt, removeInspecaoLimiteAt, resetPickMantenedorTipo, secondsToHms, selectContador, selectInspecaoModal, selectRecorrencia, selectUnidadeMaterial, setColor, setContadorParametro, setContadorUnidade, setContadorValor, setExcludeLevels, setHaveComponente, setInspecaoLimites, setInspecaoNomeParametro, setInspecaoParametro, setInspecaoTipo, setInspecaoUnidadeParametro, setLevel, setLevels, setMantenedorError, setMantenedorLoading, setMantenedorOptions, setMantenedorPendingConfirm, setMantenedorSearchTerm, setNome, setPickMantenedorTipoAssigning, setPickMantenedorTipoError, setPickMantenedorTipoLoading, setPickMantenedorTipoOptions, setPickerContext, setPickerItems, setPickerSelected, setPickerVisible, setRecorrenciaDataInicio, setRecorrenciaEscala, setRecorrenciaValor, setMaterial as setUnidadeMaterialMaterial, setQuantidade as setUnidadeMaterialQuantidade, setUnidade as setUnidadeMaterialUnidade, slugify, toISOString, truncate, _default$7 as unidadeMaterialReducer, updateContadorLimiteAt, useAnexoManager, useAnexoManagerViewModel, useAnexoUpload, useContadorViewModel, useCoreService, useFetchData, useFilterCombineMode, useFindRecursoByTagViewModel, useFormStorage, useHttpController, useInspecaoModalViewModel, useJustificativaModalViewModel, useMantenedorPickerViewModel, useMatchingObject, useNavigator, useNotifications, useObservability, useObservacoesTarefaViewModel, usePickMantenedorTipoViewModel, usePostData, useRecorrenciaViewModel, useRecursoDisplayerViewModel, useSmartSearch, useTarefaItemViewModel, useTarefaStatusViewModel, useTimeFormat, useToast, useUnidadeMaterialViewModel, useValidation };
|