Commit Graph

40 Commits

Author SHA1 Message Date
Knee Cola
eed92b5ac3 Replace seenByTenant boolean with seenByTenantAt timestamp field
Update location tracking to record when tenant views a location rather than just whether they've seen it. This provides better audit trail and enables future features like viewing history.

Changes:
- Convert seenByTenant (boolean) to seenByTenantAt (Date) in database schema
- Update setSeenByTenantAt action to store timestamp instead of boolean flag
- Modify LocationCard UI to display when location was seen by tenant
- Update all references across locationActions, monthActions, and view components
- Remove unused imports from ViewLocationCard

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 20:10:18 +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
fe924d0ee4 (style) LocationCard: fixing shared button position, compacting layout 2025-11-25 14:48:55 +01:00
Knee Cola
248d29ef22 style: replace fieldset with divider in LocationCard monthly statement
- Replace bordered fieldset with divider for cleaner visual separation
- Adjust spacing and margins for better alignment
- Remove card-based container in favor of simpler layout
- Maintain all functionality while improving visual consistency

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-24 21:10:54 +01:00
Knee Cola
eddddb4199 (refactor) LocationCard: replaced pay receit icon 2025-11-23 22:31:10 +01:00
Knee Cola
fcecaaa901 (refactor) dbTypes: added utilBillsProofOfPaymentUploadedAt to BillingLocation 2025-11-23 22:13:09 +01:00
Knee Cola
3368e56124 refactoring components to match the optimized projections 2025-11-23 12:00:12 +01:00
Knee Cola
8e5b1d7239 fix: Only show proof of payment link when attachment exists
Added conditional check to display proof of payment link only when
utilBillsProofOfPaymentAttachment is present in LocationCard.

Previously the link was always rendered, even when no attachment
was uploaded. This fix ensures the link only appears when there's
actually a proof of payment file available.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 10:52:52 +01:00
Knee Cola
a254ca5430 Improve LocationCard monthly statement section with proof of payment link
Changes:
- Added utilBillsProofOfPaymentAttachment to LocationCard component
- Updated monthly statement fieldset to show when proof of payment exists
- Added visual indicators with icons:
  - CheckCircleIcon next to payed total amount
  - EyeIcon for "seen by tenant" status (changed from CheckCircleIcon)
  - LinkIcon for proof of payment download link
- Added download link for proof of payment with success indicator
- Code formatting improvements and removed console.log
- Updated translations to lowercase:
  - English: "Seen by tenant" -> "seen by tenant"
  - Croatian: "Viđeno od strane podstanara" -> "viđeno od strane podstanara"
- Added Croatian translation:
  - "download-proof-of-payment-label": "potvrda-o-uplati.pdf"

The monthly statement section now displays proof of payment status
with a download link when available.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 00:10:58 +01:00
Knee Cola
e55468116e Adjust margin of monthly statement fieldset in LocationCard component 2025-11-22 23:16:41 +01:00
Knee Cola
c025c6f2ce Update formatCurrency to use currency code from UserSettings
Changes:
- Updated formatCurrency function:
  - Added currencyCode parameter with EUR default
  - Implemented Intl.NumberFormat for proper currency formatting
  - Added fallback for invalid currency codes
- Updated component hierarchy to pass currency:
  - HomePage: Fetch userSettings and pass to MonthLocationList
  - MonthLocationList: Accept and pass currency to child components
  - LocationCard: Accept currency prop and use in formatCurrency
  - MonthCard: Accept currency prop and use in formatCurrency
  - ViewLocationCard: Pass currency from userSettings to formatCurrency
- Removed hardcoded $ symbols, now using proper currency formatting

All currency amounts now display with the user's selected currency code
from their settings, using locale-appropriate formatting (hr-HR).

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 23:04:42 +01:00
Knee Cola
cbd13cbae3 Add seenByTenant tracking feature
- Add seenByTenant field to BillingLocation interface
- Implement setSeenByTenant function to mark locations as viewed by tenant
  - Checks if flag is already set to avoid unnecessary DB updates
  - Includes TypeDoc documentation
- Update LocationViewPage to call setSeenByTenant when non-owner visits
- Add seenByTenant to fetchAllLocations projection
- Update LocationCard to show "seen by tenant" status indicator
  - Displays in "Monthly statement" fieldset with checkmark icon
  - Shows alongside monthly expense total
