Skip to content

Commit

Permalink
v0.3.0-beta.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Artem-K-Koltunov committed Mar 21, 2024
1 parent c86e161 commit b096f44
Show file tree
Hide file tree
Showing 3 changed files with 583 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/Domain/use_cases/UpdateCurrentDialogInDataSourceUseCase.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { DialogEntity } from '../entity/DialogEntity';
import DialogsRepository from '../../Data/repository/DialogsRepository';
import { IUseCase } from './base/IUseCase';
import { GroupDialogEntity } from '../entity/GroupDialogEntity';

export class UpdateCurrentDialogInDataSourceUseCase
implements IUseCase<void, DialogEntity>
{
private dialogRepository: DialogsRepository;

private updateDialog: GroupDialogEntity;

constructor(
dialogRepository: DialogsRepository,
updateDialog: GroupDialogEntity,
) {
console.log('CONSTRUCTOR UpdateCurrentDialogInDataSourceUseCase');
this.dialogRepository = dialogRepository;
this.updateDialog = updateDialog;
}

async execute(): Promise<DialogEntity> {
console.log('execute UpdateCurrentDialogInDataSourceUseCase');
const result: DialogEntity =
await this.dialogRepository.updateCurrentDialogInLocalDataSource(
this.updateDialog,
);

return Promise.resolve(result);
}
}
Loading

0 comments on commit b096f44

Please sign in to comment.