Skip to content

feat(pos): add manager authorization and resolve frontend lint issues#84

Merged
CFBruna merged 62 commits intov2/monorepo-migrationfrom
feature/frontend-public-pages
Feb 17, 2026
Merged

feat(pos): add manager authorization and resolve frontend lint issues#84
CFBruna merged 62 commits intov2/monorepo-migrationfrom
feature/frontend-public-pages

Conversation

@CFBruna
Copy link
Owner

@CFBruna CFBruna commented Feb 17, 2026

What's New

  • Implemented AuditLog model in accounts app to track sensitive actions.
  • Added AuthorizeActionView API endpoint for manager authorization.
  • Frontend: Added ManagerAuthModal to protect "Remove Item" and "Apply Discount" actions in POS.
  • Frontend: Fixed critical bug where 401 errors caused infinite redirect loops (changed to 403 handling).
  • Frontend: Resolved all ESLint errors, including any type usage, useEffect dependencies, and synchronous state updates in CurrencyInput.
  • Frontend: Improved type safety in POSPage, Sales, and CheckoutModal.
  • Registered AuditLog in Django Admin with full translations.
  • Updated bandit configuration and fixed backend test assertions.

Why

  • Security: To prevent unauthorized discounts and item removals by cashiers, requiring manager approval.
  • Auditability: To keep a detailed log of who authorized sensitive actions and why.
  • Code Quality: To ensure a clean, type-safe, and maintainable codebase by resolving all linting and static analysis issues.
  • Bug Fixes: To improve user experience by preventing app crashes and redirect loops.

Testing

  • Unit tests updated for Service Layer and Authorization views (pytest).
  • Manual test: Verify "Remove Item" triggers Manager Auth Modal in POS.
  • Manual test: Verify "Apply Discount" triggers Manager Auth Modal in POS.
  • Manual test: Confirm valid credentials allow action and create Audit Log entry.
  • Manual test: Confirm invalid credentials show error without page reload.
  • Manual test: Verify npm run lint and npm run build pass without errors.

Checklist

  • Code follows Service Layer architecture
  • No logic in Views/Admin
  • MyPy strict compliance (for new files)
  • Ruff linting passed

- Add discount field to Sale model\n- Update SaleService and SaleSerializer to handle discounts\n- Add discount input and reactive calculations to CheckoutModal\n- Connect POSPage to discount functionality
- Fix Textarea import in ManagerAuthModal
- Remove explicit any from catch blocks in multiple files
- Fix actionTypes type definition in use-toast.ts
- Fix useEffect dependencies in CurrencyInput, Sales, and others
- Fix fetchSales definition order in Sales.tsx
- Remove unused variables and imports
- Ensure production build passes
- Relax Customer __str__ assertion for users without names
- Fix create_customer arguments in test_services
- Update bandit exclude patterns in pyproject.toml
- Update authlib to >=1.6.6 (CVE-2025-68158)
- Update pyasn1 to >=0.6.2 (CVE-2026-23490)
- Update virtualenv to >=20.36.1 (CVE-2026-22702)
@CFBruna CFBruna merged commit 592e3d0 into v2/monorepo-migration Feb 17, 2026
1 check passed
@CFBruna CFBruna deleted the feature/frontend-public-pages branch February 17, 2026 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant