sysadmin can add/remove admins via cli
Acceptance Criteria
GIVEN an active channel #foo with phone number #15555555555
- WHEN a sysadmin POSTS an administration payload to
/channels/administrations
- THEN a the phone numbers in the admin field of the payload which are not already admins will be added as an administrators of the channel in the payload
- AND any phone numbers that are already admins will not be added
- AND the each newly added admin will receive a notification from the channel
- AND the api will return a JSON-encoded channel status update to the sysadmin
Bonus: when playing this, address bug in which when an admin sends a "leave" message, they are no longer subscribed to the channel but may still send messages. When an admin is removed, their administration
and subscription
to the channel should both be deleted.
Definitions
THEN a payload will be of the following format
{
channel: number,
admins: Array<number>,
}
a welcome message will be of the following format
Hi! You have been made an admin of the #foo channel on signal boost. Welcome!
If you send a message to this number (+15555555555), it will be re-broadcast to all subscribers to #foo. Currently #foo has 0 subscribers.
To subscribe to #foo, people can send a message that says "JOIN" to +15555555555. To unsubscribe, they can send a message that says "LEAVE."
If you send a message that says "LEAVE" you will be removed as an admin, and will no longer be able to send messages to the channel.
Edited by aguestuser