Skip to content
This repository was archived by the owner on Dec 3, 2019. It is now read-only.
This repository was archived by the owner on Dec 3, 2019. It is now read-only.

Create new SlackUser Database with RESTful modifications #314

Closed
@apex-omontgomery

Description

@apex-omontgomery

Feature

Why is this feature being added?

This feature is being added to reduce User table bloat and reduce manual CRUD operations.
This modification will create a new table to store Operation Code Slack information and create an endpoint to control the update and secure access for this RESTful endpoint.

Going to be using this issue as the epic for the entire feature, and will attempt to implement as I can.

What should your feature do?

  • create migration to remove slack_name from User table
  • create new db table SlackUser table
  • implement BE exposing with customized authentication
  • accept create and update through BE
  • submit conditional responses to the connected API
  • rake task for initial seeding and downtime management

SlackUser Table

key attribute example
FK, unique user_id 20
unique slack_id "W012A3CDE"
slack_name "harry"
slack_real_name "William Michael John"
slack_display_name "Very Unoriginal"
unique slack_email "thebestwrestler@wwf.com"

New User Flow

  1. User creates account through FE or uses previously made account
  2. User creates account in Slack
  3. team_join event triggers some action to the BE with the slack user information
  4. BE finds connected User record and creates a new SlackUser record
  5. If no email found - > request user to set Slack email to be same as OC email.
  6. Notification to change can be a slack message, (preferred). Or an email.

Exisiting User updates

  1. user_change event triggers call to BE repo with information
  2. BE report looks for Slackuser with slack_id, and makes change.
  3. If no SlackUser found, creates new SlackUser and associates with User with matching email
  4. after_update callback on user.email_changed?

BE Endpoints

  1. POST :create -> New User
    a. success response
    b. request email update response
    c. some error status
  2. PUT :update -> Existing User
    a. success response
    b. record created
    c. request email update response
    d. some error status

API Authentication

  1. Some TBD authentication

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions