refactor(management): clean up structural indirection across lib #110

Closed
opened 2026-09-28 19:18:05 +00:00 by yuris · 0 comments
Owner

Problem

apps/management contains structural indirection across types and messaging modules that increases reader load:

  1. apps/management/lib/types/index.ts is an artificial barrel re-exporting domain types, causing callers to bypass direct domain slice paths.
  2. apps/management/lib/connectors/whatsapp-wwebjs/ and apps/management/lib/messaging/ fragment single-service WhatsApp handling across redundant directories and a one-caller adapter layer.
  3. Narrative comments, obsolete divider banners, and redundant method signatures in apps/management/lib/ create clutter.

Acceptance Criteria

  1. Delete apps/management/lib/types/index.ts and migrate every caller to direct domain slice imports (@/lib/orders/types, @/lib/customers/types, @/lib/inventory/types, @/lib/purchases/types).
  2. Consolidate apps/management/lib/connectors/whatsapp-wwebjs/ and apps/management/lib/messaging/ into a single cohesive apps/management/lib/whatsapp/ directory. Collapse one-caller adapter layers and remove obsolete directories.
  3. Run a no-comments pass over apps/management/lib/ to delete narrative narration, obsolete headers, and commented-out corpses.
  4. Verify with pnpm verify:management.
## Problem `apps/management` contains structural indirection across types and messaging modules that increases reader load: 1. `apps/management/lib/types/index.ts` is an artificial barrel re-exporting domain types, causing callers to bypass direct domain slice paths. 2. `apps/management/lib/connectors/whatsapp-wwebjs/` and `apps/management/lib/messaging/` fragment single-service WhatsApp handling across redundant directories and a one-caller adapter layer. 3. Narrative comments, obsolete divider banners, and redundant method signatures in `apps/management/lib/` create clutter. ## Acceptance Criteria 1. Delete `apps/management/lib/types/index.ts` and migrate every caller to direct domain slice imports (`@/lib/orders/types`, `@/lib/customers/types`, `@/lib/inventory/types`, `@/lib/purchases/types`). 2. Consolidate `apps/management/lib/connectors/whatsapp-wwebjs/` and `apps/management/lib/messaging/` into a single cohesive `apps/management/lib/whatsapp/` directory. Collapse one-caller adapter layers and remove obsolete directories. 3. Run a no-comments pass over `apps/management/lib/` to delete narrative narration, obsolete headers, and commented-out corpses. 4. Verify with `pnpm verify:management`.
yuris closed this issue 2026-09-28 19:27:23 +00:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
yuris/garage#110
No description provided.