feat: Ability to add/remove tags from any list of messages #189

This commit is contained in:
rustmailer
2026-03-26 21:22:21 +08:00
parent 5d0039cb74
commit 3f11c5dbbf
30 changed files with 805 additions and 66 deletions
+11 -3
View File
@@ -16,16 +16,16 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
use std::collections::HashMap;
use poem_openapi::Object;
use poem_openapi::{Enum, Object};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Default, Eq, PartialEq, Serialize, Deserialize, Object)]
pub struct UpdateTagsRequest {
pub struct TagsRequest {
pub updates: HashMap<u64, Vec<String>>, // account_id -> envelope_ids
pub tags: Vec<String>,
pub action: TagAction,
}
#[derive(Debug, Clone, Default, Eq, PartialEq, Serialize, Deserialize, Object)]
@@ -33,3 +33,11 @@ pub struct TagCount {
pub tag: String,
pub count: u64,
}
#[derive(Enum, Default, Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
pub enum TagAction {
Add,
Remove,
#[default]
Overwrite,
}