Skip to content

refactor: abstract platform dependencies (HttpContext, attachments) #62

@flojon

Description

@flojon

Part of #60. Depends on #61.

What

Replace direct IHttpContextAccessor / HttpContext usage in shared code with platform-neutral abstractions. Two concrete implementations: one for web (reads from HttpContext), one for desktop (returns hardcoded local user).

Scope

  • TenantContext — replace IHttpContextAccessor with a scoped ICurrentUser interface
  • Attachment serving — wrap the /attachments/{id} HTTP endpoint behind an IAttachmentProvider so the desktop target can serve files directly without an HTTP request

Acceptance criteria

  • ICurrentUser interface introduced; web implementation resolves from HttpContext, desktop implementation returns local user
  • IAttachmentProvider introduced; web implementation proxies the existing HTTP endpoint, desktop implementation returns stream directly
  • Web app builds and behaves identically to before
  • No IHttpContextAccessor references remain in KoalaBooks.Components or shared service projects

Notes

Safe to merge independently. Improves the web app regardless of whether the desktop app ships.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions