Commit Graph

1216 Commits

Author SHA1 Message Date
Dries Peeters a97520bbaf version Bump 2026-03-26 17:06:32 +01:00
Dries Peeters 905f6fbd37 feat(telemetry): migrate analytics pipeline from PostHog to OTLP
Switch product and installation telemetry to OTLP/Grafana across runtime config, CI injection, docs, and tests to unify telemetry transport and simplify privacy-focused opt-in behavior.
2026-03-26 17:01:55 +01:00
Dries Peeters 461721f0e1 fix(email-templates): prevent silent no-op on create submit
Sync editor content before submit validation and replace hidden required-field blocking with explicit inline checks. Preserve posted form values and enforce non-empty HTML on backend validation to avoid data loss and confusing no-op behavior.
2026-03-26 14:52:25 +01:00
Dries Peeters 4e2183caed fix(inventory): harden purchase-order creation and stock idempotency
Prevent 500s during first/parallel purchase-order creation by using collision-safe PO numbering, explicit validation, and reliable commit/error handling in web and API flows. Add regressions for purchase-order edge cases and invoice stock-reduction idempotency to catch adjacent inventory failures before release.
2026-03-26 14:52:06 +01:00
Dries Peeters 60d4d55027 feat(invoices): add fully configurable invoice number patterns
Implement issue #575 by introducing token-based invoice number patterns in settings and unifying number generation across invoice creation paths. This removes hardcoded INV/date formatting and aligns export filenames and bootstrap schemas with stored invoice numbers.
2026-03-26 14:51:55 +01:00
Dries Peeters 36fcbc65bf fix(invoices): widen quantity fields in edit form layout
Increase quantity column spans for Invoice Items and Extra Goods on the invoice edit page so values are easier to read, and keep static and JS-added rows aligned.
2026-03-26 14:51:22 +01:00
Dries Peeters 3d0ad839c4 Version Bump v5.0.0 2026-03-16 17:02:08 +01:00
Dries Peeters a50a4ebf2e docs: sync CHANGELOG and implementation status; add CODEBASE_AUDIT
- CHANGELOG: document offline queue replay, inventory scopes, client portal
  reports (date range + CSV), Jira webhook verification; activity feed date
  validation, PEPPOL exception handling, settings redirect, doc sync
- CLIENT_FEATURES_IMPLEMENTATION_STATUS: report date range and CSV export
  marked as implemented
- INCOMPLETE_IMPLEMENTATIONS_ANALYSIS: add Verified 2026-03-16 for webhooks,
  issues permissions, search API, offline queue, error handling
- Add CODEBASE_AUDIT.md with gap analysis and fixed/remaining items
2026-03-16 16:44:31 +01:00
Dries Peeters 3654a6a5d3 feat(offline): store method, headers, and body in queue for correct POST/PUT replay
- queueForOffline now saves url, method, headers, body (replay-safe for localStorage);
  legacy items with options only still replayed via fallback
- processOfflineQueue builds fetch options from stored method/body so replayed
  requests send the same payload when back online
- Make queueForOffline async and await it in handleFetchResponse/handleFetchException
- Add tests asserting queue stores method/body and replay uses them
2026-03-16 16:44:09 +01:00
Dries Peeters 0ade07e1e8 fix(settings): redirect /settings and /settings/preferences to user.settings
- /settings and /settings/preferences lacked templates (would 500);
  redirect to canonical user.settings with info flash for preferences
2026-03-16 16:43:52 +01:00
Dries Peeters 2808140e4c fix(invoices): handle and surface PEPPOL compliance check exceptions
- Catch AttributeError/KeyError/TypeError and generic Exception in PEPPOL block;
  log with exc_info and show generic warning to user so view still renders
- Avoid silent pass that hid configuration or data errors
- Add test for exception path (mock get_custom_field to raise)
2026-03-16 16:43:44 +01:00
Dries Peeters 346d7169da feat(client-portal): add report date range and CSV export
- Reports accept ?days=1-365 (default 30) for configurable date range
- ?format=csv returns CSV download (summary, hours by project, time by date)
  with same access control as reports page
- Subtitle shows 'Last N days' when date range is applied
- Add tests for days param and CSV export
2026-03-16 16:43:35 +01:00
Dries Peeters f05d772dbb feat(api): add read:inventory and write:inventory scopes for inventory-only access
- New scopes read:inventory and write:inventory; existing read/write:projects
  still grant same inventory access for backward compatibility
- require_api_token() accepts tuple of scopes (any one required); inventory
  endpoints accept (read:inventory | read:projects) and (write:inventory | write:projects)
