dappros / ethora

A 'super app' engine for your project. React Native (iOS, Android) and React.js (Web, desktop). Social Sign In 🄵, Messaging 💬 (chat, voice, push notifications), Web3 Wallet 🪪 (profile QR, documents, coins, NFT), DLT 🔐 (provenance, crypto signing), Gamification 🤩, Social Commerce and more.
https://ethora.com/
GNU Affero General Public License v3.0
400 stars 74 forks source link

Admin - Apps - Default chats changes (BE) #480

Closed dzinzyura closed 11 months ago

dzinzyura commented 11 months ago

Goal: Introduce data handling and change making of the received default chat updates from the client side.

Affected metric:

Story: As an app owner, when I go to Apps - "App" - User defaults. I want to change 2nd default change. I enter desired name, change the JID of the app and pin this chat. After this, I click on "Save" button and the chat is changed.

Description: We should have default rooms at server level, specified in .env file. There will be API endpoint such as chat/defaultrooms or something like that that should return 3 default rooms. If in DB for current App there are no defaultRooms records for this current App then the API returns the rooms from server-wide .env file. If there are local App-level settings in DB, then API returns rooms from the DB as set for this app. As soon as App Owner decide they want to change the default rooms, they simply go to App Settings web UI and update settings there with Title, JID and Pinned status for up to 3 new rooms. As soon as new rooms are saved (can also be via /chat/defaultrooms - post method?) then DB records for current app are created and both the client app and the web admin will be reading the new settings, and not the server-wide settings anymore. Each app owner only "edits" their local app settings, just for current app. So if Misha for example sends new values for default rooms from the admin web interface, they should be stored into DB and then default rooms API will be returning those ones. If app owner / admin hits Save without changing the .env defaults, we can also save them as if they entered a new setting just for this app. They can always update it later.

transkarpation commented 11 months ago

We should have default rooms at server level, specified in .env file. Who is responsible for creating the rooms that should be in the .env file? @dzinzyura

dzinzyura commented 11 months ago

done. thank you @transkarpation!