Skip to content

Commit b096f44

Browse files
v0.3.0-beta.3
1 parent c86e161 commit b096f44

File tree

3 files changed

+583
-0
lines changed

3 files changed

+583
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { DialogEntity } from '../entity/DialogEntity';
2+
import DialogsRepository from '../../Data/repository/DialogsRepository';
3+
import { IUseCase } from './base/IUseCase';
4+
import { GroupDialogEntity } from '../entity/GroupDialogEntity';
5+
6+
export class UpdateCurrentDialogInDataSourceUseCase
7+
implements IUseCase<void, DialogEntity>
8+
{
9+
private dialogRepository: DialogsRepository;
10+
11+
private updateDialog: GroupDialogEntity;
12+
13+
constructor(
14+
dialogRepository: DialogsRepository,
15+
updateDialog: GroupDialogEntity,
16+
) {
17+
console.log('CONSTRUCTOR UpdateCurrentDialogInDataSourceUseCase');
18+
this.dialogRepository = dialogRepository;
19+
this.updateDialog = updateDialog;
20+
}
21+
22+
async execute(): Promise<DialogEntity> {
23+
console.log('execute UpdateCurrentDialogInDataSourceUseCase');
24+
const result: DialogEntity =
25+
await this.dialogRepository.updateCurrentDialogInLocalDataSource(
26+
this.updateDialog,
27+
);
28+
29+
return Promise.resolve(result);
30+
}
31+
}

0 commit comments

Comments
 (0)