- ApiTokenService: add new scopes to allowed list; document in API_TOKEN_SCOPES.md
- Add tests for inventory report endpoints with scope checks
2026-03-16 16:43:08 +01:00
Dries Peeters 8c2714bec3 fix(activity-feed): validate date params and return 400 for invalid API input
- /api/activity: return 400 with clear message when start_date/end_date
  are not valid ISO 8601; avoid silent pass on parse errors
- Web route /activity: catch ValueError, log and skip filter instead of 500
- Add tests for invalid date formats on API and web routes
2026-03-16 16:42:53 +01:00
Dries Peeters 7e059a0a52 feat(jira): add optional webhook signature verification (HMAC-SHA256)
- When webhook_secret is set in Jira integration, verify incoming webhooks
  via X-Hub-Signature-256, X-Atlassian-Webhook-Signature, or X-Hub-Signature
- Reject requests with missing or invalid signature; no secret = accept all (unchanged)
- Add webhook_secret password field to Connection Settings in Jira config
- Add tests for verification success, missing sig, and invalid sig
2026-03-16 16:42:32 +01:00
Dries Peeters b67428a98f chore: update CHANGELOG for unreleased documentation and i18n audit
- Document docs/i18n audit: removed stale claims, updated implementation status
- Mileage/Per diem export, break time, architecture refactor, fixes (Xero, time filter, mobile, dashboard cache, etc.)
2026-03-16 15:16:28 +01:00
Dries Peeters 084e0b3ef7 i18n: remove orphaned bulk-task translation strings across locales
- Remove 'Bulk due date/priority update feature coming soon!' from 10 locale .po files
- Align messages with current implementation
2026-03-16 15:16:21 +01:00
Dries Peeters c35a12ca4a test: add and update tests for client portal, shortcuts, Jira, inventory API
- Client portal, enhanced UI, keyboard shortcuts and shortcuts API
- Jira integration; API v1 inventory reports and transfers
- Silent exception handling fixes
2026-03-16 15:16:11 +01:00
Dries Peeters 7cad0c6fdd docs: align documentation with current implementation
- Remove stale 'coming soon' claims; mark incomplete implementations as historical where relevant
- Update GETTING_STARTED, REST_API, KEYBOARD_SHORTCUTS_SUMMARY, BULK_TASK_OPERATIONS
- Update client portal, inventory, and activity feed docs; API token scopes
2026-03-16 15:16:05 +01:00
Dries Peeters 624a43446d chore(ui): update static JS and base template
- enhanced-ui, error-handling, keyboard-shortcuts, pwa, smart-notifications, toast-notifications
- base.html layout and script includes
2026-03-16 15:15:56 +01:00
Dries Peeters db1b8823e4 chore(app): routes, utils, and bootstrap updates
- Update app bootstrap and route modules (admin, api, api_v1, audit_logs, clients, expenses, projects, settings, team_chat, timer)
- Add error_handling utility; update backup, client_lock, context_processors, data_import
2026-03-16 15:15:47 +01:00
Dries Peeters c0fe92b781 chore(integrations): update Jira and GitHub integration modules 2026-03-16 15:15:41 +01:00
Dries Peeters 0a1f551244 feat(settings): keyboard shortcut overrides and developer documentation
- Add keyboard_shortcuts_defaults utility for default bindings and overrides
- Update Settings keyboard shortcuts template for customization UI
- Add KEYBOARD_SHORTCUTS_DEVELOPER.md for implementation and extension
2026-03-16 15:15:34 +01:00
Dries Peeters 16edb71a33 feat(client-portal): activity feed, report service, dashboard widgets and preferences
- Add ClientActivityFeedService and ClientReportService; update approval and notification services
- Add inventory report service updates
- Client portal routes: dashboard preferences (widget order/visibility), activity feed, reports
- Templates: dashboard, activity_feed, reports, base; add widgets (invoices, pending_actions, projects, stats, time_entries)
2026-03-16 15:15:28 +01:00
Dries Peeters 404647eea3 feat(models): add ClientPortalDashboardPreference and update user/audit/link models
- Add ClientPortalDashboardPreference for per-client/widget dashboard layout and order
- Export new model in models __init__; minor updates to audit_log, link_template, user as needed
2026-03-16 15:15:21 +01:00
Dries Peeters 5629254618 feat(db): add migrations for keyboard shortcuts overrides and client portal dashboard preferences
- Migration 139: add users.keyboard_shortcuts_overrides (JSON) for per-user shortcut customization
- Migration 140: add client_portal_dashboard_preferences table for widget layout and order
2026-03-16 15:15:16 +01:00
Dries Peeters 4a5a5ceff9 chore: stop tracking gitignored files
Remove from index (keep on disk): .cursor/plans, logs/.gitkeep, logs/app.jsonl,
mobile lib files, tests/__pycache__/*.pyc. These are already in .gitignore;
stopping tracking so future changes are ignored.
2026-03-16 13:04:52 +01:00
Dries Peeters 76b3d48562 test(telemetry): consent gate, base first_seen/heartbeat, install_id
- test_installation_config: assert install_id UUID format and config persistence
- test_telemetry_consent_and_base: analytics not sent when opt-out, sent when opt-in
- test_telemetry_consent_and_base: base first_seen idempotent, heartbeat payload schema
- test_telemetry_consent_and_base: install_id stable across calls
2026-03-16 13:01:41 +01:00
Dries Peeters 2733284756 docs(telemetry): two-layer architecture, privacy, and PostHog dashboard guide
- Add telemetry-architecture.md: base vs detailed layers, schema, consent, retention
- ARCHITECTURE: link to telemetry doc and two-layer overview
- analytics.md: two-layer telemetry section and link to architecture
- privacy.md: update base/detailed analytics and retention wording
- all_tracked_events.md: document base_telemetry.first_seen/heartbeat, opt-in events
2026-03-16 13:01:32 +01:00
Dries Peeters 94ab81cae8 feat(telemetry): clarify two-layer telemetry in settings and admin dashboard
- settings: distinguish minimal install telemetry (always on) vs optional detailed analytics
- telemetry: update toggle label and data-collection copy for base vs opt-in layers
- List what is collected in each layer and what is never collected
2026-03-16 13:01:25 +01:00
Dries Peeters cd0ccd61c7 feat(telemetry): add daily base heartbeat and trigger opt-in ping on enable
- Register send_base_telemetry_heartbeat_with_app cron at 03:00 UTC
- setup: call check_and_send_telemetry when user opts in during setup
- admin: call check_and_send_telemetry when toggling detailed analytics on
2026-03-16 13:01:09 +01:00
Dries Peeters 287020d30c feat(telemetry): gate product analytics on opt-in and send base first_seen at startup
- Delegate track_event, identify_user, track_page_view to telemetry service
- Only send detailed analytics when user has opted in (is_detailed_analytics_enabled)
- Call send_base_first_seen() once at app startup (idempotent per install)
- posthog_funnels: require telemetry_enabled for funnel tracking
- posthog_monitoring: require telemetry_enabled for error/performance events
2026-03-16 13:00:56 +01:00
Dries Peeters 5be0054157 feat(telemetry): add install_id UUID and consent-aware telemetry service
- Add get_install_id() and base_first_seen tracking in InstallationConfig
- Introduce app/telemetry package with TelemetryService abstraction
- Define minimal base telemetry schema (BASE_SCHEMA_KEYS)
- Implement send_base_telemetry, send_base_first_seen, send_base_heartbeat
- Implement send_analytics_event and identify_user gated by opt-in
- Unify install identity: get_installation_id() now returns get_install_id()
2026-03-16 13:00:49 +01:00
Dries Peeters fc9bd4c43b Version Bump 4.23.1 2026-03-15 10:58:19 +01:00
Dries Peeters b4486a627f fix: CI tests, code quality, and duplicate DB indexes
- Webhook models: remove duplicate index definitions so db.create_all()
  no longer raises 'index already exists' (columns already have index=True)
- ImportService: fix circular import by late-importing ClientService,
  ProjectService, TimeTrackingService in __init__
- reports: fix F823 by renaming unpack variable _ to _entry_count to avoid
  shadowing gettext _ in export_task_excel()
- Code quality: add .flake8 with extend-ignore so flake8 CI passes;
  simplify pyproject.toml isort config (drop unsupported options)
- Format: run black and isort on app/
- tests: restore minimal app fixture in test_import_export_models
2026-03-15 10:51:52 +01:00
Dries Peeters 5e45bbd801 chore: update root config, Dockerfile, README, and GitHub workflows
- Update .gitignore, Dockerfile, INSTALLATION.md, README.md
- Update cd-development, cd-release, and migration-check workflows
2026-03-15 10:17:19 +01:00
Dries Peeters d2cac0b3fa chore: move invoice template and tests; remove obsolete root files
- Move pdf_styles_default.css to app/templates/invoices/
- Move test_logo_pdf.py and test_quick_wins.py to tests/
- Remove fix_expense_schema.sql, temp_migration.sql, packages.txt,
  install_log.txt, temp_translated.txt
2026-03-15 10:16:49 +01:00
Dries Peeters 64b5fbe45d chore: move scripts to scripts/
- Move Python and shell scripts (apply_migration, check_routes, run_tests, etc.) to scripts/
- Move setup-https-mkcert and start-https (bat/sh) to scripts/
- Update start-local-test.bat and start-local-test.sh
2026-03-15 10:16:22 +01:00
Dries Peeters 55ae923636 chore: move Docker config to docker/
- Move docker-compose.* (analytics, https, local-test, remote) to docker/
- Move logrotate.conf.example to docker/
2026-03-15 10:16:09 +01:00
Dries Peeters 5fb49ad375 chore: move documentation and assets to docs/
- Move API, ARCHITECTURE, BUILD, DEVELOPMENT, and fix docs to docs/
- Move README variants and WINDOWS_BUILD to docs/
- Move assets and screenshots to docs/assets/
- Update GETTING_STARTED, README, CONTRIBUTOR_GUIDE, PROJECT_STRUCTURE,
  LOCAL_TESTING_WITH_SQLITE, VERSION_MANAGEMENT
2026-03-15 10:15:51 +01:00
Dries Peeters 5eea34a97d Version Bump 4.23.0 2026-03-15 09:39:28 +01:00
Dries Peeters 548de62dde test: extend fixtures and add scope, auth, recurring, reports tests
- Extend conftest and factories for API and scope tests
- Add test_auth, test_reports_scope, test_timer_scope
- Add test_recurring_invoice_service, test_scope_filter
- Add test_admin_dashboard_charts, test_api_contract, test_reports_task_report
- Update test_invoices, test_project_archiving_models, test_project_costs, test_time_entry_repository, test_utils
2026-03-15 09:37:15 +01:00
Dries Peeters 8bb42ddd02 feat(app): recurring invoices, gantt/reporting services, license UI
- Add RecurringInvoiceRepository and RecurringInvoiceService; refactor recurring_invoice model
- Add GanttService and move gantt logic from route to service
- Expand ReportingService and simplify reports route
- Add license_utils and user license template/settings
- Refactor routes to use scope_filter, api_responses, and services (API v1, timer, admin, invoices, etc.)
- Extend invoice_service for recurring; cache and scope_filter utils; base/template updates
2026-03-15 09:37:00 +01:00
Dries Peeters 9547937be2 docs: update README and guides, add audit and strategy docs
- Simplify README version section and point to CHANGELOG
- Update UI overview with Reports and installation reference
- Refresh CONTRIBUTING, DEVELOPMENT, API.md links/consistency
- Add ARCHITECTURE_AUDIT, DOCS_AUDIT, PRODUCT_UX_AUDIT, FRONTEND, PERFORMANCE
- Add API_CONSISTENCY_AUDIT, RESPONSE_FORMAT, CONTRIBUTOR_GUIDE, TESTING_STRATEGY
- Update GETTING_STARTED, REST_API, PROJECT_STRUCTURE, DEPLOYMENT_GUIDE
2026-03-15 09:36:37 +01:00
Dries Peeters e85b9ca596 Update setup.py 2026-03-12 21:39:24 +01:00
Dries Peeters 493ac2f17e docs: document manual entry worked time recalculation fix (#559)
- Add implementation note for deferred recalculation and input listeners
- Reference fix from Break Time feature doc (manual entry / worked time)
2026-03-12 21:38:27 +01:00
Dries Peeters e435e6ad31 docs(inventory): document return/waste devaluation usage (#385)
- In section 5.3 Stock Devaluation: note form message when item does not
  support devaluation.
- Add 'How to use (UI)' steps for return and waste with devaluation.
- Add API note for POST /api/v1/inventory/movements devaluation parameters.
- Enables closing GitHub issue #385 with a doc reference.
2026-03-12 21:38:24 +01:00
Dries Peeters 3b020e6c05 fix(timer): recalculate worked time after date/time commit (fixes #559)
Defer manual entry worked-time recalculation to the next microtask so
the DOM has the latest start/end date and time before reading. Add
input listeners so recalculation runs on every date/time change.

Fixes incorrect duration when end date is in the past (e.g. yesterday)
until the user reselected the end date.
2026-03-12 21:38:21 +01:00
Dries Peeters 39dd165efb feat(inventory): show devaluation requirements by stock item (#385)
- Add data-devaluation-supported on stock item options (trackable + default cost).
- When return/waste is selected and item cannot be devalued, disable 'Apply
  devaluation', show message: 'Devaluation requires a trackable item with a
  default cost.'
- Same message for standalone devaluation type when item is unsupported.
- Add en translation string for the new message.
2026-03-12 21:38:18 +01:00
Dries Peeters 9c0ac0f4ea Fix Xero integration for apps created after March 2026 (#567)
OAuth: Replace deprecated accounting.transactions scope with accounting.invoices and accounting.payments so new Xero Developer apps (on or after 2026-03-02) complete the authorization flow.

Expense sync: Use /api.xro/2.0/ExpenseClaims instead of non-existent /api.xro/2.0/Expenses; read ExpenseClaimID from response.

API: Add optional json_body to _api_request and send invoice/expense payloads (Invoices and ExpenseClaims wrappers) to Xero.

Docs: Add docs/integrations/XERO.md (setup, scopes, sync, troubleshooting) and CHANGELOG entry.
2026-03-12 21:33:11 +01:00