4982df4e60a35f2cf5262b2c6d30ba1c4acfcdfc
Parte FE del soccorso istruttorio v3, allineata al pattern UI della
piattaforma (SoccorsoAddInstructorManager / SoccorsoEditPreInstructor).
==SERVICE (rendicontazioneService.js)==
7 metodi nuovi, pattern fetch identico all'esistente:
- updateAmendment(practiceId, id, body) PUT /{pid}/amendment/{id}
- deleteAmendment(practiceId, id) DELETE
- sendAmendment(practiceId, id) POST /send
- extendAmendment(practiceId, id, days, motiv) POST /extend
- sendAmendmentReminder(practiceId, id) POST /reminder
- uploadAmendmentDocument(practiceId, id, file) POST multipart
- deleteAmendmentDocument(practiceId, id) DELETE upload-document
- uploadResponseDocument(practiceId, id, file) POST multipart
==ISTRUTTORIA (IstruttoriaPratica.js) — COMPLETO==
- AMENDMENT_STATUS esteso con DRAFT
- Import Editor (rich text) + FileUpload
- State amendDialog arricchito: mode create|edit, response_days, internal_note, instructor_file
- State extendDialog nuovo per dialog proroga
- Filter openAmendments include DRAFT (oltre AWAITING, RESPONSE_RECEIVED)
- Pulsante 'Soccorso istruttorio' usa openCreateAmendDialog; tooltip spiega lock
- Funzioni nuove: openCreateAmendDialog, openEditAmendDialog, resetAmendDialog,
doAmend(sendAfterSave), sendDraftAmendment, deleteDraftAmendment,
doExtendAmendment, sendReminder. closeAmendment preservato.
- doAmend gestisce anche upload allegato con callback-chain (create/update ->
uploadAmendmentDocument -> eventualmente sendAmendment).
- Sezione amendments arricchita:
* pulsanti contestuali per status:
DRAFT: Modifica / Invia / Elimina
AWAITING: Proroga / Reminder / Chiudi
RESPONSE_RECEIVED / EXPIRED: Chiudi
* render HTML richiesta (Editor ha prodotto HTML)
* mostra: scadenza, response_days, extended_days, creazione, pec_sent_at, protocol_id
* badge 'Allegato istruttore presente' se amendment_document_path
* nota interna in box giallo (visibile solo istruttore)
* risposta benef con eventuale badge 'Allegato risposta presente'
* errore PEC in box rosso se pec_failed_reason
- Dialog creazione/modifica (720px):
* Editor rich text per request_text (height 180px)
* Calendar scadenza con minDate=today
* InputNumber response_days (default 15, 1-120)
* InputTextarea internal_note con lucchetto
* FileUpload mode='basic' PDF max 10MB
* Due CTA: 'Salva bozza' (submit form) + 'Salva e invia al beneficiario'
- Dialog proroga (480px):
* Visualizza scadenza attuale
* InputNumber extended_days (1-60)
* InputTextarea motivation (registrata in internal_note lato BE)
==BENEFICIARIO (PraticaRendicontazioneEdit.js) — WIP parziale==
Patch applicate (sintatticamente OK, integrazione JSX non finita):
- Import Editor + FileUpload
- State amendDialog con response_file + responseFileRef
- Helper _stripHtmlBenef + validazione su plainText
RIMANE DA FARE (prossima sessione):
- Chain upload del response_document dentro submitAmendmentResponse
- Filtrare DRAFT dalla sezione amendments (benef non deve vederle)
- Render HTML dangerouslySetInnerHTML per request_text
- Mostrare badge 'Allegato istruttore presente' se amendment_document_path
- Nel dialog risposta: Editor al posto di InputTextarea + FileUpload response_document
==VALIDAZIONE==
Entrambi i file passati con @babel/parser plugins=jsx,classProperties,
optionalChaining,nullishCoalescingOperator — no sintassi errori.
==NEXT==
R3.bis: completare UI benef (5-10min), testare flusso E2E dalla UI sandbox
(crea DRAFT -> modifica -> invia -> [mark-pec-sent manuale] -> benef risponde con
upload -> istruttore chiude). Scrivere documento integrazione Cecilia Moretti
con spec endpoint /internal che BE Gepafin deve sviluppare (poller cron,
tenant routing multi-hub, PEC Massiva Gepafin + Mailgun SviluppUmbria,
protocol-service 65.108.55.96:8080, shared secret).
GEPAFIN-FE
Gepafin Front End
Commands
npm run start - start development server
npm run build:dev - make build based on 'dev' env variables
npm run build:prod - make build based on 'prod' env variables
HUB IDs
p4lk3bcx1RStqTaIVVbXs - gepafin
t7jh5wfg9QXylNaTZkPoE - sviluppumbria
Description
Languages
JavaScript
85.9%
SCSS
14.1%