Skip to content

refactor: extract job type definitions into SportsData.Jobs.Contracts assembly #136

@coderabbitai

Description

@coderabbitai

Background

Currently, SportsData.JobsDashboard holds direct ProjectReference entries to SportsData.Api, SportsData.Producer, and SportsData.Provider so the Hangfire dashboard can deserialize and display job type details (e.g., ContestRecapJob, MatchupScheduler, VenueGeoCodeJob, ResourceIndexJob).

This was introduced as a pragmatic stabilization fix in PR #135 (see review comment).

Problem

Referencing the full worker projects from JobsDashboard introduces heavy transitive dependencies:

  • Firebase Admin, JWT Bearer, SignalR, Azure services, MongoDB, SendGrid, Twilio, EntityFrameworkCore variants, and 800+ C# source files
  • Build coordination: JobsDashboard rebuilds whenever Api, Producer, or Provider change
  • Version alignment: all four projects must maintain binary compatibility

Proposed Solution

Extract only the job-type/contract definitions into a new minimal SportsData.Jobs.Contracts assembly:

  1. Create a new class library project SportsData.Jobs.Contracts with no heavy dependencies
  2. Move job class definitions, interfaces, and any DTOs needed for Hangfire serialization into this new assembly
  3. Keep actual job implementations in their respective worker projects (Api, Producer, Provider), referencing SportsData.Jobs.Contracts
  4. Update SportsData.JobsDashboard.csproj to reference only SportsData.Jobs.Contracts instead of the three full worker projects
  5. Update pipeline/build steps to produce and reference the new contracts project

Acceptance Criteria

  • SportsData.Jobs.Contracts project created with only the types required for Hangfire deserialization
  • SportsData.JobsDashboard references only SportsData.Jobs.Contracts (and SportsData.Core)
  • Worker projects (Api, Producer, Provider) reference SportsData.Jobs.Contracts for job type definitions
  • Hangfire dashboard correctly displays all job types
  • No regression in existing job scheduling and execution
  • DockerfileJobsDashboard COPY steps updated to reflect new project structure

References

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions