Commit Graph

834 Commits

Author SHA1 Message Date
Knee Cola
b9dac78bea Merge branch 'hotfix/1.63.2' into develop 2025-11-17 14:33:30 +01:00
Knee Cola
cf7b914aed (fix) Dockerfile: CMD was not compatible with distroless image 2025-11-17 14:33:10 +01:00
Knee Cola
e2cfacda87 Merge branch 'release/1.63.0' 2025-11-17 14:11:05 +01:00
Knee Cola
38974c47fb Merge branch 'feature/going-distroless' into develop 2025-11-17 14:06:54 +01:00
Knee Cola
dedc030384 Replace Alpine with distroless image for production stage
Switch from node:24-alpine to gcr.io/distroless/nodejs20-debian12:nonroot
for enhanced security and reduced attack surface. Distroless images contain
only runtime dependencies without shell, package managers, or other utilities.

Changes:
- Use distroless nodejs20-debian12:nonroot base image
- Remove manual user creation (use built-in nonroot user)
- Remove RUN commands for directory creation (incompatible with distroless)
- Update file ownership to nonroot:nonroot

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 14:06:31 +01:00
Knee Cola
4fed3967cc Merge branch 'release/1.62.0' 2025-11-17 13:52:54 +01:00
Knee Cola
c005f4ca78 Merge branch 'feature/payed-by-tenant' into develop 2025-11-17 13:51:35 +01:00
Knee Cola
2b55ba78d7 Improve billedTo radio buttons layout to single row
Changed the layout to display the label and radio buttons in a single
horizontal row for better visual alignment and more compact design.

Before: Label on separate line above radio buttons
After: Label and radio buttons aligned horizontally

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 13:50:58 +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
Knee Cola
13812c78ae chore: update Claude Code and MCP auto-approve settings
Added auto-approval for common safe operations:
- Git add and commit commands
- Serena MCP replace_regex tool

This improves workflow efficiency during development.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 13:31:56 +01:00
Knee Cola
c3b555189b Complete billedToTenant server action implementation
Implemented full server-side persistence for the billedToTenant property:

- Extract billedToTenant from formData in updateOrAddBill action
- Add to MongoDB $set operations for updating existing bills
- Include in new bill creation with value from form
- Set default value (true) for bills added to subsequent months
- Handle undefined values from existing database records using destructuring defaults

This completes the feature - bills can now track whether they should be
paid by the tenant, with backward compatibility for existing data.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 13:30:47 +01:00
Knee Cola
0ae5140487 Add billedToTenant property to Bill interface with UI support
Added new boolean property to track whether a bill should be paid by the tenant.

Changes:
- Added billedToTenant property to Bill interface in db-types.ts
- Added checkbox UI control in BillEditForm for billedToTenant
- Added state management and change handler for the checkbox
- Added i18n translations (EN: "Billed to tenant", HR: "Plaća podstanar")
- Set default value to true for new bills

Note: Server action implementation pending - property not yet persisted to database.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 13:18:15 +01:00
Knee Cola
c3ca55eedf mcp Serena: auto approving commands 2025-11-17 13:12:52 +01:00
Knee Cola
2ac9ca92a4 mcp: migrated serena to run inside a docker 2025-11-17 11:50:54 +01:00
Knee Cola
ed304e7ba9 Merge branch 'feature/npm-audit' into develop 2025-11-16 13:21:19 +01:00
Knee Cola
349117ec48 chore: add Claude Code local MCP server settings
Configure enabled MCP servers: serena, context7, git

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-16 13:21:11 +01:00
Knee Cola
cc147e8726 fix: resolve 14 npm security vulnerabilities via npm audit fix
Updated dependencies to patch the following security issues:
- @babel/helpers & @babel/runtime: RegExp complexity vulnerability
- brace-expansion: ReDoS vulnerabilities
- braces: Uncontrolled resource consumption
- cookie: Out of bounds character handling
- cross-spawn: ReDoS vulnerability
- js-yaml: Prototype pollution in merge
- micromatch: ReDoS vulnerability
- nanoid: Predictable results with non-integer values
- next: Multiple critical vulnerabilities (SSRF, cache poisoning, DoS, auth bypass)
- pdfjs-dist: Arbitrary JavaScript execution vulnerability
- tar: DoS vulnerability due to lack of folder count validation

Severity: 1 critical, 3 high, 7 moderate, 3 low

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-16 13:19:52 +01:00
fec08f0201 Merge branch 'release/1.61.1' 2025-10-15 16:59:02 +02:00
26eff4bd48 Merge branch 'feature/making-print-easier-to-scan' into develop 2025-10-15 16:58:43 +02:00
9f09d3257b fixed print media selector 2025-10-15 16:58:24 +02:00
f6edea79e7 manually fixed print layout to 4 qr codes per A4 2025-10-15 16:58:03 +02:00
0a07ce01bf Merge branch 'release/1.61.0' 2025-10-15 13:47:46 +02:00
0071293ea6 Merge branch 'feature/fixing-print' into develop 2025-10-15 13:46:19 +02:00
cd3b2ef16d fix: expand cell padding in print layout to fit 6 bills per A4 page
Increase padding and spacing to fit exactly 6 bills per page (down from 8).
- Increase table cell padding (th: 8px 12px, td: 16px 12px)
- Set barcode image max-height to 85px
- Increase text spacing to 0.5rem in print mode

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-15 13:45:55 +02:00
05b8d38a17 chore: remove obsolete .mcp copy.json configuration file 2025-10-15 13:36:50 +02:00
b5028ada52 fix: update QR code print layout to show payedAmount instead of yearMonth
Remove billYear and billMonth from second column, add payedAmount as last value.
- Update PrintBarcodeData interface to replace yearMonth with payedAmount
- Modify fetchBarcodeDataForPrint to include bill.payedAmount
- Update PrintPreview display to show payedAmount (formatted from cents)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-15 13:36:41 +02:00
a5d6d7c9e6 Merge branch 'hotfix/1.60.1' 2025-09-14 22:59:46 +02:00
3e6c7a6c21 Merge branch 'hotfix/1.60.1' into develop 2025-09-14 22:59:46 +02:00
94a1bcaf36 fix: adjust padding for print content in PrintPreview component 2025-09-14 22:59:39 +02:00
a5da2cf74e Merge branch 'release/1.60.0' 2025-09-14 22:48:59 +02:00
3c424db3a2 Merge branch 'feature/sprint-01-barcode-print' into develop 2025-09-14 22:46:21 +02:00
fdfa23e67d fix: resolve MongoDB ObjectId serialization error in client components
Fix React serialization warning when passing ObjectIds to client components:

**Problem:**
- MongoDB ObjectIds have toJSON() methods which React rejects in client components
- Error: "Only plain objects can be passed to Client Components from Server Components. Objects with toJSON methods are not supported"
- Occurred when rendering main page with year parameter (?year=2023)

**Solution:**
- Add $addFields stage in fetchAllLocations aggregation pipeline
- Convert location _id and bill _id fields to strings using $toString
- Simplify $project stage to use single "bills": 1 instead of individual field projections
- Ensures only plain objects (strings) are passed to client components

**Technical Details:**
- Modified app/lib/actions/locationActions.ts:268-287
- Added $addFields stage before existing $project stage
- Converted ObjectIds to strings while preserving all other data structures
- Build passes without serialization warnings

ObjectId serialization now handled properly across all client component boundaries.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-14 22:45:14 +02:00
694ec8508b feat: add multilingual support for print preview empty state
Add i18n support for empty state when no barcode data is found:

**English translations:**
- "No Barcode Data Found" 
- "No bills with 2D barcodes found for {yearMonth}"

**Croatian translations:**
- "Nema Podataka o Barkodovima"
- "Nema računa s 2D barkodovima za {yearMonth}"

**Implementation:**
- Add translation keys to messages/en.json and messages/hr.json
- Update server component to fetch empty state translations
- Use proper next-intl parameter passing for yearMonth variable
- Replace hardcoded English text with localized translations

Empty state now displays correct language based on URL locale:
- /en/print/2025/01 → English empty state message
- /hr/print/2025/01 → Croatian empty state message

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-14 22:31:03 +02:00
834444d5c7 fix: resolve next-intl translation parameter error in print footer
Fix IntlError: FORMATTING_ERROR for print footer translation:

- Pass date parameter correctly to t("print-footer") in server component
- Remove manual string replacement in client component 
- Use proper next-intl parameter syntax: t("key", { param: value })

Error was caused by next-intl expecting translation parameters 
to be passed at the translation function call level, not through 
manual string replacement afterward.

Print preview now loads without FORMATTING_ERROR and displays 
localized footer text correctly in both English and Croatian.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-14 22:16:00 +02:00
397b4845d6 docs: add improved sprint framework based on Sprint 01 lessons learned
Create enhanced versions of sprint framework files incorporating key improvements:

**Sprint Playbook Template (Improved):**
- Add comprehensive status tracking with current focus and complexity estimation
- Enhance quality gates for code, testing, and documentation
- Include proactive risk mitigation strategies with fallback approaches
- Add lessons learned and retrospective sections for continuous improvement
- Define clear communication protocols and success metrics

