Repository: fossasia/open-event-server

Issue:
Add API for Message settings
**Is your feature request related to a problem? Please describe.**
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
Currently, server have no feature of Message Settings API.
**Describe the solution you'd like**
<!-- A clear and concise description of what you want to happen. -->
Creating API for message setting that will allow only the admin to get and update the settings concerning this.
**Describe alternatives you've considered**
<!-- A clear and concise description of any alternative solutions or features you've considered. -->

**Additional context**
<!-- Add any other context or screenshots about the feature request here. -->
**V1**
![screenshot from 2018-06-16 16-01-19](https://user-images.githubusercontent.com/22936570/41497955-88a046f2-717e-11e8-8d35-7197f3f89598.png)

**V2**
![screenshot from 2018-06-16 15-15-54](https://user-images.githubusercontent.com/22936570/41497726-b6ece7b4-7178-11e8-843e-201604192aaf.png)



Discussion:
Hi @maxlorenz 
System Messages is same as Message Settings Refer: Open Event Backlogs :)
Great, assigned myself

Resolving patch:
diff --git a/app/api/__init__.py b/app/api/__init__.py
--- a/app/api/__init__.py
+++ b/app/api/__init__.py
@@ -37,6 +37,7 @@
 from app.api.user_permission import UserPermissionList, UserPermissionDetail
 from app.api.events_role_permission import EventsRolePermissionList, EventsRolePermissionDetail, \
     EventsRolePermissionRelationship
+from app.api.message_settings import MessageSettingsList, MessageSettingsDetail
 from app.api.tax import TaxList, TaxDetail, TaxRelationship
 from app.api.settings import SettingDetail
 from app.api.discount_codes import DiscountCodeList, DiscountCodeDetail, DiscountCodeRelationshipOptional, \
@@ -106,6 +107,10 @@
 api.route(EmailNotificationRelationshipOptional, 'email_notification_event',
           '/email-notifications/<int:id>/relationships/event')
 
+# message_settings
+api.route(MessageSettingsList, 'message_settings_list', '/message-settings')
+api.route(MessageSettingsDetail, 'message_setting_detail', '/message-settings/<int:id>')
+
 # event_image_sizes
 api.route(EventImageSizeDetail, 'event_image_size_detail', '/event-image-sizes/<id>',
           '/event-image-sizes')
diff --git a/app/api/message_settings.py b/app/api/message_settings.py
new file mode 100644
--- /dev/null
+++ b/app/api/message_settings.py
@@ -0,0 +1,28 @@
+from flask_rest_jsonapi import ResourceDetail, ResourceList
+
+from app.api.bootstrap import api
+from app.api.schema.message_settings import MessageSettingSchema
+from app.models import db
+from app.models.message_setting import MessageSettings
+
+
+class MessageSettingsList(ResourceList):
+    """
+    List Events Role Permission
+    """
+    decorators = (api.has_permission('is_admin', methods="GET"),)
+    methods = ['GET']
+    schema = MessageSettingSchema
+    data_layer = {'session': db.session,
+                  'model': MessageSettings}
+
+
+class MessageSettingsDetail(ResourceDetail):
+    """
+    Events Role Permission detail by id
+    """
+    schema = MessageSettingSchema
+    decorators = (api.has_permission('is_admin', methods="PATCH"),)
+    methods = ['GET', 'PATCH']
+    data_layer = {'session': db.session,
+                  'model': MessageSettings}


Test patch: