[MM-43649] - Ability for end users to notify admin to upgrade workspace (#20338)

* [MM-43649] - Ability for end users to notify admin to upgrade workspace

* add test case

* move code to app layer

* feedback impl

* feedback impl-1

* feedback impl

* simplify logic

* fix typo and lint

* fix app layers

* Use a single critical section for users notified admin (#20488)

* Use a single critical section for users notifying admin

* change persistence mechanism

* add more tests

* change bot message

* fix translations

* update logic to notify once within cooloff period

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Nathaniel Allred <neallred@protonmail.com>
Этот коммит содержится в:
Allan Guwatudde
2022-06-30 09:24:42 +03:00
коммит произвёл GitHub
родитель dad8eab777
Коммит 1d9fa3c333
9 изменённых файлов: 293 добавлений и 1 удалений

Просмотреть файл

@@ -7915,6 +7915,22 @@ func (c *Client4) RequestCloudTrial(email *StartCloudTrialRequest) (*Subscriptio
return subscription, BuildResponse(r), nil
}
func (c *Client4) NotifyAdmin(nr *NotifyAdminToUpgradeRequest) int {
nrJSON, jsonErr := json.Marshal(nr)
if jsonErr != nil {
return 0
}
r, err := c.DoAPIPost(c.cloudRoute()+"/notify-admin-to-upgrade", string(nrJSON))
if err != nil {
return r.StatusCode
}
closeBody(r)
return r.StatusCode
}
func (c *Client4) ValidateBusinessEmail(email *ValidateBusinessEmailRequest) (*Response, error) {
payload, _ := json.Marshal(email)
r, err := c.DoAPIPostBytes(c.cloudRoute()+"/validate-business-email", payload)