Skip to content
This repository has been archived by the owner on Aug 19, 2024. It is now read-only.

Add significant staff dates reminders #41

Closed
wants to merge 7 commits into from

Conversation

eoinkelly
Copy link
Contributor

@eoinkelly eoinkelly commented Dec 24, 2023

Extend Today @ Ackama bot to support:

  1. Birthday reminders
  2. Work anniversary reminders

Storing state

We need somewhere new to store state because:

  • ProjectWorks has values for people's start dates but the data does not seem to be reliable.
  • We do not currently have any data storage for:
    • Birthdays
    • A preference about whether you want your birthday celebrated at work
    • A preference about whether you want your work anniversary celebrated at work

We chose Contentful because:

  • Our needs stay easily within their free plan.
  • The people-team have a usable administration UI out of the box that doesn't require a dev to
    help manage.

We created a single Staff Member data type (see below). We tried to keep the
data stored in Contentful as minimal as possible to avoid duplication e.g.
Contentful does not store the user's real name - that value is looked up in
Slack as required because the user's slack profile is most likely to be up to
date.

// Partial schema dump of the 'Staff Member' content type in Contentful. See the
// Contentful admin UI for the most up to date version of this.
{
  "name": "Staff Member",
  "fields": [
    {
      "id": "slackHandle",
      "name": "Slack Handle",
      "type": "Symbol",
      "localized": false,
      "required": true,
      "validations": [
        {
          "unique": true
        }
      ],
      "disabled": false,
      "omitted": false
    },
    {
      "id": "startedOn",
      "name": "Started On",
      "type": "Date",
      "localized": false,
      "required": true,
      "validations": [],
      "disabled": false,
      "omitted": false
    },
    {
      "id": "bornOn",
      "name": "Born On",
      "type": "Date",
      "localized": false,
      "required": true,
      "validations": [],
      "disabled": false,
      "omitted": false
    },
    {
      "id": "birthdayNotificationEnabled",
      "name": "Birthday Notification Enabled",
      "type": "Boolean",
      "localized": false,
      "required": true,
      "validations": [],
      "defaultValue": {
        "en-US": false
      },
      "disabled": false,
      "omitted": false
    },
    {
      "id": "workAnniversaryNotificationEnabled",
      "name": "Work Anniversary Notification Enabled",
      "type": "Boolean",
      "localized": false,
      "required": true,
      "validations": [],
      "defaultValue": {
        "en-US": true
      },
      "disabled": false,
      "omitted": false
    }
  ]
}

@eoinkelly eoinkelly changed the title Update dependencies and NodeJS version Add significant staff dates reminders Dec 24, 2023
@eoinkelly
Copy link
Contributor Author

I'll update this code to use the structure outlined by PR #42 when it lands.

@eoinkelly
Copy link
Contributor Author

This change is too specific to Ackama.

@eoinkelly eoinkelly closed this Dec 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant