Skip to content

[EXTRACT] FileService - Rip file operations from monolith #50

@democratize-technology-code-reviewer

Description

🔪 Extraction Target

Extract all file operations from the 19,843-line index.mjs into a focused FileService class. Direct transfer.

📁 Methods to Extract

// All of these get ripped out and moved to FileService
uploadFile()
downloadFile()
deleteFile()
getFiles()
// ... and any other file-related methods

🎯 Definition of Done

  • Create services/FileService.js extending BaseService
  • Extract ALL file methods from index.mjs
  • File size < 500 lines (enforced by linter)
  • All existing tests pass WITHOUT modification
  • Add JSDoc comments for each method
  • No deprecated methods or compatibility layers
  • Update all imports/references in index.mjs
  • Zero regression - identical functionality

⚡ Implementation

// services/FileService.js
export class FileService extends BaseService {
  async uploadFile(entity, entityId, fileName, fileData) {
    // Direct copy from index.mjs - no changes
  }
  
  async downloadFile(group, fileName) {
    // Direct copy from index.mjs - no changes
  }
  
  // ... rest of file methods
}

🚫 NOT in Scope

  • Backward compatibility
  • Deprecation warnings
  • Proxy methods in GrocyClient
  • Changing method signatures
  • Adding new features

💀 Breaking Changes

Yes. Move forward.

Related to

Parent issue: #11

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions