Files
temetro/backend/drizzle/meta/_journal.json
T
Khalid Abdi b1abb29108 feat: patient & lab file attachments (real backend storage)
Add a real file-storage layer to the backend and wire upload UI into the
frontend.

backend:
- new `attachments` table (org-scoped, links to a patient file number and
  optionally a lab result) + Drizzle migration
- `/api/attachments` route: upload (multer → disk under UPLOAD_DIR),
  list, stream/download, delete; gated by patient:write OR lab:write via
  a new requireAnyPermission helper so lab staff can attach analyses
- UPLOAD_DIR env (default ./uploads) + a persistent docker volume

frontend:
- lib/attachments.ts client (multipart upload, list, delete, preview URL)
- staged file picker in the patient Add/Edit dialog (uploaded after save)
  and the lab Add-result dialog (linked to the result)
- a Files section in the patient sheet that lists attachments and opens
  them in a preview dialog (images inline, others via download)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 20:04:03 +03:00

160 lines
3.2 KiB
JSON

{
"version": "7",
"dialect": "postgresql",
"entries": [
{
"idx": 0,
"version": "7",
"when": 1780413912874,
"tag": "0000_small_sir_ram",
"breakpoints": true
},
{
"idx": 1,
"version": "7",
"when": 1780591375930,
"tag": "0001_boring_puck",
"breakpoints": true
},
{
"idx": 2,
"version": "7",
"when": 1780849813505,
"tag": "0002_fluffy_longshot",
"breakpoints": true
},
{
"idx": 3,
"version": "7",
"when": 1780850147682,
"tag": "0003_lame_rawhide_kid",
"breakpoints": true
},
{
"idx": 4,
"version": "7",
"when": 1780850364853,
"tag": "0004_dizzy_scarlet_spider",
"breakpoints": true
},
{
"idx": 5,
"version": "7",
"when": 1780850717058,
"tag": "0005_true_gwen_stacy",
"breakpoints": true
},
{
"idx": 6,
"version": "7",
"when": 1780856647280,
"tag": "0006_square_wither",
"breakpoints": true
},
{
"idx": 7,
"version": "7",
"when": 1780933857005,
"tag": "0007_skinny_bloodstrike",
"breakpoints": true
},
{
"idx": 8,
"version": "7",
"when": 1780937195597,
"tag": "0008_luxuriant_blue_blade",
"breakpoints": true
},
{
"idx": 9,
"version": "7",
"when": 1781022080228,
"tag": "0009_melted_puck",
"breakpoints": true
},
{
"idx": 10,
"version": "7",
"when": 1781111039837,
"tag": "0010_eager_hellfire_club",
"breakpoints": true
},
{
"idx": 11,
"version": "7",
"when": 1781196252617,
"tag": "0011_remap_viewer_to_member",
"breakpoints": true
},
{
"idx": 12,
"version": "7",
"when": 1781279151289,
"tag": "0012_wonderful_terrax",
"breakpoints": true
},
{
"idx": 13,
"version": "7",
"when": 1781364502603,
"tag": "0013_strange_medusa",
"breakpoints": true
},
{
"idx": 14,
"version": "7",
"when": 1781454115877,
"tag": "0014_youthful_aqueduct",
"breakpoints": true
},
{
"idx": 15,
"version": "7",
"when": 1781455848772,
"tag": "0015_polite_captain_marvel",
"breakpoints": true
},
{
"idx": 16,
"version": "7",
"when": 1781464772532,
"tag": "0016_past_maestro",
"breakpoints": true
},
{
"idx": 17,
"version": "7",
"when": 1781537419038,
"tag": "0017_wealthy_northstar",
"breakpoints": true
},
{
"idx": 18,
"version": "7",
"when": 1781537902724,
"tag": "0018_clean_doctor_strange",
"breakpoints": true
},
{
"idx": 19,
"version": "7",
"when": 1781538797034,
"tag": "0019_black_mole_man",
"breakpoints": true
},
{
"idx": 20,
"version": "7",
"when": 1781629630102,
"tag": "0020_freezing_tomas",
"breakpoints": true
},
{
"idx": 21,
"version": "7",
"when": 1781801972208,
"tag": "0021_milky_blur",
"breakpoints": true
}
]
}