Commit Graph

17 Commits

Author SHA1 Message Date
Knee Cola
5b0497891a feat: migrate PDF417 barcode decoder from @zxing/browser to zxing-wasm
Replace @zxing/browser with zxing-wasm for better performance and smaller WebAssembly bundle size (919KB). Added middleware exclusion for .wasm files to prevent i18n routing interference.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-19 18:01:44 +01:00
Knee Cola
b9f73e9a90 Restructure application to use /home for authenticated pages
- Move authenticated home page from /[locale] to /[locale]/home
- Move login page from /[locale]/login to /[locale] (new landing page)
- Move all restricted pages (bill, location, year-month, print, account) under /[locale]/home
- Simplify middleware to protect all routes under /home instead of using publicPages array
- Update auth config: change signIn page from /login to /
- Update SignInButton callback URL to redirect to /home after login
- Update all internal links throughout the application to reflect new structure
- Update server action redirects in navigationActions.ts
- Public share routes (/share/*) remain unchanged

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 21:49:01 +01:00
Knee Cola
6df9557921 Add utility bills proof of payment file upload functionality
Changes:
- Updated BillingLocation interface:
  - Added utilBillsProofOfPaymentAttachment field (BillAttachment type)
- Added server action uploadUtilBillsProofOfPayment:
  - Validates PDF file type
  - Serializes file attachment to base64
  - Stores attachment in BillingLocation document
  - Returns success/error status
- Updated ViewLocationCard component:
  - Added file upload input with PDF-only accept
  - Implemented handleFileChange with immediate upload
  - Added upload state management (isUploading, uploadError, attachment)
  - Shows spinner while uploading
  - Input disabled during upload
  - Conditionally renders file input or download link
  - Link displayed after successful upload
- Created route handler for serving proof of payment PDFs:
  - GET /share/proof-of-payment/[id]/route.tsx
  - Fetches attachment from database
  - Converts base64 to binary
  - Returns PDF with proper headers
- Added not-found page for proof of payment route
- Updated middleware to include proof-of-payment in public pages
- Added translations:
  - en: "Upload proof of payment (PDF only)"
  - hr: "Priložite potvrdu o uplati:"

File uploads immediately on selection without page reload.
Only PDF files accepted with client and server-side validation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 23:47:08 +01:00
e84188baf2 feat: add unauthenticated /share/attachment/[id] route for shared bill attachments
- Add /share/attachment/.* to public pages in middleware.ts
- Create new /share/attachment/[id] route handler for downloading attachments without authentication
- Add custom 404 page for missing shared attachments
- Update ViewBillCard component to use shared attachment route instead of authenticated route

This enables attachment downloads from shared bill pages without requiring user login.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-08 13:57:53 +02:00
4ab61f9917 implementiran share by link 2024-12-13 17:50:12 +01:00
b827c93171 middleware: added exception for webworker source file 2024-02-29 08:41:53 +01:00
50692ee6fe komentiranje koda 2024-02-16 17:12:08 +01:00
3240f746d1 refactor: moving locale definition 2024-02-16 17:02:33 +01:00
8992aa76bd implemented sign-in policy 2024-02-16 16:59:58 +01:00
65a7249faa fixed middleware exception path 2024-02-16 16:01:58 +01:00
64bd026d46 configured localization 2024-02-16 15:46:48 +01:00
199159c208 added custom login screen 2024-02-13 16:07:50 +01:00
459b93c1fa auth: enabled anonymous access to policy and terms page 2024-01-16 12:56:35 +01:00
cd9060c97e refactoring: simplifying file names 2024-01-08 15:24:26 +01:00
e29d813aee db authentication replaced by Google 2024-01-08 15:17:18 +01:00
8367606493 added config for google auth 2024-01-07 13:08:29 +01:00
52d4c35c2e implemented login 2024-01-06 10:50:27 +01:00