ADR — PR #1292
2026-05-28 14:30 — Remove unused protectedRoutes field
Section titled “2026-05-28 14:30 — Remove unused protectedRoutes field”- Comment: https://github.com/ERP-Unlocked/ordermatic/pull/1292/files#diff-fc5e3b0e8c7e5e3e8c7e5e3e8c7e5e3e8c7e5e3e8c7e5e3e8c7e5e3e8c7e5e3e8c7e5e3e8c7e5e3e8
- Priority: must-fix
- Decision: accept
- Rationale: Unused variable violates TypeScript rules and adds clutter to the codebase
2026-05-28 14:31 — Fix Drizzle orderBy with proper desc() helper
Section titled “2026-05-28 14:31 — Fix Drizzle orderBy with proper desc() helper”- Comment: https://github.com/ERP-Unlocked/ordermatic/pull/1292/files#diff-7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3
- Priority: must-fix
- Decision: accept
- Rationale: Using string cast ‘desc’ as any is incorrect Drizzle API usage
2026-05-28 14:32 — Remove redundant in-memory sort after orderBy fix
Section titled “2026-05-28 14:32 — Remove redundant in-memory sort after orderBy fix”- Comment: https://github.com/ERP-Unlocked/ordermatic/pull/1292/files#diff-4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1
- Priority: nice-to-have
- Decision: accept
- Rationale: Database ordering makes client-side sort redundant, improving performance
2026-05-28 14:33 — Remove unnecessary comments that restate code
Section titled “2026-05-28 14:33 — Remove unnecessary comments that restate code”- Comment: https://github.com/ERP-Unlocked/ordermatic/pull/1292/files#diff-2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5f6a7b8c9d0e1
- Priority: nice-to-have
- Decision: accept
- Rationale: Comments just repeat ticket numbers and function names without explaining why
2026-05-28 14:34 — Remove duplicate describe block in tests
Section titled “2026-05-28 14:34 — Remove duplicate describe block in tests”- Comment: https://github.com/ERP-Unlocked/ordermatic/pull/1292/files#diff-a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5f6a7b8c9d0e1
- Priority: must-fix
- Decision: accept
- Rationale: Duplicate test code causes redundant test execution and maintenance burden
2026-05-28 14:35 — Fix Drizzle select() mocking to be chainable
Section titled “2026-05-28 14:35 — Fix Drizzle select() mocking to be chainable”- Comment: https://github.com/ERP-Unlocked/ordermatic/pull/1292/files#diff-b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5f6a7b8c9d0e1
- Priority: must-fix
- Decision: accept
- Rationale: Drizzle’s select() returns a chainable builder, not a direct value
2026-05-28 14:36 — Fix calcSuccess mocking in getDriftSignal test
Section titled “2026-05-28 14:36 — Fix calcSuccess mocking in getDriftSignal test”- Comment: https://github.com/ERP-Unlocked/ordermatic/pull/1292/files#diff-c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5f6a7b8c9d0e1f2a3b
- Priority: must-fix
- Decision: accept
- Rationale: Test was mocking calcSuccess as constant instead of different values for different periods
2026-05-28 14:37 — Fix getDriftSignal test with proper multiple db.select mocking
Section titled “2026-05-28 14:37 — Fix getDriftSignal test with proper multiple db.select mocking”- Comment: https://github.com/ERP-Unlocked/ordermatic/pull/1292/files#diff-d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5
- Priority: must-fix
- Decision: accept
- Rationale: Test needed proper mocking of multiple sequential db.select calls for sample size, success rates, and failure counts