diff --git a/app/config/collections.php b/app/config/collections.php index 54e72740de..9435387207 100644 --- a/app/config/collections.php +++ b/app/config/collections.php @@ -1903,7 +1903,29 @@ $commonCollections = [ 'filters' => [], ], [ - '$id' => ID::custom('total'), + '$id' => ID::custom('emailTotal'), + 'type' => Database::VAR_INTEGER, + 'format' => '', + 'size' => 0, + 'signed' => true, + 'required' => false, + 'default' => 0, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('smsTotal'), + 'type' => Database::VAR_INTEGER, + 'format' => '', + 'size' => 0, + 'signed' => true, + 'required' => false, + 'default' => 0, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('pushTotal'), 'type' => Database::VAR_INTEGER, 'format' => '', 'size' => 0, diff --git a/src/Appwrite/Utopia/Response/Model/Topic.php b/src/Appwrite/Utopia/Response/Model/Topic.php index 25889095fd..dd81430164 100644 --- a/src/Appwrite/Utopia/Response/Model/Topic.php +++ b/src/Appwrite/Utopia/Response/Model/Topic.php @@ -34,9 +34,21 @@ class Topic extends Model 'default' => '', 'example' => 'events', ]) - ->addRule('total', [ + ->addRule('emailTotal', [ 'type' => self::TYPE_INTEGER, - 'description' => 'Total count of subscribers subscribed to topic.', + 'description' => 'Total count of email subscribers subscribed to the topic.', + 'default' => 0, + 'example' => 100, + ]) + ->addRule('smsTotal', [ + 'type' => self::TYPE_INTEGER, + 'description' => 'Total count of SMS subscribers subscribed to the topic.', + 'default' => 0, + 'example' => 100, + ]) + ->addRule('pushTotal', [ + 'type' => self::TYPE_INTEGER, + 'description' => 'Total count of push subscribers subscribed to the topic.', 'default' => 0, 'example' => 100, ])