Conversation
Add full FinaBill integration stack including adapter, registry, frontend card, and webhook routes Update dev server port from 3000 to 3200 across vite config, env example, and backend env handling Implement API key authentication system with middleware, hashing utilities, and DB schema Add outgoing webhook dispatch framework and event triggers for core business events Exclude /api/webhooks endpoints from CSRF protection Add EXPENSE_CATEGORIES_MANAGE permission role Fix logout flow to use async TRPC mutation and correct cross-environment cookie handling Update partner client listing to include both partnered and referred businesses Add mobile-responsive styling for partner allocations tab and account picker Add QuickSupplierDialog component for fast supplier creation Update database schema, add migrations, and add comprehensive tests for new systems
…ed machine auth - Add production-safe 0025 migration for integration connections, channel mappings, API key expiry, and daily sales source batch tracking - Remove conflicting legacy migrations to prevent deployment failures - Update _journal.json to reflect current migration state - Exempt /api/integration/ machine-to-machine routes from CSRF protection - Implement scoped API key middleware with permission checks for protected endpoints - Require valid locationId and sourceBatchId for daily sales ingestion - Fix ledger reversal logic to filter by transaction type, avoiding cross-module soft delete collisions - Enforce tenant isolation for API key users creating journal entries - Update webhook handlers to require externalId for safe master data updates - Harden Finabill integration upsertUser with role allowlists and location validation - Update CHANGELOG with release notes for these changes - Update all related tests and test configurations
…ling Add production-safe database performance and integrity improvements: - Add 40+ partial/composite concurrent indexes on high-volume financial tables to boost query speed - Add 25+ NO ACTION foreign keys using NOT VALID + VALIDATE to avoid long table locks during migrations - Create migration safety check script to validate orphan rows and missing indexes before deployment - Write comprehensive database migration runbook documentation - Update db/schema.ts to match new indexes and foreign key constraints - Clean up redundant comment in AllocationManagement.tsx - Update CHANGELOG and migration journal files
- update ExpenseCategorySelector to support add-new options with custom labels and callbacks - refactor QuickCategoryDialog and QuickSupplierDialog to support controlled open state and custom triggers - update Expenses and Bills pages to use updated selectors, replace separate trigger buttons with inline add flows, and manage dialog state at page level - remove unused Lucide Plus icon imports from dialog components
- Set staleTime: 0 on the useAuth hook to keep authenticated user data fresh continuously - Add invalidation of the localAuth.me query after updating user location assignments in the Users page - In the Accounts page: add a refetch handler for location-specific payment methods, and fix the assignment mutation to properly invalidate and refetch the correct payment methods - Add test cases to validate all freshness and invalidation behaviors
Add new `listBusinessConnectionStates` API endpoint and service function to fetch integration connection statuses across a user's active businesses. Add validation to prevent duplicate connections for the same business and target system when creating a new integration session. Update the Finabill integration card to display per-business connection status, enable direct business switching, and refine the pairing workflow UI to show pairing codes and direct approval links. Show all connected businesses' integration statuses for multi-business users directly in the card.
add three new helper scripts for finabill integration management: - update finabill connection URLs from localhost:3100 to 3101 - fetch business details by ID across configured databases - list all existing finabill integration connections
- Add database migration to add `businessId` and `locationId` columns to `mobile_wallet_reconciliation` table, backfill existing records with a sentinel business ID, and create a unique index on (businessId, provider, txnDate) - Update drizzle ORM schema to match the new table structure - Update test database setup to include the new migration files - Fix business reset script to only delete reconciliation records for the target business instead of all records - Update Mpesa migration script to include default business ID for historical records and adjust conflict resolution target to include business ID - Add comprehensive scope isolation tests for wallet and reconciliation endpoints - Enforce business and location authorization checks on all wallet router procedures to prevent cross-tenant data access
Implemented full partner lead management and referral attribution workflow: - Added database migration 0029_partner_leads, updated DB schema, and backend logic for lead tracking and commission eligibility - Added leads API router, normalization/attribution helpers, and frontend dashboard components - Added referral attribution during signup and account settings with validation rules - Corrected allocation visibility permissions: business owners retain allocation management access in the Businesses page while partner/admin users get restricted partner allocation claim flows - Added comprehensive test coverage for all new lead, referral, and authorization workflows - Updated email templates for lead invitation communications
Introduce reusable dashboard feature sub-component library with barrel exports: CashPositionCard, CashflowTrendCard, MobileWalletSummaryCard, TrendKpiCard, BillsPipelineCard, and TodayStrip. Refactor src/pages/Dashboard.tsx: reorder layout top-down, replace the in-page KpiCard helper with trend-enabled TrendKpiCard, remove the duplicate Unpaid Sales KPI, and gate components behind appropriate permissions. Extend backend dashboard router: add cashflowTrend query, previousPeriodTotals for trend calculations, and aggregated cashPosition breakdown by account type. Add comprehensive unit and regression tests for all new dashboard logic, fix the previously orphaned mobile wallet summary display, and update CHANGELOG.md with full release notes for this overhaul.
- Update package.json version from 1.0.6 to 1.1.0 - Update APP_VERSION constant in src/lib/version.ts to 1.1.0 - Add version 1.1.0 release notes to CHANGELOG.md with deployment date - Prepare application for deployment with coordinated version updates
- Replace KES/USD with XXX/YYY to test error handling without relying on specific currency pair availability - Improve test isolation by using placeholder codes that guarantee missing exchange rates fix(business-reset): handle empty location IDs array in account filtering - Add conditional check before using inArray() to prevent invalid query generation when locationIds is empty - Fall back to businessId equality check when no locations are present - Prevents potential runtime errors in account reset queries with filtered location scopes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Release v1.1.0 - Major Feature Updates & Production Hardening
🎯 Overview
This PR merges 10 major commits from
devtomain, bringing FinaFlow to version 1.1.0. This release includes significant new features, production-ready database optimizations, integration capabilities, and comprehensive testing coverage.Statistics:
🚀 Major Features
1. FinaBill Integration System
Commit:
9a86293- feat(integrations): add FinaBill integration and toolingNew Capabilities:
Technical Changes:
/api/integration-finabill/*and/api/webhooks/*apiKeys,integrationConnections,channelMappings,webhookDeliveriesFinabillIntegrationCard.tsxapi/lib/webhook-dispatcher.ts,api/lib/webhook-handlers.tsEXPENSE_CATEGORIES_MANAGEpermission roleFiles Added/Modified:
Testing:
api/__tests__/integration-finabill.test.ts(367 lines)api/__tests__/webhook-dispatcher.test.ts(235 lines)api/__tests__/webhook-triggers.test.ts(117 lines)2. Integration Security & Production Hardening
Commit:
13ea530- feat(integrations,auth,db): harden integration workflows and add scoped machine authSecurity Enhancements:
/api/integration/*routes from CSRF for machine-to-machine authlocationIdandsourceBatchIdfor daily sales ingestionexternalIdfor safe master data updatesupsertUserBug Fixes:
Database Changes:
0025_integration_connections_and_channel_maps.sqlFiles Modified:
3. Database Performance & Integrity
Commit:
b9c73eb- feat(db): add production-safe database indexes, foreign keys, and toolingPerformance Improvements:
Data Integrity:
NOT VALID + VALIDATEpatternNew Tooling:
Key Features:
Files Modified:
4. Enhanced UX: Inline Form Enhancements
Commit:
7e47204- feat: add inline add-new category and supplier options to formsUser Experience Improvements:
Components Updated:
Technical Changes:
5. Data Freshness & Cache Management
Commit:
fb3536f- fix(auth, payments, users): keep user and payment data fresh, add testsCache Fixes:
staleTime: 0onuseAuthhook for continuous fresh user datalocalAuth.mequery after location assignment updatesTesting:
Files Modified:
6. Business Connection Management
Commit:
5e783fc- feat(integrations): add business connection tracking and UINew Features:
ltc1q0gq5ghan358l8y6unf2yz7s42efgnqcut0pvu6API endpointUI Enhancements:
Files Modified:
7. FinaBill Database Utilities
Commit:
628a784- feat(scripts): add finabill database utility scriptsNew Scripts:
Use Cases:
8. Business Scope for Wallet Reconciliation
Commit:
a9f8b44- feat(wallet): add business scope to reconciliation recordsMulti-Tenancy Improvements:
businessIdandlocationIdtomobile_wallet_reconciliationtable(businessId, provider, txnDate)Testing:
Files Modified:
9. Partner Leads & Referral System
Commit:
db92ec2- feat(partner): add partner leads, referrals, and allocation fixesNew Lead Management:
0029_partner_leadswith new schemaAuthorization Fixes:
Email Templates:
Files Added/Modified:
10. Dashboard Coherence Refactor
Commit:
5a4c0d2- feat(dashboard): add dashboard coherence refactorNew Dashboard Architecture:
CashPositionCard,CashflowTrendCard,MobileWalletSummaryCard,TrendKpiCard,BillsPipelineCard,TodayStripDashboard Improvements:
KpiCardhelper with trend-enabledTrendKpiCardBackend Extensions:
cashflowTrendquerypreviousPeriodTotalsfor trend calculationscashPositionbreakdown by account typeTesting:
src/pages/__tests__/dashboard-coherence.test.ts(68 lines)api/__tests__/dashboard-summary-extensions.test.ts(59 lines)Files Added:
11. Version Bump & Release
Commit:
ad543c0- chore(release): bump version to 1.1.0Release Preparation:
package.jsonversion: 1.0.6 → 1.1.0APP_VERSIONconstant insrc/lib/version.tsCHANGELOG.md🗄️ Database Migrations
This release includes 10 new migrations:
Migration Safety:
NOT VALID + VALIDATE🧪 Testing Coverage
New Test Files (18):
Test Coverage Areas:
🔒 Security Enhancements
API Key Authentication System
CSRF Protection Updates
/api/integration/*,/api/webhooks/*)Authorization Improvements
Data Integrity
locationId,sourceBatchId,externalId)📚 Documentation Updates
New Documentation:
Updated Files:
⚙️ Configuration Changes
Environment Variables:
.env.examplewith new integration-related variablesDependencies:
🐛 Bug Fixes
🚨 Breaking Changes
None - This release is fully backward compatible with v1.0.6
Note: The dev server port change (3000 → 3200) may require local environment updates for developers.
📋 Deployment Checklist
scripts/migration-safety-check.tsbefore deployment.env.examplenpm testto validate all tests passnpm run lintandnpm run checkfor code quality👥 Contributors
📊 Commit Summary
ad543c05a4c0d2db92ec2a9f8b44628a7845e783fcfb3536f7e47204b9c73eb13ea5309a86293🎉 Summary
This release represents a significant milestone for FinaFlow, bringing enterprise-grade integration capabilities, production-ready database optimizations, and enhanced partner management features. The codebase is now more secure, performant, and maintainable with comprehensive test coverage and documentation.
Ready for production deployment! 🚀
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Test Configuration:
Checklist:
Screenshots (if appropriate):
Additional context:
Add any other context about the pull request here.