You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
605 B

  1. import { OptionDTO } from './optionData'
  2. import { OptionRepository } from '~/domain/models/option/optionRepository'
  3. import { OptionItem } from '~/domain/models/option/option'
  4. export class OptionApplicationService {
  5. constructor(
  6. private readonly repository: OptionRepository
  7. ) {}
  8. public findOption(projectId: string): OptionDTO {
  9. const item = this.repository.findById(projectId)
  10. return new OptionDTO(item)
  11. }
  12. public save(projectId: string, option: OptionDTO) {
  13. const item = new OptionItem(option.page, option.q, option.isChecked)
  14. this.repository.save(projectId, item)
  15. }
  16. }