- Add localization strings for monthly statement and seen status

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-18 23:51:23 +01:00
Knee Cola
3801638d0f Adjust margin for add bill button tooltip for better alignment 2025-11-17 19:44:42 +01:00
Knee Cola
aee6dc0932 Remove billedTo filtering to show all bills to landlord
The billedTo field indicates payment responsibility (tenant vs landlord),
not viewing permissions. Landlords should see and manage ALL bills.

Changes:
- LocationCard: Display all bills regardless of billedTo value
- LocationCard: Calculate monthlyExpense from all paid bills
- HomePage: Include all paid bills in monthlyExpense aggregation
- printActions: Print all bills with barcodes regardless of billedTo
- locationActions: Add billedTo property to fetchAllLocations result

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 19:32:54 +01:00
Knee Cola
1605eec5fb Replace billedToTenant boolean with billedTo enum
Migrated from boolean checkbox to enum-based radio buttons for better
flexibility and clarity in tracking bill payment responsibility.

Changes:
- Added BilledTo enum with values 'tenant' and 'landlord'
- Replaced Bill.billedToTenant (boolean) with Bill.billedTo (enum)
- Updated BillEditForm to use radio buttons instead of checkbox
- Updated billActions to handle billedTo enum values
- Updated all display filtering to use enum comparison
- Updated printActions barcode filtering
- Updated translations for radio button labels (en/hr)

The billedTo property is optional for backward compatibility -
undefined values default to BilledTo.Tenant, maintaining current
behavior where only tenant bills are displayed and calculated.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 13:48:28 +01:00
Knee Cola
f0ccac3f68 Filter bills display to show only billedToTenant bills
Updated all components to respect the billedToTenant flag:

- LocationCard: Filter bills display and monthlyExpense calculation
- ViewLocationCard: Filter bills display and monthlyExpense calculation
- HomePage: Update monthlyExpense calculations for month grouping
- printActions: Filter barcode print data to only include tenant bills

All filtering uses (bill.billedToTenant ?? true) for backward
compatibility with existing bills that don't have this property set.

This ensures users only see and calculate expenses for bills that
are the tenant's responsibility.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 13:36:42 +01:00
40e421a32a podešen styling ikone 2024-12-14 09:04:15 +01:00
74a9229ffa link ikona zamijenjena sa share ikonom 2024-12-14 09:01:09 +01:00
4ab61f9917 implementiran share by link 2024-12-13 17:50:12 +01:00
439de9d305 implementirano kopiranje linka 2024-12-13 15:38:48 +01:00
52c5672662 LocationCard: added visible tooltip 2024-02-17 11:12:12 +01:00
440ab6a815 Fixed LocationCard translation 2024-02-17 10:34:34 +01:00
fc6243f9b8 i18n: minor fixes 2024-02-17 10:14:46 +01:00
fcd94408fe BugFix: fixed translation formating 2024-02-17 09:41:35 +01:00
d30bd50e1a enabled i18n for all components 2024-02-16 21:56:41 +01:00
27b696faab home page converted back to server-side component 2024-02-09 09:40:43 +01:00
85e142ca7b bug fix: location expense counted unpaid bills 2024-01-17 16:37:07 +01:00
0eb11e7d02 form action redirects user to tjhe appropriate year 2024-01-17 15:47:55 +01:00
a078633bd5 fixed card width on cellphone 2024-01-16 14:11:50 +01:00
226beb974f header & footer 2024-01-16 10:24:21 +01:00
bb84d50de1 added right padding to card title 2024-01-16 09:03:32 +01:00
d627ad757d year & month replaced by yearMonth object 2024-01-09 16:20:49 +01:00
46b65711a8 yearMonth split into year + month 2024-01-09 15:43:01 +01:00
c76a69df5b added location total to UI 2024-01-09 10:51:05 +01:00
94fee6f775 adding new billing location completed 2024-01-05 15:13:15 +01:00
f26aae7d66 refactoring: renamed actions tp billActions 2024-01-05 14:30:44 +01:00
245cc38717 implemente bill add 2024-01-05 14:20:00 +01:00
76ddedf652 Bill Edit Form: dovršen fetch 2024-01-04 15:38:58 +01:00
f11987dd3a dovršen rendering homepage-a 2024-01-04 14:46:31 +01:00
b653ce40bc kreirane komponente 2024-01-04 10:30:43 +01:00