Skip to content

Commit

Permalink
feat: add GenerationScheduleUseCase#add
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucky3028 committed Aug 29, 2022
1 parent 765979f commit 067571e
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ import click.seichi.regenerateworld.usecase.usetraits.{
import java.util.UUID

trait GenerationScheduleUseCase extends UseGenerationScheduleRepository with UseClock {
def add(interval: Interval, seedPattern: SeedPattern, worlds: Set[String]): UUID = {
// TODO: 再生成日時をきちんとする
val schedule =
GenerationSchedule(UUID.randomUUID(), clock.now, interval, seedPattern, worlds)

generationScheduleRepository.save(schedule)

schedule.id
}

def list(): Set[GenerationSchedule] = generationScheduleRepository.list()

def filteredList(predicate: GenerationSchedule => Boolean): Set[GenerationSchedule] =
Expand Down

0 comments on commit 067571e

Please sign in to comment.