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.

17 lines
597 B

2 years ago
  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(private readonly repository: OptionRepository) {}
  6. public findOption(projectId: string): OptionDTO {
  7. const item = this.repository.findById(projectId)
  8. return new OptionDTO(item)
  9. }
  10. public save(projectId: string, option: OptionDTO) {
  11. const item = new OptionItem(option.page, option.q, option.isChecked)
  12. this.repository.save(projectId, item)
  13. }
  14. }