-
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Documentation #486
base: main
Are you sure you want to change the base?
Update Documentation #486
Conversation
Hey @93Kamuran I see you are essentially deleting all the documentation for Environment variables. But I don't understand why 🙈 It looks to me like these are used. And, not only that they are crucial to configuring MPM. Let's use Instead of deleting these could you please instead update the documentation to actually reflect what these environment variables do? For example |
We have "mail_settings" table in tenant databases. The missing part is; We need to add one more settings tab for email settings on settings page. (We can not send all emails in the system for all tenants from one email address right?) If you check the other areas I removed essipecially related plugins like "api url", we have default value on plugin table migrations. |
Yeah, but the default value is taken from If the ENV is empty, the table will also be empty. Or am I missing something? |
Mail is a bit more complicated I think. There should be two mail settings. First one is for instance level email to clients/tenants. I.e. if users sign up so they get Welcome email. This looks like it's actually hardcoded in the code: https://github.com/EnAccess/micropowermanager/blob/main/src/backend/app/Helpers/MailHelper.php#L19 Second one, is client emails to customers. I'm not even so sure this is a relevant use-case? I was thinking the client<>customer communication is done via SMS exclusively? |
solved that with an update. |
Unfortunately, it doesn't work like this 🙈 Few things:
Also, the scope of this PR is documentation only. In here, let's try to only document the status-quo. If you want to improve the way these are handled, please send a separate PR for that. |
Changing "past" migrations is extremely dangerous it can lead to highly inconsistent situations. We should only do this in exceptional cases.
Also, the scope of this PR is documentation only. In here, let's try to only document the status-quo. If you want to improve the way these are handled, please send a separate PR for that.
|
DESCRIBE mail_settings; id Each tenant should specify its on mail settings, for an email which is gonna sent by MPM behalf tenant. MPM needs a email settings page/section also email sending functions should be updated accordingly. |
My question is: Form the code it looks like the |
Yes, you're right! I re-checked the source code and noticed that we use mailing only for sending emails to tenant admins. and that functions use configs from config/mail.php. "mail_settings" may stay for tenant databases. We may consider using it in mailing operations between tenant & end customers in future. So I'm gonna revert my changes related mail envs. |
| Environment Variable | Default | Description | | ||
| -------------------- | ---------------------------------- | ------------------------------------------- | | ||
| `AIRTEL_REQUEST_URL` | **Required** (when plugin is used) | The Airtel service URL. | | ||
| `AIRTEL_USERNAME` | **Required** (when plugin is used) | The Airtel username. | | ||
| `AIRTEL_PASSWORD` | **Required** (when plugin is used) | The Airtel password. | | ||
| `AIRTEL_IPS` | `[]` | List of IP whitelisted for Airtel services. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AirtelTransactionProvider should be removed. We need to develop a plugin for Airtel If we're planning that in future.
| Environment Variable | Default | Description | | ||
| -------------------- | ---------------------------------- | -------------------------------------------------------- | | ||
| `CALIN_CLIENT_URL` | **Required** (when plugin is used) | Calin Meter client URL used for generating STS tokens. | | ||
| `CALIN_USER_ID` | **Required** (when plugin is used) | Calin Meter API username used for generating STS tokens. | | ||
| `CALIN_KEY` | **Required** (when plugin is used) | Calin Meter API key used for generating STS tokens. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CalinReadMeter.php is not using. We have plugins for Calin & Calin Smart meters. The code sample you shared me is legacy code from very old versions of MPM. So that can be removed.
| Environment Variable | Default | Description | | ||
| -------------------- | ---------------------------------- | ---------------------------------------------------------- | | ||
| `METER_DATA_URL` | **Required** (when plugin is used) | Calin Meter API URL used for consumption data upload. | | ||
| `METER_DATA_KEY` | **Required** (when plugin is used) | Calin Meter API key used for consumption data upload. | | ||
| `METER_DATA_USER` | **Required** (when plugin is used) | Calin Meter API username used for consumption data upload. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These seem used
Please don't remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CalinReadMeter.php is not using. We have plugins for Calin & Calin Smart meters. The code sample you shared me is legacy code from very old versions of MPM. So that can be removed.
#### Calin Smart Meters | ||
|
||
For detailed information see [Calin Smart Meter Developer Documentation](https://www.szcalinmeter.com/). | ||
|
||
| Environment Variable | Default | Description | | ||
| ------------------------------ | ---------------------------------- | ------------------------------------------------------------------------- | | ||
| `CALIN_SMART_COMPANY_NAME` | **Required** (when plugin is used) | Calin Smart Meter company name used for communication with Calin API. | | ||
| `CALIN_SMART_PURCHASE_API_URL` | **Required** (when plugin is used) | Calin Smart Meter Purchase API URL used for communication with Calin API. | | ||
| `CALIN_SMART_CLEAR_API_URL` | **Required** (when plugin is used) | Calin Smart Meter Clear API URL used for communication with Calin API. | | ||
| `CALIN_SMART_USER_NAME` | **Required** (when plugin is used) | Calin Smart Meter username used for communication with Calin API. | | ||
| `CALIN_SMART_PASSWORD` | **Required** (when plugin is used) | Calin Smart Meter password used for communication with Calin API. | | ||
| `CALIN_SMART_PASSWORD_VENT` | **Required** (when plugin is used) | Calin Smart Meter password vent used for communication with Calin API. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also remove the corresponding section in services.php
. https://github.com/EnAccess/micropowermanager/blob/main/src/backend/config/services.php#L55-L64
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CalinReadMeter.php is not using. We have plugins for Calin & Calin Smart meters. The code sample you shared me is legacy code from very old versions of MPM. So that can be removed.
| Environment Variable | Default | Description | | ||
| ------------------------------- | ---------------------------------- | --------------------------- | | ||
| `VODACOM_SPID` | **Required** (when plugin is used) | Vodacom SPID. | | ||
| `VODACOM_SPPASSWORD` | **Required** (when plugin is used) | Vodacom SPPASSWORD. | | ||
| `VODACOM_IPS` | **Required** (when plugin is used) | Vodacom IPs. | | ||
| `VODACOM_REQUEST_URL` | **Required** (when plugin is used) | Vodacom Request API URL. | | ||
| `VODACOM_BROKER_CRT` | **Required** (when plugin is used) | Path to broker `.crt` file. | | ||
| `VODACOM_SLL_KEY` | **Required** (when plugin is used) | Path to `.key` file. | | ||
| `VODACOM_CERTIFICATE_AUTHORITY` | **Required** (when plugin is used) | Path to `.cer` file. | | ||
| `VODACOM_SSL_CERT` | **Required** (when plugin is used) | Path to `.pem` file. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VodacomTransactionProvider should be removed. We need to develop a plugin for Airtel If we're planning that in future.
| Environment Variable | Default | Description | | ||
| -------------------- | ---------------------------------- | -------------------------------------------------------------------------------- | | ||
| `SUNKING_API_URL` | **Required** (when plugin is used) | SunKing API URL. For example `https://dev.assetcontrol.central.glp apps.com/v2`. | | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has to stay for now, see below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
@@ -10,7 +10,7 @@ public function up() { | |||
Schema::connection('tenant')->create('sun_king_api_credentials', static function (Blueprint $table) { | |||
$table->increments('id'); | |||
$table->string('auth_url')->default('https://auth.central.glpapps.com/auth/realms/glp-dev/protocol/openid-connect/token'); | |||
$table->string('api_url')->default(config('services.sunKing.url')); | |||
$table->string('api_url')->default('https://assetcontrol.central.glpapps.com/v2'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can only do this, once we have a section in the WebUI for Tenants to set their SunKing URL. Please remove it for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fixed value, So we need to set it into "sun_king_api_credentials" table with default value once "install plugin" command runs. We do not need to show this information on UI side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How would I (as a platform admin) then change my development environment to use the SunKing sandbox?
Hey @93Kamuran thanks for your responses. So, my point is: I don't want to remove these from the docs, as long as they are "used" (or mentioned, really) in the code. If I understand your comments correctly none of the code blocks where these appear is actually getting executed? Could you instead then simply remove the code (and the corresponding section of the docs)? |
Pull Request checklist
Please confirm you have completed any of the necessary steps below.