**How-to-Use Guide (Improved):**
- Implement advanced clarity checking to identify ambiguities before starting
- Add comprehensive project analysis including testing infrastructure assessment
- Enhance story breakdown with Given/When/Then format and dependency tracking
- Include proactive risk management with mitigation strategies
- Define quality gates for automated and manual verification
- Add iterative improvement process for framework refinement

**Implementation Guidelines (Improved):**
- Add structured testing checkpoint protocol with user feedback formats
- Implement iterative refinement process for handling user feedback
- Enhance communication with proactive updates and blocker notifications
- Add advanced error handling with classification and recovery protocols
- Include knowledge transfer and technical decision documentation
- Add continuous quality monitoring with automated checks

These improvements generalize lessons from Sprint 01 successful execution:
- Better user collaboration through structured testing checkpoints
- Enhanced risk management with proactive identification and mitigation
- Comprehensive quality assurance across multiple levels
- Systematic knowledge capture and process optimization
- Clear scope management and change control procedures

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-14 22:03:23 +02:00
29e0fe5334 refactor: remove unnecessary print container padding for improved layout 2025-09-14 21:56:56 +02:00
615dd4e20c Merge branch 'feature/adding-ai-framework' into sprint-01-merge 2025-09-14 21:48:42 +02:00
5743807d48 docs: complete Sprint 01 - mark all user stories and DoD items as done
- Update Sprint status from 'not started' to 'completed'
- Mark all 4 user stories (US-1 through US-4) as  done
- Complete AI-responsible Definition of Done checklist
- Update barcode specification to reflect final 69.6mm implementation
- Document successful completion of barcode print functionality

Sprint 01 Successfully Completed! 🎉

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-14 21:45:03 +02:00
9a02124e18 feat: implement US-4 - complete print optimization with CSS media queries
- Add comprehensive CSS print media queries for A4 paper optimization
- Implement 69.6mm barcode width specification (20% larger than original 58mm)
- Apply B&W print color optimization forcing all elements to black/white
- Add page break handling to prevent table rows from splitting across pages
- Fix table cropping issue by removing excessive width and reducing container padding
- Optimize print layout with zero padding for maximum table space utilization
- Ensure header/button elements hidden from print output with proper CSS

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-14 21:44:04 +02:00
b205a61cf9 feat: implement US-3 - enhance print layout with professional table design
- Add comprehensive i18n support for all print preview content
- Fix next-intl context error by moving translations to server component
- Implement professional 3-column table layout with proper styling
- Add multilingual table headers (EN: #, Bill Information, 2D Barcode | HR: #, Informacije o Računu, 2D Barkod)
- Center-align index column header and optimize barcode sizing
- Hide print button and header from actual print output
- Fix hydration errors with proper date handling
- Enhanced barcode display with proper padding and sizing

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-14 21:16:33 +02:00
493c2f62fa feat: implement US-2 - create print route with barcode data fetching
- Add Next.js print route at /[locale]/print/[year]/[month]
- Implement fetchBarcodeDataForPrint function with user authentication
- Create PrintPreview component with basic table layout
- Add proper 404 handling with not-found.tsx
- Fix barcode image display with flexible data URL handling
- Filter and sort bills with barcode data for consistent display

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-14 19:57:13 +02:00
ecea10e805 feat: implement US-1 - add print button to MonthCard with i18n support
- Add PrintButton component with card styling matching AddLocationButton
- Integrate print button next to "Add a new realestate" with centered layout
- Add English/Croatian translations for print tooltips and labels
- Implement click handler to open print preview in new tab
- Create Sprint Playbook for barcode print functionality

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-14 09:08:40 +02:00
d8c3ad7228 plan: add support for printing 2D barcode images with UI enhancements 2025-09-14 08:29:41 +02:00
941ad70567 feat: add Sprint Playbook Template and Implementation Guidelines for AI agents 2025-09-14 08:01:43 +02:00
76435d3441 Merge branch 'release/1.59.0' 2025-09-08 14:02:06 +02:00
addeb312b8 Merge branch 'release/1.59.0' into develop 2025-09-08 14:02:06 +02:00
f86d2e2404 chore: update package version to 1.59.0 in package.json and package-lock.json 2025-09-08 14:00:44 +02:00
ecc33f988d 1.58.0 2025-09-08 13:59:35 +02:00
71444a779a Merge branch 'feature/allowing-download-for-shared' into develop 2025-09-08 13:58:35 +02:00