TF-4053 Add interactor/datasource/repository for move folder content action
This commit is contained in:
@@ -16,10 +16,17 @@ extension ListEmailIdExtension on List<EmailId> {
|
||||
};
|
||||
}
|
||||
|
||||
Map<Id, PatchObject> generateMapUpdateObjectMoveToMailbox(MailboxId currentMailboxId, MailboxId destinationMailboxId) {
|
||||
Map<Id, PatchObject> generateMapUpdateObjectMoveToMailbox({
|
||||
required MailboxId currentMailboxId,
|
||||
required MailboxId destinationMailboxId,
|
||||
bool markAsRead = false,
|
||||
}) {
|
||||
return {
|
||||
for (var emailId in this)
|
||||
emailId.id: currentMailboxId.generateMoveToMailboxActionPath(destinationMailboxId)
|
||||
emailId.id: currentMailboxId.generateMoveToMailboxActionPath(
|
||||
destinationMailboxId: destinationMailboxId,
|
||||
markAsRead: markAsRead,
|
||||
)
|
||||
};
|
||||
}
|
||||
|
||||
@@ -30,13 +37,6 @@ extension ListEmailIdExtension on List<EmailId> {
|
||||
};
|
||||
}
|
||||
|
||||
Map<Id, PatchObject> generateMapUpdateObjectMoveToSpam(MailboxId currentMailboxId, MailboxId spamMailboxId) {
|
||||
return {
|
||||
for (var emailId in this)
|
||||
emailId.id: currentMailboxId.generateMoveToSpamActionPath(currentMailboxId, spamMailboxId)
|
||||
};
|
||||
}
|
||||
|
||||
Map<Id, PatchObject> generateMapUpdateObjectMarkAsAnswered() {
|
||||
return {
|
||||
for (var emailId in this)
|
||||
|
||||
@@ -13,10 +13,14 @@ extension MailboxIdExtension on MailboxId {
|
||||
}
|
||||
}
|
||||
|
||||
PatchObject generateMoveToMailboxActionPath(MailboxId destinationMailboxId) {
|
||||
PatchObject generateMoveToMailboxActionPath({
|
||||
required MailboxId destinationMailboxId,
|
||||
bool markAsRead = false,
|
||||
}) {
|
||||
return PatchObject({
|
||||
generatePath(): null,
|
||||
destinationMailboxId.generatePath(): true
|
||||
destinationMailboxId.generatePath(): true,
|
||||
if (markAsRead) KeyWordIdentifier.emailSeen.generatePath(): true,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -26,13 +30,5 @@ extension MailboxIdExtension on MailboxId {
|
||||
});
|
||||
}
|
||||
|
||||
PatchObject generateMoveToSpamActionPath(MailboxId currentMailboxId, MailboxId spamMailboxId) {
|
||||
return PatchObject({
|
||||
currentMailboxId.generatePath(): null,
|
||||
spamMailboxId.generatePath(): true,
|
||||
KeyWordIdentifier.emailSeen.generatePath(): true
|
||||
});
|
||||
}
|
||||
|
||||
String get asString => id.value;
|
||||
}
|
||||
Reference in New Issue
Block a user