Add Point of Sale system and tax rate lookup integration

POS System:
- Full POS interface with product grid, cart panel, and payment flow
- Product and category management with barcode scanning support
- Cash drawer operations and shift management
- Order history and receipt generation
- Thermal printer integration (ESC/POS protocol)
- Gift card support with purchase and redemption
- Inventory tracking with low stock alerts
- Customer selection and walk-in support

Tax Rate Integration:
- ZIP-to-state mapping for automatic state detection
- SST boundary data import for 24 member states
- Static rates for uniform-rate states (IN, MA, CT, etc.)
- Statewide jurisdiction fallback for simple lookups
- Tax rate suggestion in location editor with auto-apply
- Multiple data sources: SST, CDTFA, TX Comptroller, Avalara

UI Improvements:
- POS renders full-screen outside BusinessLayout
- Clear cart button prominently in cart header
- Tax rate limited to 2 decimal places
- Location tax rate field with suggestion UI

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
poduck
2025-12-27 11:31:19 -05:00
parent da508da398
commit 1aa5b76e3b
156 changed files with 61604 additions and 4 deletions

View File

@@ -17,10 +17,13 @@ import {
CalendarOff,
Image,
BarChart3,
ShoppingCart,
Package,
} from 'lucide-react';
import { Business, User } from '../types';
import { useLogout } from '../hooks/useAuth';
import { usePlanFeatures } from '../hooks/usePlanFeatures';
import { useEntitlements, FEATURE_CODES } from '../hooks/useEntitlements';
import SmoothScheduleLogo from './SmoothScheduleLogo';
import UnfinishedBadge from './ui/UnfinishedBadge';
import {
@@ -41,6 +44,7 @@ const Sidebar: React.FC<SidebarProps> = ({ business, user, isCollapsed, toggleCo
const { role } = user;
const logoutMutation = useLogout();
const { canUse } = usePlanFeatures();
const { hasFeature } = useEntitlements();
// Helper to check if user has a specific staff permission
// Owners always have all permissions
@@ -139,6 +143,24 @@ const Sidebar: React.FC<SidebarProps> = ({ business, user, isCollapsed, toggleCo
)}
</SidebarSection>
{/* Point of Sale Section - Requires tenant feature AND user permission */}
{hasFeature(FEATURE_CODES.CAN_USE_POS) && hasPermission('can_access_pos') && (
<SidebarSection title={t('nav.sections.pos', 'Point of Sale')} isCollapsed={isCollapsed}>
<SidebarItem
to="/dashboard/pos"
icon={ShoppingCart}
label={t('nav.pos', 'Point of Sale')}
isCollapsed={isCollapsed}
/>
<SidebarItem
to="/dashboard/products"
icon={Package}
label={t('nav.products', 'Products')}
isCollapsed={isCollapsed}
/>
</SidebarSection>
)}
{/* Staff-only: My Schedule and My Availability */}
{((isStaff && hasPermission('can_access_my_schedule')) ||
((role === 'staff' || role === 'resource') && hasPermission('can_access_my_availability'))) && (