import { MonthlyAssessment } from '@/domain/aggregates'
import { AssessmentId, AuthorizationId, UserId, Month, RegionCode } from '@/domain/value-objects'
import { RoleType } from '@/domain/enums'

export const MONTHLY_ASSESSMENT_REPOSITORY = Symbol('IMonthlyAssessmentRepository')

export interface IMonthlyAssessmentRepository {
  save(assessment: MonthlyAssessment): Promise<void>
  saveAll(assessments: MonthlyAssessment[]): Promise<void>
  findById(assessmentId: AssessmentId): Promise<MonthlyAssessment | null>
  findByAuthorizationAndMonth(
    authorizationId: AuthorizationId,
    month: Month,
  ): Promise<MonthlyAssessment | null>
  findByUserAndMonth(userId: UserId, month: Month): Promise<MonthlyAssessment[]>
  findFirstByAuthorization(authorizationId: AuthorizationId): Promise<MonthlyAssessment | null>
  findByMonthAndRegion(
    month: Month,
    roleType: RoleType,
    regionCode: RegionCode,
  ): Promise<MonthlyAssessment[]>
  findRankingsByMonthAndRegion(
    month: Month,
    roleType: RoleType,
    regionCode: RegionCode,
  ): Promise<MonthlyAssessment[]>
  findRankingsByMonthAndRoleType(
    month: Month,
    roleType: RoleType,
  ): Promise<MonthlyAssessment[]>
  findByAuthorization(authorizationId: AuthorizationId): Promise<MonthlyAssessment[]>
  delete(assessmentId: AssessmentId): Promise<void>
}
