Skip to content

Next

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
Minds Backend - Engine
Minds Backend - Engine
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
    • Insights
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
    • Locked Files
  • Issues 158
    • Issues 158
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 41
    • Merge Requests 41
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Registry
    • Registry
  • Packages
    • Packages
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Minds
  • Minds Backend - EngineMinds Backend - Engine
  • Merge Requests
  • !187

Open
Opened 2 weeks ago by Brian Hatchet@brianhatchet:speech_balloon:
  • Report abuse
Report abuse

email states, writing and reading from cassandra

Writing and reading email states from Cassandra

Refactored the user state emails into delegates\senders which are in charge of talking to all the managers and getting the data for the given user state

Once we get the other emails in line, we'll be able to query cassandra and just

Edited 1 week ago by Brian Hatchet

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

git fetch https://gitlab.com/brianhatchet/engine.git email_schema
git checkout -b brianhatchet/engine-email_schema FETCH_HEAD

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git fetch origin
git checkout origin/master
git merge --no-ff brianhatchet/engine-email_schema

Step 4. Push the result of the merge to GitLab

git push origin master

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines.

Request to merge brianhatchet:email_schema into master
The source branch is 35 commits behind the target branch
Open in Web IDE
  • Email patches
  • Plain diff
Pipeline #64733102 passed for 30a2f094 on brianhatchet:email_schema
      Requires approval from Devs. Approved by
      Marcelo Rivera
      Marcelo Rivera
      Martin Santangelo
      Martin Santangelo
      Ben Hayward
      Ben Hayward
      Emiliano Balbuena
      Emiliano Balbuena
      Rami Albatal
      Rami Albatal
      Mark Harding
      Mark Harding
      There are merge conflicts. Resolve these conflicts or ask someone with write access to this repository to merge it locally

      Allows commits from members who can merge to the target branch

      Deletes source branch

      You can merge this merge request manually using the
      • Discussion 6
      • Commits 3
      • Pipelines 2
      • Changes 21
      0/6 discussions resolved
      • Loading...
      • Brian Hatchet :speech_balloon: @brianhatchet added 4 commits 1 week ago

        added 4 commits

        • 067bcab3...fbbe6842 - 2 commits from branch minds:master
        • 1cc12f34 - Merge remote-tracking branch 'upstream/master' into email_schema
        • 30a2f094 - Delegates for sending campaign emails

        Compare with previous version

      • Brian Hatchet :speech_balloon: @brianhatchet unmarked as a Work In Progress 1 week ago

        unmarked as a Work In Progress

      • Brian Hatchet :speech_balloon: @brianhatchet assigned to @brianhatchet 1 week ago

        assigned to @brianhatchet

      • Brian Hatchet :speech_balloon: @brianhatchet changed the description 2 times within 3 minutes 1 week ago

        changed the description 2 times within 3 minutes

      • Brian Hatchet :speech_balloon: @brianhatchet changed milestone to %sprint: Funny Frog 1 week ago

        changed milestone to %sprint: Funny Frog

      • Marcelo Rivera @eiennohi approved this merge request 51 minutes ago

        approved this merge request

      • Emiliano Balbuena
        Emiliano Balbuena @edgebal started a discussion on the diff 16 minutes ago
        Core/Email/CampaignLogs/CampaignLog.php
        1 <?php
        2
        3 namespace Minds\Core\Email\CampaignLogs;
        4
        5 use Minds\Traits\MagicAttributes;
        6
        7 class CampaignLog
        8 {
        9 use MagicAttributes;
        10
        11 /** @var int $receiverGuid the user guid who received the email */
        12 public $receiverGuid;
        • Emiliano Balbuena
          Emiliano Balbuena @edgebal · 16 minutes ago
          Developer

          MagicAttributes entities should have their properties set as protected.

        Please register or sign in to reply
      • Emiliano Balbuena
        Emiliano Balbuena @edgebal started a discussion on the diff 16 minutes ago
        Core/Email/CampaignLogs/CampaignLog.php
        1 <?php
        2
        3 namespace Minds\Core\Email\CampaignLogs;
        4
        5 use Minds\Traits\MagicAttributes;
        6
        7 class CampaignLog
        • Emiliano Balbuena
          Emiliano Balbuena @edgebal · 16 minutes ago
          Developer

          Ideally, to help PHPSpec's Reflection mocks and some IDEs/IntelliSense, you should explicitly declare the getters and setters your entity supports on the PHPDoc of the class and the properties. Example:

          /**
           * @method string getLastName()
           * @method Brian setLastName(string $lastName)
           * @method int|string getAge()
           * @method Brian setAge(int|string $age)
           */
          class Brian
          {
              use MagicAttributes;
          
              /** @var string */
              protected $lastName;
          
              /** @var int|string */
              protected $age;
          }
        Please register or sign in to reply
      • Emiliano Balbuena
        Emiliano Balbuena @edgebal started a discussion on the diff 16 minutes ago
        Core/Email/CampaignLogs/Repository.php
        36 *
        37 * receiver_guid the user guid
        38 * limit 10
        39 *
        40 * @return CampaignLog[]
        41 */
        42 public function getList(array $options = [])
        43 {
        44 $options = array_merge([
        45 'limit' => 10,
        46 'offset' => '',
        47 'receiver_guid' => null,
        48 ], $options);
        49
        50 $template = 'SELECT * FROM email_campaign_logs';
        51 $where = [];
        • Emiliano Balbuena
          Emiliano Balbuena @edgebal · 16 minutes ago
          Developer

          Declaring an array here, but using it as string on L55 and L60

        Please register or sign in to reply
      • Emiliano Balbuena
        Emiliano Balbuena @edgebal started a discussion on the diff 16 minutes ago
        Core/Email/Campaigns/EmailCampaign.php
        65 66
        66 67 return true;
        67 68 }
        69
        70 /**
        71 * Returns the short name of the class as the template name.
        72 */
        73 public function getEmailCampaignId()
        74 {
        75 return (new \ReflectionClass($this))->getShortName();
        • Emiliano Balbuena
          Emiliano Balbuena @edgebal · 16 minutes ago
          Developer

          I love this, but check with @markeharding if he's OK using Reflection on production.

        Please register or sign in to reply
      • Emiliano Balbuena
        Emiliano Balbuena @edgebal started a discussion on the diff 16 minutes ago
        Core/Email/Delegates/WelcomeSender.php
        6 use Minds\Core\Di\Di;
        7 use Minds\Core\Suggestions\Manager as SuggestionsManager;
        8 use Minds\Core\Onboarding\Manager as OnboardingManager;
        9 use Minds\Interfaces\SenderInterface;
        10 use Minds\Core\Email\Campaigns\UserRetention\WelcomeComplete;
        11 use Minds\Core\Email\Campaigns\UserRetention\WelcomeIncomplete;
        12
        13 class WelcomeSender implements SenderInterface
        14 {
        15 /** @var SuggestionsManager */
        16 private $suggestionsManager;
        17 /** @var OnboardingManager */
        18 private $onboardingManager;
        19 /** @var WelcomeComplete */
        20 private $welcomeComplete;
        21 /** @var WelcomeIncomplete */
        • Emiliano Balbuena
          Emiliano Balbuena @edgebal · 16 minutes ago
          Developer

          Extra identation space here and below.

        Please register or sign in to reply
      • Emiliano Balbuena
        Emiliano Balbuena @edgebal started a discussion on the diff 16 minutes ago
        Core/Email/Delegates/WelcomeSender.php
        15 /** @var SuggestionsManager */
        16 private $suggestionsManager;
        17 /** @var OnboardingManager */
        18 private $onboardingManager;
        19 /** @var WelcomeComplete */
        20 private $welcomeComplete;
        21 /** @var WelcomeIncomplete */
        22 private $welcomeIncomplete;
        23
        24
        25
        26 public function __construct(
        27 SuggestionsManager $suggestionsManager = null,
        28 OnboardingManager $onboardingManager = null,
        29 WelcomeComplete $welcomeComplete = null,
        30 WelcomeIncomplete $welcomeIncomplete = null)
        • Emiliano Balbuena
          Emiliano Balbuena @edgebal · 16 minutes ago
          Developer

          Closing paren.

        Please register or sign in to reply
      • You're only seeing other activity in the feed. To add a comment, switch to one of the following options.
      Please register or sign in to reply
      Assignee
      Brian Hatchet's avatar Brian Hatchet @brianhatchet
      Assign to
      sprint: Funny Frog
      Milestone
      sprint: Funny Frog
      Assign milestone
      None
      Time tracking
      No estimate or time spent
      0
      Labels
      None
      Assign labels
      • View project labels
      Lock merge request
      Unlocked
      7
      7 participants
      user avatar
      Martin Santangelo
      user avatar
      Ben Hayward
      user avatar
      Emiliano Balbuena
      user avatar
      Rami Albatal
      user avatar
      Mark Harding
      user avatar
      Brian Hatchet
      user avatar
      Marcelo Rivera
      Reference: minds/engine!187